summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_ICellularRadio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mts/MTS_IO_ICellularRadio.h')
-rw-r--r--include/mts/MTS_IO_ICellularRadio.h51
1 files changed, 41 insertions, 10 deletions
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h
index d5b5f18..2a22a5a 100644
--- a/include/mts/MTS_IO_ICellularRadio.h
+++ b/include/mts/MTS_IO_ICellularRadio.h
@@ -78,6 +78,13 @@ namespace MTS {
CS_MODE2 // only non-EPS services are allowed, the usage is "data centric"
};
+ enum PDP_CONTEXT_AUTH_TYPE : uint8_t {
+ NONE = 0,
+ PAP,
+ CHAP,
+ PAP_CHAP
+ };
+
static CODE convertModelToType(const std::string& sModel, std::string& sType);
static CODE convertModelToMtsShortCode(const std::string& sModel, std::string& sCode, ICellularRadio *radioObj = NULL);
static CODE convertServiceDomainToString(SERVICEDOMAIN eSd, std::string& sSd);
@@ -206,8 +213,19 @@ namespace MTS {
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_ID;
static const char *KEY_PDP_CONTEXT_APN;
static const char *KEY_PDP_CONTEXT_IPMODE;
+ static const char *KEY_PDP_CONTEXT_AUTH_TYPE;
+ static const char *KEY_PDP_CONTEXT_AUTH_USERNAME;
+ static const char *KEY_PDP_CONTEXT_AUTH_PASSWORD;
+ static const char *VALUE_PDP_CONTEXT_IP_MODE_IP;
+ static const char *VALUE_PDP_CONTEXT_IP_MODE_IPV6;
+ static const char *VALUE_PDP_CONTEXT_IP_MODE_IPV4V6;
+ static const char *VALUE_PDP_CONTEXT_AUTH_TYPE_NONE;
+ static const char *VALUE_PDP_CONTEXT_AUTH_TYPE_PAP;
+ static const char *VALUE_PDP_CONTEXT_AUTH_TYPE_CHAP;
+ static const char *VALUE_PDP_CONTEXT_AUTH_TYPE_PAP_CHAP;
//Values - Type
static const char *VALUE_TYPE_LTE;
@@ -662,12 +680,18 @@ namespace MTS {
/**
* @brief Get the list of PDP contexts from the radio
+ * NOTE: authType, password and username are only present if the radio supports Cellular Authentication on
+ * the PDP Context Level. “password” and “username” are only present if the current authentication type is
+ * other than NONE. The “password” field is omitted on radios that do not allow reading the current password (i.e. on Telit LE910Cx).
*
* @param jData - an object to be filled with data.
* {
- * "<context_number: str>": {
- * "apn": "<apn_value: str>",
- * "ipMode": "<ip_mode: str>"
+ * "context_number : STRING": {
+ * "apn" : "apn_value: STRING",
+ * "authType" : "auth_type_value: STRING",
+ * "ipMode" : "ip_mode_value: STRING",
+ * "password" : "password_value (optional): STRING",
+ * "username" : "username_value (optional): STRING"
* }
* }
*
@@ -679,20 +703,27 @@ namespace MTS {
virtual CODE getPdpContexts(Json::Value& jData) = 0;
/**
- * @brief Set the PDP context to the radio
+ * @brief Set the PDP context to the radio. If any of the fields are omitted,
+ * the system re-uses the current configuration for such fields.
+ * If all fields are omitted - the system deletes the context.
+ * "username" and "password" are mandatory if "ipMode" is PAP, CHAP or PAP-CHAP.
+ * "username", "password" and "authType" shall be omitted on radios that do NOT
+ * support Cellular Authentication on the PDP Context Level.
*
- * @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.
+ * @param sId - ID of the PDP context that should be edited.
+ * @param jConfig - a JSON object that contains:
* {
- * "apn": "<APN>",
- * "ipMode": "<IP MODE>"
+ * "apn" : "apn_value (optional): STRING",
+ * "authType" : "auth_type_value (optional): STRING",
+ * "ipMode" : "ip_mode_value (optional): STRING",
+ * "password" : "password_value (optional): STRING",
+ * "username" : "username_value (optional): STRING"
* }
*
* @return CODE::SUCCESS when fetched successfully,
* CODE::NO_RESPONSE when the modem doesn't respond,
* CODE::ERROR when the radio returns "ERROR",
+ * CODE::INVALID_ARGS when one of the JSON object values is incorrect OR not supported by the current radio,
* CODE::FAILURE otherwise (unexpected response).
*/
virtual CODE setPdpContext(const std::string& sId, const Json::Value& jConfig) = 0;