From 26f6e69e9d5c7049d42559259933482b35559889 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Thu, 28 May 2020 14:51:31 +0300 Subject: Quectel Delta Radio Firmware Upgrade support - libmts-io implementation Declared base interface and added stub implementation for the Delta Radio Firmware Upgrade support in libmts-io. --- src/MTS_IO_CellularRadio.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/MTS_IO_CellularRadio.cpp') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 50fdf5c..d3bee11 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -1008,6 +1008,24 @@ ICellularRadio::CODE CellularRadio::updateFumo(const Json::Value&, UpdateCb&) { return NOT_APPLICABLE; } +ICellularRadio::CODE CellularRadio::uploadDeltaFirmwareFile(int, ICellularRadio::UpdateCb&) { + printTrace("%s| Upload Delta Firmware Upgrade File: not applicable", m_sName.c_str()); + + return NOT_APPLICABLE; +} + +ICellularRadio::CODE CellularRadio::removeDeltaFirmwareFile() { + printTrace("%s| Remove Delta Firmware Upgrade File: not applicable", m_sName.c_str()); + + return NOT_APPLICABLE; +} + +ICellularRadio::CODE CellularRadio::applyDeltaFirmwareFile(ICellularRadio::UpdateCb&) { + printTrace("%s| Apply Delta Firmware Upgrade File: not applicable", m_sName.c_str()); + + return NOT_APPLICABLE; +} + ICellularRadio::CODE CellularRadio::resetHfa(const Json::Value&, UpdateCb&) { printTrace("%s| HFA Reset", m_sName.c_str()); -- cgit v1.2.3 From 6e9ce61addd97809d5ea7b912332dd11a4bf7cee Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Fri, 29 May 2020 21:02:15 +0300 Subject: Quectel Delta Radio Firmware Upgrade support - libmts-io implementation Initial implementation of the delta firmware image upload for Quectel radios. --- src/MTS_IO_CellularRadio.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/MTS_IO_CellularRadio.cpp') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index d3bee11..26d9f43 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -1072,6 +1072,23 @@ std::string CellularRadio::sendCommand(const std::string& sCmd, MTS::IO::Cellula return ICellularRadio::sendCommand(m_apIo, sCmd, isNeedMoreData, timeoutMillis, ESC); } +ICellularRadio::CODE CellularRadio::sendData(const char* pData, size_t nBytes) { + if(m_apIo.isNull()) { + printError("RADIO| IO is not set in sendData"); + return ERROR; + } + + int32_t iResult; + iResult = m_apIo->write(pData, nBytes); + + if(iResult == -1) { + printError("RADIO| Failed to send data to radio"); + return ERROR; + } + + return SUCCESS; +} + bool CellularRadio::splitAndAssign(const std::string& sLine, const std::string& sKey, Json::Value& jParent, const std::string& sJsonKey, Json::ValueType eType) { std::vector vParts = MTS::Text::split(sLine, ":", 2); -- cgit v1.2.3 From 2c3296b5239b5d27f5df4d61a9609ace6d70904f Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Fri, 3 Jul 2020 17:59:47 +0300 Subject: Quectel Delta Radio Firmware Upgrade support - libmts-io implementation Started code cleanup before finishing the procedure. Renamed functions related to the delta radio firmware upgrade to follow established patterns: - uploadDeltaFirmwareFile -> fumoLocalInject - applyDeltaFirmwareFile -> fumoLocalApply - removeDeltaFirmwareFile -> fumoLocalCleanup - new function: updateFumoLocal - encapsulates all the magic for radios that may not support separate stages for the delta upload and delta apply --- src/MTS_IO_CellularRadio.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/MTS_IO_CellularRadio.cpp') diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 55f719f..bb7cd40 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -1051,20 +1051,26 @@ ICellularRadio::CODE CellularRadio::updateFumo(const Json::Value&, UpdateCb&) { return NOT_APPLICABLE; } -ICellularRadio::CODE CellularRadio::uploadDeltaFirmwareFile(int, ICellularRadio::UpdateCb&) { - printTrace("%s| Upload Delta Firmware Upgrade File: not applicable", m_sName.c_str()); +ICellularRadio::CODE CellularRadio::updateFumoLocal(int, ICellularRadio::UpdateCb&) { + printTrace("%s| Update Local Firmware Update Management Object", m_sName.c_str()); return NOT_APPLICABLE; } -ICellularRadio::CODE CellularRadio::removeDeltaFirmwareFile() { - printTrace("%s| Remove Delta Firmware Upgrade File: not applicable", m_sName.c_str()); +ICellularRadio::CODE CellularRadio::fumoLocalInject(int, ICellularRadio::UpdateCb&) { + printTrace("%s| Inject Delta Firmware Image File: not applicable", m_sName.c_str()); return NOT_APPLICABLE; } -ICellularRadio::CODE CellularRadio::applyDeltaFirmwareFile(ICellularRadio::UpdateCb&) { - printTrace("%s| Apply Delta Firmware Upgrade File: not applicable", m_sName.c_str()); +ICellularRadio::CODE CellularRadio::fumoLocalApply(ICellularRadio::UpdateCb&) { + printTrace("%s| Apply Delta Firmware Image File: not applicable", m_sName.c_str()); + + return NOT_APPLICABLE; +} + +ICellularRadio::CODE CellularRadio::fumoLocalCleanup() { + printTrace("%s| Cleanup Delta Firmware Image File: not applicable", m_sName.c_str()); return NOT_APPLICABLE; } -- cgit v1.2.3