summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2022-12-28 10:41:54 -0600
committerJeff Hatch <jhatch@multitech.com>2022-12-28 10:41:54 -0600
commit3d878f5f2518f6b648ef150e18ed98ab7235c42d (patch)
tree75782ff313600219d2545dbca1ca73ea4caeb6fd
parent136b8cbb9fd3235f9b5e17dab792700af252820f (diff)
parent10739600b73244cdf42918d9f3fb11c09d317100 (diff)
downloadradio-query-master.tar.gz
radio-query-master.tar.bz2
radio-query-master.zip
Merge branch 'sk/GP-1195/cell-diag' into 'master' HEAD1.5master
[GP-1195] Cellular debugging - add a query See merge request !17
-rw-r--r--main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 8a763cf..8f5fd98 100644
--- a/main.cpp
+++ b/main.cpp
@@ -103,6 +103,7 @@ const uint32_t OPT_SELECTED_BANDS_RAW = 0x20000000;
int32_t g_iAuxOptions = 0;
const uint32_t AOPT_VOICE_SUPPORT = 0x00000001;
const uint32_t AOPT_PDP_CONF_STATIC = 0x00000002;
+const uint32_t AOPT_DIAGNOSTICS = 0x00000004;
void handle_sigterm(int signum);
void printHelp(const std::string& sApp);
@@ -392,6 +393,14 @@ int main(int argc, char** argv) {
}
}
}
+ } else if (g_iAuxOptions & AOPT_DIAGNOSTICS) {
+ std::string sValue;
+ result = g_apRadio->getDiagnostics(sValue);
+
+ // Print the results even if the radio has stopped responding at some point.
+ if (result == ICellularRadio::SUCCESS || result == ICellularRadio::NO_RESPONSE) {
+ printf("%s", sValue.c_str());
+ }
}
if (g_bIstty && result == ICellularRadio::CODE::SUCCESS)
@@ -688,6 +697,7 @@ void parseOptions(int argc, char** argv) {
{ "selected-bands-raw", no_argument, &iOption, OPT_SELECTED_BANDS_RAW },
{ "pdp-conf-static", no_argument, &iAuxOption, AOPT_PDP_CONF_STATIC },
{ "ctx-id", required_argument, 0, 'C' },
+ { "diagnostics", no_argument, &iAuxOption, AOPT_DIAGNOSTICS },
{ 0, 0, 0, 0 } };
/* getopt_long stores the option index here. */
@@ -810,6 +820,7 @@ void printHelp(const std::string& sApp) {
printf("\t--voice-support\n");
printf("\t--selected-bands-raw\n");
printf("\t--pdp-conf-static --ctx-id <context-id>\n");
+ printf("\t--diagnostics\n");
// Applicable for LTE910-NA1 dual FW images only
// printf("\t--active-firmware\n");
printf("\n");