From 51a4db87617b4dc7d9276e31298d0a9d44ecb69e Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 4 Aug 2020 12:21:10 +0300 Subject: Quectel EG25-G Delta Radio Firmware Upgrade support - libmts-io implementation CellularRadio::resetConnection implementations disables serial echo on connection reset. Serial echo is disabled using ATE0 command, radio may handle it and return an OK response. During testing I discovered that EG25 radio does not return an OK response in 100ms (default timeout time) and this OK response may conflict with successive AT commands. This commit adds a simple "AT" command to be executed before getVendorFirmware to "eat" all the data accumulated in the buffer. --- src/MTS_IO_QuectelRadio.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index 7d205e7..96a4980 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -1104,7 +1104,9 @@ ICellularRadio::CODE QuectelRadio::fumoWaitNewFirmware(ICellularRadio::UpdateCb& MTS::Thread::sleep(10000); - if (getVendorFirmware(sQuectelFirmware) != SUCCESS) { + // sendBasicCommand "eats" and clears all the extra data present in the buffer, + // both commands shall succeed + if (sendBasicCommand("AT") != SUCCESS || getVendorFirmware(sQuectelFirmware) != SUCCESS) { // The radio is probably unavailable resetConnection(100); continue; -- cgit v1.2.3