summaryrefslogtreecommitdiff
path: root/include/mts/MTS_IO_ICellularRadio.h
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-21 18:11:11 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-22 13:52:55 +0300
commit482f5c42c4e0a03b7474d369250121005bc94f3f (patch)
tree422d104a8035ed25c47e2a724d94ab7354d317bd /include/mts/MTS_IO_ICellularRadio.h
parentd3ab74f3f8957696077efbac756b52fbbbe49548 (diff)
downloadlibmts-io-482f5c42c4e0a03b7474d369250121005bc94f3f.tar.gz
libmts-io-482f5c42c4e0a03b7474d369250121005bc94f3f.tar.bz2
libmts-io-482f5c42c4e0a03b7474d369250121005bc94f3f.zip
[MTS-MTQ] SIM status and PIN unlock procedures
Declared the interface for SIM status and PIN-related methods
Diffstat (limited to 'include/mts/MTS_IO_ICellularRadio.h')
-rw-r--r--include/mts/MTS_IO_ICellularRadio.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_ICellularRadio.h b/include/mts/MTS_IO_ICellularRadio.h
index d74ad15..5d2295b 100644
--- a/include/mts/MTS_IO_ICellularRadio.h
+++ b/include/mts/MTS_IO_ICellularRadio.h
@@ -205,6 +205,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;
@@ -225,6 +248,26 @@ namespace MTS {
virtual CODE getRegistration(REGISTRATION& eRegistration) = 0;
virtual CODE convertRegistrationToString(REGISTRATION eRegistration, std::string& sRegistration) = 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
/*!
\param Json::Value object that will be populated with MIP data