diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-07-15 06:06:43 -0500 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-07-15 06:06:43 -0500 |
commit | f0be0e4a343f9a600fe8c9fc34fa580c548a4e9e (patch) | |
tree | 34daf8e9219c894ca36dd1f7ddf4560aa395c659 /include/mts/MTS_IO_TelitRadio.h | |
parent | b4b5e4958a11cc9e969355f60e08d0631b01c402 (diff) | |
parent | 8186f98913c55191b5a3610d19c8580c6a86c2f4 (diff) | |
download | libmts-io-f0be0e4a343f9a600fe8c9fc34fa580c548a4e9e.tar.gz libmts-io-f0be0e4a343f9a600fe8c9fc34fa580c548a4e9e.tar.bz2 libmts-io-f0be0e4a343f9a600fe8c9fc34fa580c548a4e9e.zip |
Merge branch 'ap/l4e1-delta-fwu' into 'delta-radio-fwu'
MTX-3404 mPower Oct20: Delta Radio Firmware Upgrade - L4E1 - libmts-io support
See merge request !28
Diffstat (limited to 'include/mts/MTS_IO_TelitRadio.h')
-rw-r--r-- | include/mts/MTS_IO_TelitRadio.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/include/mts/MTS_IO_TelitRadio.h b/include/mts/MTS_IO_TelitRadio.h index bd542f1..a3425f9 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,53 @@ 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 fumoWriteGroupsABD(int fd, UpdateCb& stepCb); + //virtual CODE fumoWriteGroupC(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 startWrite(); + CODE abortWrite(); + + static inline void callNextStep(UpdateCb& stepCb, const char* csMessage); + static inline void callNextStep(UpdateCb& stepCb, const std::string& sMessage); + + CODE fumoWaitUpgradeFinished(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_ */ |