diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mts/MTS_IO_CellularRadio.h | 7 | ||||
-rw-r--r-- | include/mts/MTS_IO_ICellularRadio.h | 17 | ||||
-rw-r--r-- | include/mts/MTS_IO_QuectelRadio.h | 5 |
3 files changed, 28 insertions, 1 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h index ab6e00a..2b03d8f 100644 --- a/include/mts/MTS_IO_CellularRadio.h +++ b/include/mts/MTS_IO_CellularRadio.h @@ -126,6 +126,13 @@ namespace MTS { int32_t timeoutMillis = 100, const char& ESC = ICellularRadio::CR) override; + //! Wait for response from the radio without sending any data to it + virtual std::string waitResponse(const std::vector<std::string>& vBail = DEFAULT_BAIL_STRINGS, + int32_t timeoutMillis = 100) override; + + //! Wait for response from the radio without sending any data to it + virtual std::string waitResponse(IsNeedMoreData& isNeedMoreData, + int32_t timeoutMillis = 100) override; protected: diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h index 085c217..61ffd20 100644 --- a/include/mts/MTS_IO_ICellularRadio.h +++ b/include/mts/MTS_IO_ICellularRadio.h @@ -83,6 +83,15 @@ namespace MTS { const std::vector<std::string>& vBail = DEFAULT_BAIL_STRINGS, int32_t timeoutMillis = 100, const char& ESC = CR); + + //! Wait for response from the radio without sending any data to it + static std::string waitResponse(MTS::AutoPtr<MTS::IO::Connection>& apIo, + IsNeedMoreData& isNeedMoreData, + int32_t timeoutMillis = 100); + static std::string waitResponse(MTS::AutoPtr<MTS::IO::Connection>& apIo, + const std::vector<std::string>& vBail = DEFAULT_BAIL_STRINGS, + int32_t timeoutMillis = 100); + static CODE test(MTS::AutoPtr<MTS::IO::Connection>& apIo, uint32_t timeoutSeconds = 30); static std::string extractModelFromResult(const std::string& sResult); static std::string getCodeAsString(CODE code); @@ -545,6 +554,14 @@ namespace MTS { int32_t timeoutMillis = 100, const char& ESC = CR) = 0; + //! Wait for response from the radio without sending any data to it + virtual std::string waitResponse(const std::vector<std::string>& vBail = DEFAULT_BAIL_STRINGS, + int32_t timeoutMillis = 100) = 0; + + //! Wait for response from the radio without sending any data to it + virtual std::string waitResponse(IsNeedMoreData& isNeedMoreData, + int32_t timeoutMillis = 100) = 0; + }; } } diff --git a/include/mts/MTS_IO_QuectelRadio.h b/include/mts/MTS_IO_QuectelRadio.h index 58e3d25..9713f48 100644 --- a/include/mts/MTS_IO_QuectelRadio.h +++ b/include/mts/MTS_IO_QuectelRadio.h @@ -73,7 +73,7 @@ namespace MTS { static const std::string VALUE_MTS_DELTA_NAME; static const std::string VALUE_MTS_DELTA_PATH; - CODE startFileUpload(const std::string& sTargetFilename, size_t nBytes); + CODE startFileUpload(const std::string& sTargetFilename, size_t nBytes, uint16_t uRxTimeout = 5, bool bAckEnabled = false); CODE abortFileUpload(); static inline void callNextStep(UpdateCb& stepCb, const char* csMessage); @@ -86,6 +86,9 @@ namespace MTS { CODE fumoWaitUpgradeFinished(UpdateCb& stepCb); CODE fumoWaitNewFirmware(UpdateCb& stepCb); + /// Parse error code if +QIND: "FOTA" received before the first attempt to flash the firmware + std::string getFumoEarlyErrorCode(const std::string& sRadioInput); + /// Get value from container by its index, use default value if not found. Non-template version. const std::string& getByIndex(const std::vector<std::string>& vector, size_t index, const std::string& defaultValue) { if (index >= vector.size()) { |