summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2020-07-10 15:40:48 +0300
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2020-07-10 15:40:48 +0300
commite09f54c6b6fe35dc022fcea66935f5269866bff1 (patch)
tree9607af6717f2663ffc31aa70eee55ba44d49f881 /include
parent9e007df4a7e3fafff27a0c3fa11d4ba53e785985 (diff)
downloadlibmts-io-e09f54c6b6fe35dc022fcea66935f5269866bff1.tar.gz
libmts-io-e09f54c6b6fe35dc022fcea66935f5269866bff1.tar.bz2
libmts-io-e09f54c6b6fe35dc022fcea66935f5269866bff1.zip
MTX-3404 mPower Oct20: Delta Radio Firmware Upgrade - L4E1 - libmts-io support
Diffstat (limited to 'include')
-rw-r--r--include/mts/MTS_IO_LE910C4EURadio.h1
-rw-r--r--include/mts/MTS_IO_TelitRadio.h50
2 files changed, 50 insertions, 1 deletions
diff --git a/include/mts/MTS_IO_LE910C4EURadio.h b/include/mts/MTS_IO_LE910C4EURadio.h
index e872df3..a0d6baa 100644
--- a/include/mts/MTS_IO_LE910C4EURadio.h
+++ b/include/mts/MTS_IO_LE910C4EURadio.h
@@ -35,6 +35,7 @@ namespace MTS {
virtual ~LE910C4EURadio(){};
protected:
+ FOTA_GROUP getFotaGroup() override;
private:
diff --git a/include/mts/MTS_IO_TelitRadio.h b/include/mts/MTS_IO_TelitRadio.h
index bd542f1..07a95de 100644
--- a/include/mts/MTS_IO_TelitRadio.h
+++ b/include/mts/MTS_IO_TelitRadio.h
@@ -44,6 +44,10 @@ namespace MTS {
CODE getSupportedCellularModes(CELLULAR_MODES &networks) override;
CODE setCellularMode(CELLULAR_MODES networks) override;
+ CODE updateFumoLocal(int fd, UpdateCb& stepCb) override;
+ CODE fumoLocalInject(int fd, UpdateCb& stepCb) override;
+ CODE fumoLocalApply(UpdateCb& stepCb) override;
+
protected:
TelitRadio(const std::string& sName, const std::string& sRadioPort);
@@ -53,10 +57,54 @@ namespace MTS {
CODE getIsSimInserted(bool& bData) override;
CODE getSimLockAttempts(int& iAttemptsPin, int& iAttemptsPuk) override;
+ enum FOTA_GROUP : uint8_t {
+ VALUE_GROUP_A = 0,
+ VALUE_GROUP_B,
+ VALUE_GROUP_C,
+ VALUE_GROUP_D,
+ VALUE_UNKNOWN
+ };
+
+ virtual FOTA_GROUP getFotaGroup();
+ virtual CODE uploadFile(int fd, UpdateCb& stepCb);
+
private:
virtual CODE getSimLockAttempts(int& iAttemptsPin, int& iAttemptsPuk, const std::string& sLockStatus);
ICellularRadio::CODE wdsList(std::set<int> &wds);
+
+ // private variable to save old firmware versions during FOTA
+ std::string m_sTelitFirmware;
+
+ static const size_t FILE_CHUNK_SIZE;
+ static const std::string CMD_ABORT_UPLOAD;
+
+ CODE getTelitFirmware(std::string& sFirmware);
+
+ CODE startFileUpload();
+ CODE abortFileUpload();
+
+ static inline void callNextStep(UpdateCb& stepCb, const char* csMessage);
+ static inline void callNextStep(UpdateCb& stepCb, const std::string& sMessage);
+
+ static CODE getFileSize(int fd, size_t& nBytes, size_t& nFileChunks);
+ static CODE readChunk(int fd, char* pChunk, size_t dChunkSize, size_t& nReadBytes);
+ CODE fumoWaitRadioBooted(UpdateCb& stepCb);
+ CODE fumoCheckNewFirmware(UpdateCb& stepCb);
+
};
}
}
-#endif
+
+void MTS::IO::TelitRadio::callNextStep(ICellularRadio::UpdateCb& stepCb, const char* csMessage) {
+ if (stepCb) {
+ stepCb(Json::Value(csMessage));
+ }
+}
+
+void MTS::IO::TelitRadio::callNextStep(ICellularRadio::UpdateCb& stepCb, const std::string& sMessage) {
+ if (stepCb) {
+ stepCb(Json::Value(sMessage));
+ }
+}
+
+#endif /* MTS_IO_TELITRADIO_H_ */