summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-28 14:51:31 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-30 11:38:47 +0300
commit26f6e69e9d5c7049d42559259933482b35559889 (patch)
tree8ca06d0dbe77a4ca8eab4dce4cdd3bf6928a4e6c
parent9a78ce7478a507337bc78967e7ed244c5179b45c (diff)
downloadlibmts-io-26f6e69e9d5c7049d42559259933482b35559889.tar.gz
libmts-io-26f6e69e9d5c7049d42559259933482b35559889.tar.bz2
libmts-io-26f6e69e9d5c7049d42559259933482b35559889.zip
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.
-rw-r--r--include/mts/MTS_IO_CellularRadio.h3
-rw-r--r--include/mts/MTS_IO_ICellularRadio.h50
-rw-r--r--src/MTS_IO_CellularRadio.cpp18
3 files changed, 71 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h
index 56506af..9fdb076 100644
--- a/include/mts/MTS_IO_CellularRadio.h
+++ b/include/mts/MTS_IO_CellularRadio.h
@@ -98,6 +98,9 @@ namespace MTS {
CODE updateDc(const Json::Value& jArgs, UpdateCb& stepCb) override;
CODE updatePrl(const Json::Value& jArgs, UpdateCb& stepCb) override;
CODE updateFumo(const Json::Value& jArgs, UpdateCb& stepCb) override;
+ CODE uploadDeltaFirmwareFile(int fd, UpdateCb& stepCb) override;
+ CODE removeDeltaFirmwareFile() override;
+ CODE applyDeltaFirmwareFile(UpdateCb& stepCb) override;
CODE resetHfa(const Json::Value& jArgs, UpdateCb& stepCb) override;
CODE activate(const Json::Value& jArgs, UpdateCb& stepCb) override;
CODE setActiveFirmware(const Json::Value& jArgs) override;
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h
index 58d5076..5123ba1 100644
--- a/include/mts/MTS_IO_ICellularRadio.h
+++ b/include/mts/MTS_IO_ICellularRadio.h
@@ -405,6 +405,56 @@ namespace MTS {
*/
virtual CODE updateFumo(const Json::Value& jArgs, UpdateCb& stepCb) = 0;
+ /**
+ * @brief uploadDeltaFirmwareFile - upload delta file to the radio's internal memory.
+ *
+ * This command uploads (injects) the whole delta firmware image to some place that
+ * can be later used by the radio to perform the Delta Radio Firmware Upgrade.
+ *
+ * This delta firmware image is NOT validated on the firmware image upload step.
+ *
+ * @param fd - file sescriptor of a file that shall be uploaded to the radio.
+ * @param stepCb - the callback to receive status updates during the upload.
+ * @return CODE::SUCCESS when the file was successfully uploaded,
+ * CODE::INVALID_ARGS when the file can't be opened for reading,
+ * CODE::NOT_APPLICABLE when not supported by this radio,
+ * CODE::ERROR otherwise.
+ */
+ virtual CODE uploadDeltaFirmwareFile(int fd, UpdateCb& stepCb) = 0;
+
+ /**
+ * @brief removeDeltaFirmwareFile - remove the delta file from the radio's internal memory.
+ *
+ * This command allows to remove the old delta firmware image from the radio's internal
+ * memory for cases when it's no longer needed.
+ *
+ * @param fd - file sescriptor of a file that shall be uploaded to the radio.
+ * @return CODE::SUCCESS when the file was successfully deleted,
+ * CODE::FAILURE when the file can't be deleted (i.e. no such file),
+ * CODE::NOT_APPLICABLE when not supported by this radio,
+ * CODE::ERROR otherwise.
+ */
+ virtual CODE removeDeltaFirmwareFile() = 0;
+
+ /**
+ * @brief applyDeltaFirmwareFile - apply the delta file that was previously uploaded.
+ *
+ * This commands initializes and tracks the progress of the delta firmware upgrade
+ * procedure using the delta firmware image file that was previously uploaded
+ * into internal radio's memory.
+ *
+ * See ICellularRadio::removeDeltaFirmwareFile to upload the file and prepare
+ * for the upgrade.
+ *
+ * @param fd - file sescriptor of a file that shall be uploaded to the radio.
+ * @param stepCb - the callback to receive status updates during the upgrade.
+ * @return CODE::SUCCESS when the file was successfully deleted,
+ * CODE::FAILURE when the file can't be deleted (i.e. no such file),
+ * CODE::NOT_APPLICABLE when not supported by this radio,
+ * CODE::ERROR otherwise.
+ */
+ virtual CODE applyDeltaFirmwareFile(UpdateCb& stepCb) = 0;
+
/*
* jArgs = {
* "msl" : "Master Subsidy Lock (Sprint): STRING"
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());