Skip to content

Commit

Permalink
Skip unaligned responses from WiFi chip
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Jul 19, 2024
1 parent 0af3cba commit e322670
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libraries/WiFiS3/src/Modem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,28 +228,36 @@ bool ModemClass::buf_read(const string &prompt, string &data_res) {
}
else {
if(string::npos != data_res.rfind(RESULT_DATA)) {
found = true;
data_res = data_res.substr(0, data_res.length() - (sizeof(RESULT_DATA) - 1));
if(prompt != DO_NOT_CHECK_CMD) {
if(removeAtBegin(data_res, prompt)) {
res = true;
found = true;
} else {
data_res.clear();
continue;
}
}
else {
res = true;
found = true;
}
break;
}
else if(string::npos != data_res.rfind(RESULT_OK)){
found = true;
data_res = data_res.substr(0, data_res.length() - (sizeof(RESULT_OK) - 1) );
if(prompt != DO_NOT_CHECK_CMD) {
if(removeAtBegin(data_res, prompt)) {
res = true;
found = true;
} else {
data_res.clear();
continue;
}
}
else {
res = true;
found = true;
}
break;
}
Expand Down

0 comments on commit e322670

Please sign in to comment.