diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-22 10:17:30 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-22 13:53:16 +0300 |
commit | 07d0ee6ea892dea71911478fad2c530de41e059b (patch) | |
tree | 4d86f24b2aa7ea6b3f151bf1c75ce4cc953b3b65 /include | |
parent | 482f5c42c4e0a03b7474d369250121005bc94f3f (diff) | |
download | libmts-io-07d0ee6ea892dea71911478fad2c530de41e059b.tar.gz libmts-io-07d0ee6ea892dea71911478fad2c530de41e059b.tar.bz2 libmts-io-07d0ee6ea892dea71911478fad2c530de41e059b.zip |
[MTS-MTQ] SIM status and PIN unlock procedures
Defined common protected utility methods for the CellularRadio class:
- getIsSimInserted
- getSimLockStatus
- getSimLockAttempts
Diffstat (limited to 'include')
-rw-r--r-- | include/mts/MTS_IO_CellularRadio.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h index 899ceeb..e23cbc9 100644 --- a/include/mts/MTS_IO_CellularRadio.h +++ b/include/mts/MTS_IO_CellularRadio.h @@ -122,6 +122,40 @@ namespace MTS { virtual void getCommonNetworkStats(Json::Value& jData); + /** + * @brief getIsSimInserted - returns if the SIM card is inserted / installed or not. + * + * @param bData - an object to be filled with the SIM card insertion status. + * `true` when SIM card is inserted / installed / present, + * `false` otherwise. + * @return CODE::SUCCESS when SIM insertion status is fetched successfully, + * CODE::NOT_APPLICABLE when the modem doesn't support this feature, + * CODE::ERROR otherwise (when modem is inaccessible or in other cases). + */ + virtual CODE getIsSimInserted(bool& bData) = 0; + + /** + * @brief getSimLockStatus - return the SIM lock status as defined by AT+CPIN? command. + * Returns "READY", "SIM PIN", "SIM PUK" or other SIM status. + * + * @param sData - an object to be filled with the SIM lock status + * @return CODE::SUCCESS when SIM status is fetched successfully, + * CODE::NOT_APPLICABLE when the modem doesn't support this feature, + * CODE::ERROR otherwise (SIM card removed, modem is inaccessible, etc). + */ + virtual CODE getSimLockStatus(std::string& sData) = 0; + + /** + * @brief getSimLockAttempts - get the number of SIM unlock attempts left. + * + * @param iAttemptsPin - the number of attempts left to enter a PIN code. + * @param iAttemptsPuk - the number of attempts left to enter a PUK code. + * @return CODE::SUCCESS when both numbers are fetched successfully, + * CODE::NOT_APPLICABLE when the modem doesn't support this feature, + * CODE::ERROR otherwise (SIM card removed, modem is inaccessible, etc). + */ + virtual CODE getSimLockAttempts(int& iAttemptsPin, int& iAttemptsPuk) = 0; + void initMipProfile(Json::Value& jData); bool splitAndAssign(const std::string& sLine, const std::string& sKey, Json::Value& jParent, const std::string& sJsonKey, Json::ValueType eType = Json::ValueType::stringValue); |