@@ -681,12 +681,12 @@ void ESP8266::_oob_packet_hdlr()
681
681
int pdu_len;
682
682
683
683
// Get socket id
684
- if (!_parser.recv (" ,%d," , &id)) {
684
+ if (!_parser.scanf (" ,%d," , &id)) {
685
685
return ;
686
686
}
687
687
688
688
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)) {
690
690
_sock_i[id].tcp_data_avbl = amount;
691
691
692
692
// notify data is available
@@ -695,7 +695,7 @@ void ESP8266::_oob_packet_hdlr()
695
695
}
696
696
}
697
697
return ;
698
- } else if (!_parser.recv (" %d:" , &amount)) {
698
+ } else if (!_parser.scanf (" %d:" , &amount)) {
699
699
return ;
700
700
}
701
701
@@ -1059,14 +1059,14 @@ void ESP8266::_oob_ready()
1059
1059
1060
1060
void ESP8266::_oob_busy ()
1061
1061
{
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 ' ) {
1065
1065
tr_debug (" busy s..." );
1066
- } else if (strcmp ( status, " p... " ) == 0 ) {
1066
+ } else if (status == ' p ' ) {
1067
1067
tr_debug (" busy p..." );
1068
1068
} else {
1069
- tr_error (" unrecognized busy state \' %s \ '" , status);
1069
+ tr_error (" unrecognized busy state '%c... '" , status);
1070
1070
MBED_ERROR (MBED_MAKE_ERROR (MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
1071
1071
" ESP8266::_oob_busy() unrecognized busy state\n " );
1072
1072
}
@@ -1084,7 +1084,7 @@ void ESP8266::_oob_tcp_data_hdlr()
1084
1084
1085
1085
MBED_ASSERT (_sock_active_id >= 0 && _sock_active_id < 5 );
1086
1086
1087
- if (!_parser.recv (" %" SCNd32 " :" , &len)) {
1087
+ if (!_parser.scanf (" %" SCNd32 " :" , &len)) {
1088
1088
return ;
1089
1089
}
1090
1090
@@ -1113,7 +1113,7 @@ void ESP8266::_oob_connect_err()
1113
1113
_fail = false ;
1114
1114
_connect_error = 0 ;
1115
1115
1116
- if (_parser.recv (" %d" , &_connect_error) && _parser.recv (" FAIL" )) {
1116
+ if (_parser.scanf (" %d" , &_connect_error) && _parser.scanf (" FAIL" )) {
1117
1117
_fail = true ;
1118
1118
_parser.abort ();
1119
1119
}
0 commit comments