@@ -681,12 +681,12 @@ void ESP8266::_oob_packet_hdlr()
681681 int pdu_len;
682682
683683 // Get socket id
684- if (!_parser.recv (" ,%d," , &id)) {
684+ if (!_parser.scanf (" ,%d," , &id)) {
685685 return ;
686686 }
687687
688688 if (_tcp_passive && _sock_i[id].open == true && _sock_i[id].proto == NSAPI_TCP) {
689- if (_parser.recv (" %d\n " , &amount)) {
689+ if (_parser.scanf (" %d\n " , &amount)) {
690690 _sock_i[id].tcp_data_avbl = amount;
691691
692692 // notify data is available
@@ -695,7 +695,7 @@ void ESP8266::_oob_packet_hdlr()
695695 }
696696 }
697697 return ;
698- } else if (!_parser.recv (" %d:" , &amount)) {
698+ } else if (!_parser.scanf (" %d:" , &amount)) {
699699 return ;
700700 }
701701
@@ -1059,14 +1059,14 @@ void ESP8266::_oob_ready()
10591059
10601060void ESP8266::_oob_busy ()
10611061{
1062- char status[ 5 ] ;
1063- if (_parser.recv (" %4[^ \" ] \ n" , status)) {
1064- if ( strcmp ( status, " s... " ) == 0 ) {
1062+ char status;
1063+ if (_parser.scanf (" %c... \ n" , & status)) {
1064+ if ( status == ' s ' ) {
10651065 tr_debug (" busy s..." );
1066- } else if (strcmp ( status, " p... " ) == 0 ) {
1066+ } else if (status == ' p ' ) {
10671067 tr_debug (" busy p..." );
10681068 } else {
1069- tr_error (" unrecognized busy state \' %s \ '" , status);
1069+ tr_error (" unrecognized busy state '%c... '" , status);
10701070 MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
10711071 " ESP8266::_oob_busy() unrecognized busy state\n " );
10721072 }
@@ -1084,7 +1084,7 @@ void ESP8266::_oob_tcp_data_hdlr()
10841084
10851085 MBED_ASSERT (_sock_active_id >= 0 && _sock_active_id < 5 );
10861086
1087- if (!_parser.recv (" %" SCNd32 " :" , &len)) {
1087+ if (!_parser.scanf (" %" SCNd32 " :" , &len)) {
10881088 return ;
10891089 }
10901090
@@ -1113,7 +1113,7 @@ void ESP8266::_oob_connect_err()
11131113 _fail = false ;
11141114 _connect_error = 0 ;
11151115
1116- if (_parser.recv (" %d" , &_connect_error) && _parser.recv (" FAIL" )) {
1116+ if (_parser.scanf (" %d" , &_connect_error) && _parser.scanf (" FAIL" )) {
11171117 _fail = true ;
11181118 _parser.abort ();
11191119 }
0 commit comments