Skip to content

Commit

Permalink
Merge pull request #353 from pennam/at-parse-fix-2
Browse files Browse the repository at this point in the history
WiFiS3: Skip unaligned responses from WiFi chip
  • Loading branch information
pennam authored Aug 19, 2024
2 parents 731b943 + e322670 commit 1564d0a
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 1564d0a

Please sign in to comment.