summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-08-06 17:49:42 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-08-07 15:54:02 +0300
commit68437a8e36e60eac503a1e7e6ed66d8acb74ad5d (patch)
tree8d7d4e3fdbf5f8630f3ff339cd5a854aaae445a2
parent5c529e115394ba3d04c7531d046776293e2bf06c (diff)
downloadlibmts-io-68437a8e36e60eac503a1e7e6ed66d8acb74ad5d.tar.gz
libmts-io-68437a8e36e60eac503a1e7e6ed66d8acb74ad5d.tar.bz2
libmts-io-68437a8e36e60eac503a1e7e6ed66d8acb74ad5d.zip
Quectel EG25-G Delta Radio Firmware Upgrade support - libmts-io implementation
Switched from `sendCommand` with empty command argument to `waitResponse` for URC analysis. Sending empty string to the serial interface is undefined behaviour according to the POSIX standart. More of it, we don't need to execute `write` on file descriptor to wait for URC messages. It was more like a hack than something that was actually required. This commit removes the hack and replaces it with a proper waiting for a response.
-rw-r--r--src/MTS_IO_QuectelRadio.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index 67a8d71..de36987 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -501,7 +501,7 @@ ICellularRadio::CODE QuectelRadio::startOmaDm(ICellularRadio::UpdateCb& stepCb)
}
// Wait for the "Start" response
- std::string sResponse = sendCommand("", vOdmStartedStrings, iTimeoutStart, 0x00);
+ std::string sResponse = waitResponse(vOdmStartedStrings, iTimeoutStart);
printDebug("%s| Radio returned: [%s]", getName().c_str(), sResponse.c_str());
// Received something unexpected or nothing at all?
@@ -517,7 +517,7 @@ ICellularRadio::CODE QuectelRadio::startOmaDm(ICellularRadio::UpdateCb& stepCb)
callNextStep(stepCb, "OMA DM Info: OMA DM started");
// Wait for the "End" or "Abnormal" response
- sResponse = sendCommand("", vOdmFinishedStrings, iTimeoutEnd, 0x00);
+ sResponse = waitResponse(vOdmFinishedStrings, iTimeoutEnd);
printDebug("%s| Radio returned: [%s]", getName().c_str(), sResponse.c_str());
// Received "Abnormal"?
@@ -645,7 +645,7 @@ ICellularRadio::CODE QuectelRadio::fumoLocalApply(ICellularRadio::UpdateCb& step
callNextStep(stepCb, "FUMO Info: waiting for the radio to enter recovery mode");
// Wait for new FOTA responses. Exits preliminary if radio detached.
- sResponse = sendCommand("", vFotaBailStrings, duDetachTimeout, 0x00);
+ sResponse = waitResponse(vFotaBailStrings, duDetachTimeout);
printTrace("Radio response: [%s]", sResponse.c_str());
if (i == 0 && sResponse.find(sFotaUrcPrefix) != std::string::npos) {
@@ -1054,7 +1054,7 @@ ICellularRadio::CODE QuectelRadio::fumoWaitUpgradeFinished(ICellularRadio::Updat
std::string sResponse;
while (!bFinished) { // breaks on "FOTA","END"
- sResponse = sendCommand("", vFotaBailStrings, duUrcTimeout, 0x00);
+ sResponse = waitResponse(vFotaBailStrings, duUrcTimeout);
printTrace("Radio response: [%s]", sResponse.c_str());
if (sResponse.find(sFotaUrcPrefix) == std::string::npos) {