summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2019-07-22 13:09:32 -0500
committerJeff Hatch <jhatch@multitech.com>2019-07-22 13:09:32 -0500
commit9c23881580b3d04755751629e2cb7e36f01c9529 (patch)
tree74f9f45d2a90d5b1368be2c768651f15110b4507
parentd7400de67508173f601ce30aaeae51bee2fdc8ff (diff)
parent28474b279248cc2a928cbec6073864828ba4d35c (diff)
downloadradio-cmd-9c23881580b3d04755751629e2cb7e36f01c9529.tar.gz
radio-cmd-9c23881580b3d04755751629e2cb7e36f01c9529.tar.bz2
radio-cmd-9c23881580b3d04755751629e2cb7e36f01c9529.zip
Merge branch 'MTX-2890' into 'quectel-radio'
[MTX-2890][IN:3756] MTR-MTQ - PPP Mode - Radio Reboot Enabled - Radio does not reboot See merge request !1
-rw-r--r--main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 25b2f8d..d72faee 100644
--- a/main.cpp
+++ b/main.cpp
@@ -107,6 +107,7 @@ const uint32_t OPT_CONFIG_FILE = 0x04000000;
const uint32_t OPT_GET_RADIOMODE = 0x08000000;
const uint32_t OPT_SET_RADIOMODE = 0x10000000;
const uint32_t OPT_UNLOCK_SIM_CARD = 0x20000000;
+const uint32_t OPT_RESET_RADIO = 0x40000000;
void handle_sigterm(int signum);
void printHelp(const std::string& sApp);
@@ -147,6 +148,7 @@ static struct option long_options[] = {
{ "unlock-sim-card", required_argument, 0, OPT_UNLOCK_SIM_CARD },
{ "get-radio-network-mode", no_argument, &iOption, OPT_GET_RADIOMODE },
{ "set-radio-network-mode", required_argument, 0, OPT_SET_RADIOMODE },
+ { "reset-radio", no_argument, &iOption, OPT_RESET_RADIO },
{ "init-dc", no_argument, &iOption, OPT_INIT_DC },
{ "init-fumo", no_argument, &iOption, OPT_INIT_FUMO },
{ "init-prl", no_argument, &iOption, OPT_INIT_PRL },
@@ -381,6 +383,10 @@ int main(int argc, char** argv) {
jArgs["pin"] = g_sSimPin;
result = g_apRadio->unlockSimCard(jArgs);
printf("%s\n", code2str(result));
+ } else if(g_iOptions & OPT_RESET_RADIO) {
+ bool ret = g_apRadio->resetRadio();
+ result = (ret) ? ICellularRadio::CODE::SUCCESS : ICellularRadio::CODE::FAILURE;
+ printf("%s\n", code2str(result));
}
shutdown();
@@ -651,6 +657,7 @@ void printHelp(const std::string& sApp) {
// printf("\t--set-active-firmware <VAL> : switch to a specific firmware image\n");
printf("\t--factory-default [ --msl <MSL> ] : reset to factory defaults\n");
printf("\t--unlock-sim-card <SIM PIN> : unlock the SIM card using the PIN code provided\n");
+ printf("\t--reset-radio : reset the radio module using AT commands\n");
printf("\n");
printf("\t--printlvl (p) <level> : sets the printlvl [0-100]\n");
printf("\t--version (v) : returns version\n");