diff options
Diffstat (limited to 'include/mts/MTS_IO_ICellularRadio.h')
-rw-r--r-- | include/mts/MTS_IO_ICellularRadio.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h index f3e15e2..0523236 100644 --- a/include/mts/MTS_IO_ICellularRadio.h +++ b/include/mts/MTS_IO_ICellularRadio.h @@ -205,6 +205,10 @@ namespace MTS { static const char *KEY_ATTEMPTS_PIN; //!< The number of attempts left to unlock the SIM card using PIN code static const char *KEY_ATTEMPTS_PUK; //!< The number of attempts left to unlock the SIM card using PUK code + //PDP Context + static const char *KEY_PDP_CONTEXT_APN; + static const char *KEY_PDP_CONTEXT_IPMODE; + //Values - Type static const char *VALUE_TYPE_LTE; static const char *VALUE_TYPE_GSM; @@ -656,6 +660,64 @@ namespace MTS { */ virtual CODE getSelectedBandsRaw(std::string& sRawBands) = 0; + /** + * @brief Get the list of PDP contexts from the radio + * + * @param jData - an object to be filled with data. + * { + * "<context_number: str>": { + * "apn": "<apn_value: str>", + * "ipMode": "<ip_mode: str>" + * } + * } + * + * @return CODE::SUCCESS when fetched successfully, + * CODE::NO_RESPONSE when the modem doesn't respond, + * CODE::ERROR when the radio returns "ERROR", + * CODE::FAILURE otherwise (unexpected response). + */ + virtual CODE getPdpContexts(Json::Value& jData) = 0; + + /** + * @brief Set the PDP context to the radio + * + * @param sId - a string value that contains an ID of the PDP context to change. + * @param jConfig - a JSON-object that contains: + * an IP mode for the specified PDP context, + * an APN for the specified PDP context. + * { + * "apn": "<APN>", + * "ipMode": "<IP MODE>" + * } + * + * @return CODE::SUCCESS when fetched successfully, + * CODE::NO_RESPONSE when the modem doesn't respond, + * CODE::ERROR when the radio returns "ERROR", + * CODE::FAILURE otherwise (unexpected response). + */ + virtual CODE setPdpContext(const std::string& sId, const Json::Value& jConfig) = 0; + + /** + * @brief Execute the diagnostics AT commands and capture their output + * + * NOTE: The list of diagnostic AT commands is radio-specific and changes + * depending on the radio model (code). + * + * NOTE: The method stops its execution if the radio repeatedly ignores + * the commands (returns no execution result for several of them). This + * is required to limit the maximum execution time of the function and + * prevent the process from occupying the radio for too long. In case + * of timeout, the report will contain the output of all commands that + * it managed to execute before the failure. + * + * @param sDiagReport - the AT commands execution report. + * + * @return CODE::SUCCESS when fetched successfully, + * CODE::NO_RESPONSE when the radio ignored several of the AT commands, + * CODE::FAILURE otherwise. + */ + virtual CODE getDiagnostics(std::string& sDiagReport) = 0; + }; } } |