summaryrefslogtreecommitdiff
path: root/src/MTS_IO_TelitRadio.cpp
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2022-12-28 10:36:52 -0600
committerJeff Hatch <jhatch@multitech.com>2022-12-28 10:36:52 -0600
commit6d75c847ab716dd377bdf1e0a4bff1fbce235121 (patch)
treef3ba4159fc60dc385b1019dca521dad1b9763fdd /src/MTS_IO_TelitRadio.cpp
parent3f374f40900e9f6618509de9a52a1a415e54de8f (diff)
parent4b448e3c5daf34062861d0261c5a2253638b8100 (diff)
downloadlibmts-io-6d75c847ab716dd377bdf1e0a4bff1fbce235121.tar.gz
libmts-io-6d75c847ab716dd377bdf1e0a4bff1fbce235121.tar.bz2
libmts-io-6d75c847ab716dd377bdf1e0a4bff1fbce235121.zip
Merge branch 'sk/GP-1195/cell-diag' into 'master'
[GP-1195] Cellular debugging - add a query See merge request !51
Diffstat (limited to 'src/MTS_IO_TelitRadio.cpp')
-rw-r--r--src/MTS_IO_TelitRadio.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/MTS_IO_TelitRadio.cpp b/src/MTS_IO_TelitRadio.cpp
index 5db2ddf..4a0a8b2 100644
--- a/src/MTS_IO_TelitRadio.cpp
+++ b/src/MTS_IO_TelitRadio.cpp
@@ -325,7 +325,7 @@ ICellularRadio::CODE TelitRadio::getNetworkStatus(Json::Value& jData) {
printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
return SUCCESS; //return SUCCESS because getCommonNetworkStats() succeeded at top of this function
}
- if (sResult.find("SIM PIN") != std::string::npos) {
+ if (sResult.find("SIM PIN") != std::string::npos || sResult.find("SIM PUK") != std::string::npos) {
printError("%s| The SIM is locked and must first be unlocked", getName().c_str());
printTrace("%s| Network Status:\n%s\n", getName().c_str(), jData.toStyledString().c_str());
return SUCCESS; //return SUCCESS because getCommonNetworkStats() succeeded at top of this function
@@ -1179,3 +1179,35 @@ bool MTS::IO::TelitRadio::isContainsSignChar(const std::string& str) {
return true;
}
+
+const std::vector<std::string>& TelitRadio::getDiagCommands(bool) {
+ // Declare as static to initialize only when used, but cache the results.
+ const static std::vector<std::string> vCommands {
+ // Radio model and firmware:
+ "AT+CGMI", "AT+CGMM", "AT+CGMR", "AT#SWPKGV", "AT#CFVR",
+
+ // Current operator profile on the radio side:
+ "AT#FWSWITCH?", "AT+CGSN",
+
+ // SIM card information:
+ "AT#SIMDET?", "AT#CCID", "AT+CPIN?", "AT#PCT",
+
+ // Operating mode of the radio:
+ "AT+CFUN?",
+
+ // Low-level network settings:
+ "AT+WS46?", "AT#RXDIV", "AT#CALLDISA?", "AT+CEMODE?",
+
+ // Data connection configuration:
+ "AT+CGDCONT?", "AT#PDPAUTH?",
+
+ // Registration and connection to the tower:
+ "AT+CIND?", "AT+CSQ", "AT+COPS?", "AT+CREG?", "AT+CGREG?", "AT+CEREG?",
+ "AT#RFSTS", "AT#PSNT?", "AT#MONI",
+
+ // Data connection status:
+ "AT+CGACT?", "AT+CGCONTRDP=1", "AT+CGCONTRDP=2", "AT+CGCONTRDP=3"
+ };
+
+ return vCommands;
+}