summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-22 13:13:57 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2019-06-22 13:13:57 +0300
commit00439630bb52e1d80be032e3c2020a016b677611 (patch)
treef95a16b8a34fb574728ae65934a8e86572c5bef3
parent5a987cc05daf9444118b71e5b7c18957fba993f2 (diff)
downloadradio-query-00439630bb52e1d80be032e3c2020a016b677611.tar.gz
radio-query-00439630bb52e1d80be032e3c2020a016b677611.tar.bz2
radio-query-00439630bb52e1d80be032e3c2020a016b677611.zip
[MTS-MTQ] SIM status reporting for radio-query
Added a new "--sim-status" query for fetching all the information about the current SIM card status: - 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.
-rw-r--r--main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 4f71673..be87d06 100644
--- a/main.cpp
+++ b/main.cpp
@@ -84,6 +84,7 @@ const uint32_t OPT_DATETIME = 0x00004000;
const uint32_t OPT_ACTIVEFIRMWARE = 0x00008000;
const uint32_t OPT_LOCATION = 0x00010000;
const uint32_t OPT_FIRMWAREBUILD = 0x00020000;
+const uint32_t OPT_SIM_STATUS = 0x00040000;
const uint32_t OPT_SUMMARY_STATIC = 0x01000000;
const uint32_t OPT_SUMMARY_NETWORK = 0x02000000;
@@ -155,6 +156,12 @@ int main(int argc, char** argv) {
printf("%s", getNetworkData().toStyledString().c_str());
} else if(g_iOptions & OPT_SUMMARY_STATIC) {
printf("%s", getStaticData().toStyledString().c_str());
+ } else if(g_iOptions & OPT_SIM_STATUS) {
+ Json::Value jValue;
+ result = g_apRadio->getSimStatusSummary(jValue);
+ if(result == ICellularRadio::SUCCESS) {
+ printf("%s", jValue.toStyledString().c_str());
+ }
} else if(g_iOptions & OPT_RSSI) {
int32_t iValue;
result = g_apRadio->getSignalStrength(iValue);
@@ -528,6 +535,7 @@ void parseOptions(int argc, char** argv) {
{ "carrier", no_argument, &iOption, OPT_CARRIER },
{ "datetime", no_argument, &iOption, OPT_DATETIME },
{ "active-firmware", no_argument, &iOption, OPT_ACTIVEFIRMWARE },
+ { "sim-status", no_argument, &iOption, OPT_SIM_STATUS },
{ "static", no_argument, &iOption, OPT_SUMMARY_STATIC },
{ "dynamic", no_argument, &iOption, OPT_SUMMARY_NETWORK },
{ 0, 0, 0, 0 } };
@@ -634,6 +642,7 @@ void printHelp(const std::string& sApp) {
printf("\t--type\n");
printf("\t--carrier\n");
printf("\t--datetime\n");
+ printf("\t--sim-status\n");
// Applicable for LTE910-NA1 dual FW images only
// printf("\t--active-firmware\n");
printf("\n");