diff --git a/src/HostMain.cpp b/src/HostMain.cpp index 5f596b31..4c7bc75e 100644 --- a/src/HostMain.cpp +++ b/src/HostMain.cpp @@ -101,6 +101,8 @@ bool g_fireNXDNControl = false; uint8_t* g_gitHashBytes = nullptr; +bool g_modemDebug = false; + // --------------------------------------------------------------------------- // Global Functions // --------------------------------------------------------------------------- @@ -163,6 +165,7 @@ void usage(const char* message, const char* arg) "\n\n" " -v show version information\n" " -h show this screen\n" + " -d force modem debug\n" " -f foreground mode\n" "\n" " --setup setup and calibration mode\n" @@ -204,6 +207,9 @@ int checkArgs(int argc, char* argv[]) ++p; break; } + else if (IS("-d")) { + g_modemDebug = true; + } else if (IS("-f")) { g_foreground = true; } diff --git a/src/HostMain.h b/src/HostMain.h index 12c33401..3b8cc3db 100644 --- a/src/HostMain.h +++ b/src/HostMain.h @@ -57,6 +57,8 @@ extern bool g_fireNXDNControl; extern uint8_t* g_gitHashBytes; +extern bool g_modemDebug; + extern HOST_SW_API void fatal(const char* msg, ...); #endif // __HOST_MAIN_H__ diff --git a/src/host/Host.Config.cpp b/src/host/Host.Config.cpp index ecd4f04f..7bf33f1b 100644 --- a/src/host/Host.Config.cpp +++ b/src/host/Host.Config.cpp @@ -492,6 +492,10 @@ bool Host::createModem() bool trace = modemConf["trace"].as(false); bool debug = modemConf["debug"].as(false); + // if modem debug is being forced from the commandline -- enable modem debug + if (g_modemDebug) + debug = true; + if (rfPower == 0U) { // clamp to 1 rfPower = 1U; } diff --git a/src/host/calibrate/HostCal.cpp b/src/host/calibrate/HostCal.cpp index 2ff64055..056050ff 100644 --- a/src/host/calibrate/HostCal.cpp +++ b/src/host/calibrate/HostCal.cpp @@ -121,6 +121,10 @@ int HostCal::run(int argc, char **argv) m_channelId = 15U; } + // if modem debug is being forced from the commandline -- enable modem debug + if (g_modemDebug) + m_debug = true; + if (!calculateRxTxFreq()) { return false; } diff --git a/src/host/setup/HostSetup.cpp b/src/host/setup/HostSetup.cpp index 143712c4..f9f9a7dd 100644 --- a/src/host/setup/HostSetup.cpp +++ b/src/host/setup/HostSetup.cpp @@ -242,6 +242,10 @@ int HostSetup::run(int argc, char** argv) m_channelId = 15U; } + // if modem debug is being forced from the commandline -- enable modem debug + if (g_modemDebug) + m_debug = true; + if (!calculateRxTxFreq(true)) { return 1; }