Skip to content

Commit

Permalink
Merge pull request #446 from david-cermak/fix/modem_command_state_con…
Browse files Browse the repository at this point in the history
…sistency

fix(modem): Fixed inconsistent state on data after OK
  • Loading branch information
david-cermak authored Dec 6, 2023
2 parents 1bf6843 + bf99f28 commit 671190b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/esp_modem/src/esp_modem_dte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ void DTE::on_read(got_line_cb on_read_cb)

bool DTE::command_cb::process_line(uint8_t *data, size_t consumed, size_t len)
{
if (result != command_result::TIMEOUT) {
return false; // this line has been processed already (got OK or FAIL previously)
}
if (memchr(data + consumed, separator, len)) {
result = got_line(data, consumed + len);
if (result == command_result::OK || result == command_result::FAIL) {
Expand Down

0 comments on commit 671190b

Please sign in to comment.