src/apps/at_parser/at_parser.c
static uint8_t parseInput( char *pInput, T_AT_handler *pHandler, uint8_t *cnt) {
    uint8_t     hIdx = 0;
    int         startOff = 0;
    int         endOff = 0;
    int         endIdx = 0;
    char        tmp[ _AT_CMD_MAXSIZE + 1 ];
    memset( tmp, 0, _AT_CMD_MAXSIZE + 1 );
    memset( paramStorage, 0, paramSize );
    int pSize = strlen( pInput );
    if( ( startOff = searchLut( pInput, MS_LUT, MS_LUT_S, IN_OFF ) ) == -1 )
        startOff = 0;
    if( ( endOff = searchLut( pInput, ME_LUT, ME_LUT_S, IN_OFF ) )  == -1 )
        endOff = _AT_CMD_MAXSIZE;
    if( ( endIdx = searchLut( pInput, ME_LUT, ME_LUT_S, LUT_IDX ) ) == -1 )
        endIdx = 0;
    strncpy( tmp, pInput + startOff, endOff - startOff );
    hIdx = findHandler( tmp );
    *pHandler = handlerStorage[hIdx].handler;

    if( startOff != 0 ) {
        if( strncasecmp( pInput, "AT", startOff ) ) {                     /** in case AB+...  */   
            *pHandler = handlerStorage[0].handler;
            hIdx = 0;
        }
    }
    
    if( hIdx == 0 )               /* Storage the complete Unknown Command and  pass it to user callback function to parse respID */
        strncat( paramStorage, pInput, pSize );
    else{
        if( endOff < pSize - 1 ) {                                          /** Storage params into paramStorage pointer*/
            if(*(pInput+pSize - 1) == '\r')
                *(pInput+pSize - 1) = '\0';
            strncat( paramStorage,  pInput + endOff + 1, pSize - endOff + 1 );
            *cnt = getNbParams( paramStorage );
        } else {
            *cnt = 0;
        }
    }
    return endIdx;
}
/*
 * Parsing
 *
 * @param[in] char* input - AT Command
 * @param[out] at_cmd_cb* cb - handler pointer for the particular command
 * @param[out] uint8_t* cnt -  number of params 
 *
 * Function parses provided raw command string and returns previously saved
 * handler for the particular command. If command is not found return 
 * the default handler.
 */
Parsing
@param[in] char* input - AT Command
@param[out] at_cmd_cb* cb - handler pointer for the particular command
@param[out] uint8_t* cnt -  number of params

Function parses provided raw command string and returns previously saved
handler for the particular command. If command is not found return
the default handler.
Parsing @param [ in ] char * input - AT Command @param [ out ] at_cmd_cb * cb - handler pointer for the particular command @param [ out ] uint8_t * cnt - number of params Function parses provided raw command string and returns previously saved handler for the particular command . If command is not found return the default handler .
static uint8_t parseInput( char *pInput, T_AT_handler *pHandler, uint8_t *cnt) {
    uint8_t     hIdx = 0;
    int         startOff = 0;
    int         endOff = 0;
    int         endIdx = 0;
    char        tmp[ _AT_CMD_MAXSIZE + 1 ];
    memset( tmp, 0, _AT_CMD_MAXSIZE + 1 );
    memset( paramStorage, 0, paramSize );
    int pSize = strlen( pInput );
    if( ( startOff = searchLut( pInput, MS_LUT, MS_LUT_S, IN_OFF ) ) == -1 )
        startOff = 0;
    if( ( endOff = searchLut( pInput, ME_LUT, ME_LUT_S, IN_OFF ) )  == -1 )
        endOff = _AT_CMD_MAXSIZE;
    if( ( endIdx = searchLut( pInput, ME_LUT, ME_LUT_S, LUT_IDX ) ) == -1 )
        endIdx = 0;
    strncpy( tmp, pInput + startOff, endOff - startOff );
    hIdx = findHandler( tmp );
    *pHandler = handlerStorage[hIdx].handler;
    if( startOff != 0 ) {
        if( strncasecmp( pInput, "AT", startOff ) ) {                        
            *pHandler = handlerStorage[0].handler;
            hIdx = 0;
        }
    }
    if( hIdx == 0 )               
        strncat( paramStorage, pInput, pSize );
    else{
        if( endOff < pSize - 1 ) {                                          
            if(*(pInput+pSize - 1) == '\r')
                *(pInput+pSize - 1) = '\0';
            strncat( paramStorage,  pInput + endOff + 1, pSize - endOff + 1 );
            *cnt = getNbParams( paramStorage );
        } else {
            *cnt = 0;
        }
    }
    return endIdx;
}
static uint8_t parseInput ( char * pInput , T_AT_handler * pHandler , uint8_t * cnt ) { uint8_t hIdx = 0 ; int startOff = 0 ; int endOff = 0 ; int endIdx = 0 ; char tmp [ _AT_CMD_MAXSIZE + 1 ] ; memset ( tmp , 0 , _AT_CMD_MAXSIZE + 1 ) ; memset ( paramStorage , 0 , paramSize ) ; int pSize = strlen ( pInput ) ; if ( ( startOff = searchLut ( pInput , MS_LUT , MS_LUT_S , IN_OFF ) ) == -1 ) startOff = 0 ; if ( ( endOff = searchLut ( pInput , ME_LUT , ME_LUT_S , IN_OFF ) ) == -1 ) endOff = _AT_CMD_MAXSIZE ; if ( ( endIdx = searchLut ( pInput , ME_LUT , ME_LUT_S , LUT_IDX ) ) == -1 ) endIdx = 0 ; strncpy ( tmp , pInput + startOff , endOff - startOff ) ; hIdx = findHandler ( tmp ) ; * pHandler = handlerStorage [ hIdx ] . handler ; if ( startOff != 0 ) { if ( strncasecmp ( pInput , " " , startOff ) ) { * pHandler = handlerStorage [ 0 ] . handler ; hIdx = 0 ; } } if ( hIdx == 0 ) strncat ( paramStorage , pInput , pSize ) ; else { if ( endOff < pSize - 1 ) { if ( * ( pInput + pSize - 1 ) == ' \r ' ) * ( pInput + pSize - 1 ) = ' \0 ' ; strncat ( paramStorage , pInput + endOff + 1 , pSize - endOff + 1 ) ; * cnt = getNbParams ( paramStorage ) ; } else { * cnt = 0 ; } } return endIdx ; }
Parsing
 @param[in] char* input - AT Command
 @param[out] at_cmd_cb* cb - handler pointer for the particular command
 @param[out] uint8_t* cnt -  number of params
Parsing @param [ in ] char * input - AT Command @param [ out ] at_cmd_cb * cb - handler pointer for the particular command @param [ out ] uint8_t * cnt - number of params
/** in case AB+...  */ /* Storage the complete Unknown Command and  pass it to user callback function to parse respID */ /** Storage params into paramStorage pointer*/