mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-20 14:02:21 +02:00
Merge pull request #446 from david-cermak/fix/modem_command_state_consistency
fix(modem): Fixed inconsistent state on data after OK
This commit is contained in:
@ -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)
|
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)) {
|
if (memchr(data + consumed, separator, len)) {
|
||||||
result = got_line(data, consumed + len);
|
result = got_line(data, consumed + len);
|
||||||
if (result == command_result::OK || result == command_result::FAIL) {
|
if (result == command_result::OK || result == command_result::FAIL) {
|
||||||
|
Reference in New Issue
Block a user