Skip to content

Commit 671190b

Browse files
authored
Merge pull request #446 from david-cermak/fix/modem_command_state_consistency
fix(modem): Fixed inconsistent state on data after OK
2 parents 1bf6843 + bf99f28 commit 671190b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/esp_modem/src/esp_modem_dte.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ void DTE::on_read(got_line_cb on_read_cb)
347347

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

0 commit comments

Comments
 (0)