summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-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");