Arm Mbed OS support forum

ATCmdParser scanf does not work

Hi all,

I updated mbed studio tools to the latest versions yesterday and since then the scanf from the AT commands stopped working/ fails to get a value…


    char * timeBuff;

    timeBuff = (char *) malloc(23); 

    _parser->send("AT+QNTP=1,\"pool.ntp.org\",123,1");

    if (!( _parser->recv("OK") && (_parser->scanf("+QNTP: %d,\"%22s\"", &status, timeBuff))))
    {}

    //I have also tried this way..

    // if (!( _parser->recv("OK") && (_parser->scanf("+QNTP: %d,\"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\"", &status, timeBuff, 
    //     timeBuff+1, timeBuff+2, timeBuff+3, timeBuff+4, timeBuff+5, timeBuff+6, timeBuff+7, timeBuff+8, 
    //     timeBuff+9, timeBuff+10, timeBuff+11, timeBuff+12, timeBuff+13, timeBuff+14, timeBuff+15, timeBuff+16, 
    //     timeBuff+17, timeBuff+18, timeBuff+19,timeBuff+20,timeBuff+21))))
    // {}

UART below:
image

Kind regards,
Raf