summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_TelitRadio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mts/MTS_IO_TelitRadio.h')
-rw-r--r--include/mts/MTS_IO_TelitRadio.h49
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..ffdddd9 100644
--- a/include/mts/MTS_IO_TelitRadio.h
+++ b/include/mts/MTS_IO_TelitRadio.h
@@ -30,6 +30,8 @@ namespace MTS {
public:
bool resetRadio(uint32_t iTimeoutMillis = 5000) override;
+ CODE getFirmwareBuild(std::string& sFirmwareBuild) override;
+ CODE getVendorFirmware(std::string& sVendorFirmware) override;
CODE getModel(std::string& sModel) override;
CODE getIccid(std::string& sIccid) override;
CODE getService(std::string& sService) override;
@@ -44,6 +46,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 +59,51 @@ 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 startFotaWriteABD();
+ CODE abortFotaWriteABD();
+
+ 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_ */