summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_ICellularRadio.h
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-24 11:30:51 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-24 11:47:11 +0300
commit83c86fe26b69439f75c893618114d16be0d1d2e8 (patch)
tree4608bf8e5b881016fd74d2caa5a426ba9f9ad438 /include/mts/MTS_IO_ICellularRadio.h
parent143feb6a4587817d28c77e4df3a1b594b855f5e5 (diff)
parent28ce5eaaa648670a2c83d583ebff2dc517af002e (diff)
downloadlibmts-io-83c86fe26b69439f75c893618114d16be0d1d2e8.tar.gz
libmts-io-83c86fe26b69439f75c893618114d16be0d1d2e8.tar.bz2
libmts-io-83c86fe26b69439f75c893618114d16be0d1d2e8.zip
Merge branch 'mtr-mtq-sim-status' into quectel-radio
Diffstat (limited to 'include/mts/MTS_IO_ICellularRadio.h')
-rw-r--r--include/mts/MTS_IO_ICellularRadio.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h
index 1b95a0d..2d47fcf 100644
--- a/include/mts/MTS_IO_ICellularRadio.h
+++ b/include/mts/MTS_IO_ICellularRadio.h
@@ -168,6 +168,12 @@ namespace MTS {
static const char *KEY_MIP_MNAAASS; //!< Mobile Node Authentication, Authorization, and Accounting Server Shared Secret
static const char *KEY_MIP_MNHASS; //!< Mobile Node Home Agent Shared Secret
+ //SIM Status Summary data
+ static const char *KEY_IS_SIM_INSERTED; //!< SIM card insertion indicator. True when a SIM card is inserted
+ static const char *KEY_IS_SIM_LOCKED; //!< SIM card lock status indicator. True when a SIM card is locked by PIN / PUK / other code
+ static const char *KEY_SIM_LOCK_STATUS; //!< SIM card lock status string. Either "READY", "SIM PIN", "SIM PUK" or other state
+ 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
//Values - Type
static const char *VALUE_TYPE_LTE;
@@ -213,6 +219,29 @@ namespace MTS {
virtual CODE getMeid(std::string& sMeid) = 0;
virtual CODE getImsi(std::string& sImsi) = 0;
virtual CODE getSimStatus(std::string& sSimStatus) = 0;
+
+ /**
+ * @brief getSimStatusSummary - get summary on the SIM card status
+ * (if there is a SIM card inserted, is it locked, etc).
+ * See below for the full list of returned fields.
+ *
+ * - `isSimInserted` - bool, is the SIM card installed or not;
+ * - `isSimLocked` - bool, is the SIM card blocked with PIN/PUK or not (or is READY);
+ * - `lockStatus` - string, either "READY", "SIM PUK", "SIM PIN" or other status as
+ * returned by "AT+CPIN?" AT command;
+ * - `attemptsPin` - integer, the number of attempts lef to enter a PIN code;
+ * - `attemptsPuk` - integer, the number of attempts lef to enter a PUK code.
+ *
+ * **Only `isSimInserted` is always present.** All other fields are omitted if
+ * the SIM card is removed.
+ *
+ * @param jData - an object to be filled with data
+ * @return CODE::SUCCESS on success,
+ * CODE::NOT_APPLICABLE if not supported by this radio
+ * and CODE::ERROR otherwise
+ */
+ virtual CODE getSimStatusSummary(Json::Value& jData) = 0;
+
virtual CODE getIccid(std::string& sIccid) = 0;
virtual CODE getService(std::string& sService) = 0;
virtual CODE getLac(std::string& sLac) = 0;
@@ -235,6 +264,25 @@ namespace MTS {
virtual CODE getRadioMode(RADIOMODE &mode) = 0;
virtual CODE setRadioMode(RADIOMODE mode) = 0;
+ /**
+ * @brief unlockSimCard - unlock the SIM card using PIN code provided
+ *
+ * This command does not peform any checks on the number of attempts left.
+ * Use with caution, verify the SIM status manually before execution.
+ *
+ * @param jArgs - a JSON object with the following format:
+ *
+ * jArgs = {
+ * "pin" : "A correct PIN code to unlock the SIM card: STRING"
+ * }
+ *
+ * @return CODE::SUCCESS when SIM card was succeffully unlocked,
+ * CODE::INVALID_ARGS when passed arguments are invalid,
+ * CODE::ERROR otherwise (i.e. when modem is not responding,
+ * when SIM card is removed, when PIN code is not correct
+ * or on any other error).
+ */
+ virtual CODE unlockSimCard(const Json::Value& jArgs) = 0;
//! Gather details of the radio's Mobile IP Profile
/*!