src/atchannel.c
/**
 * Returns error code from response
 * Assumes AT+CMEE=1 (numeric) mode
 */
Returns error code from response
Assumes AT+CMEE=1 (numeric) mode
Returns error code from response Assumes AT + CMEE = 1 ( numeric ) mode
AT_CME_Error at_get_cme_error(const ATResponse *p_response)
{
    if (!p_response) {
        return CME_ERROR_NON_CME;
    }
    int ret;
    int err;
    char *p_cur;
    if (p_response->success) {
        return CME_SUCCESS;
    }
    if (p_response->finalResponse == NULL
        || !strStartsWith(p_response->finalResponse, "+CME ERROR:")
    ) {
        return CME_ERROR_NON_CME;
    }
    p_cur = p_response->finalResponse;
    err = at_tok_start(&p_cur);
    if (err < 0) {
        return CME_ERROR_NON_CME;
    }
    err = at_tok_nextint(&p_cur, &ret);
    if (err < 0) {
        return CME_ERROR_NON_CME;
    }
    return (AT_CME_Error) ret;
}
AT_CME_Error at_get_cme_error ( const ATResponse * p_response ) { if ( ! p_response ) { return CME_ERROR_NON_CME ; } int ret ; int err ; char * p_cur ; if ( p_response -> success ) { return CME_SUCCESS ; } if ( p_response -> finalResponse == NULL || ! strStartsWith ( p_response -> finalResponse , " " ) ) { return CME_ERROR_NON_CME ; } p_cur = p_response -> finalResponse ; err = at_tok_start ( & p_cur ) ; if ( err < 0 ) { return CME_ERROR_NON_CME ; } err = at_tok_nextint ( & p_cur , & ret ) ; if ( err < 0 ) { return CME_ERROR_NON_CME ; } return ( AT_CME_Error ) ret ; }
Returns error code from response
 Assumes AT+CMEE=1 (numeric) mode
Returns error code from response Assumes AT + CMEE = 1 ( numeric ) mode