diff --git a/dmr/Control.cpp b/dmr/Control.cpp index d67f3710..f5ebbf64 100644 --- a/dmr/Control.cpp +++ b/dmr/Control.cpp @@ -389,6 +389,17 @@ void Control::setDebugVerbose(bool debug, bool verbose) m_slot2->setDebugVerbose(debug, verbose); } +/// +/// Helper to change the CSBK verbose state. +/// +/// Flag indicating whether CSBK dumping is enabled. +void Control::setCSBKVerbose(bool verbose) +{ + m_dumpCSBKData = verbose; + m_slot1->setCSBKVerbose(verbose); + m_slot2->setCSBKVerbose(verbose); +} + // --------------------------------------------------------------------------- // Private Class Members // --------------------------------------------------------------------------- diff --git a/dmr/Control.h b/dmr/Control.h index e11c44a9..9cbea67e 100644 --- a/dmr/Control.h +++ b/dmr/Control.h @@ -98,8 +98,16 @@ namespace dmr /// Flag indicating whether the processor or is busy or not. bool isBusy() const; + /// Flag indicating whether DMR debug is enabled or not. + bool getDebug() const { return m_debug; }; + /// Flag indicating whether DMR verbosity is enabled or not. + bool getVerbose() const { return m_verbose; }; /// Helper to change the debug and verbose state. void setDebugVerbose(bool debug, bool verbose); + /// Flag indicating whether DMR CSBK verbosity is enabled or not. + bool getCSBKVerbose() const { return m_dumpCSBKData; }; + /// Helper to change the CSBK verbose state. + void setCSBKVerbose(bool verbose); private: friend class Slot; diff --git a/dmr/Slot.cpp b/dmr/Slot.cpp index 73fc692f..a6199857 100644 --- a/dmr/Slot.cpp +++ b/dmr/Slot.cpp @@ -540,6 +540,15 @@ void Slot::setDebugVerbose(bool debug, bool verbose) m_verbose = m_voice->m_verbose = m_data->m_verbose = verbose = m_control->m_verbose; } +/// +/// Helper to change the CSBK verbose state. +/// +/// Flag indicating whether CSBK dumping is enabled. +void Slot::setCSBKVerbose(bool verbose) +{ + m_dumpCSBKData = verbose; +} + /// /// Helper to enable and configure TSCC support for this slot. /// diff --git a/dmr/Slot.h b/dmr/Slot.h index 3d0807e0..cfdbc43d 100644 --- a/dmr/Slot.h +++ b/dmr/Slot.h @@ -99,6 +99,8 @@ namespace dmr /// Helper to change the debug and verbose state. void setDebugVerbose(bool debug, bool verbose); + /// Helper to change the CSBK verbose state. + void setCSBKVerbose(bool verbose); /// Helper to enable and configure TSCC support for this slot. void setTSCC(bool enable, bool dedicated); diff --git a/network/RemoteControl.cpp b/network/RemoteControl.cpp index 169ae70b..a5d23cd3 100644 --- a/network/RemoteControl.cpp +++ b/network/RemoteControl.cpp @@ -106,9 +106,11 @@ using namespace modem; #define RCD_P25_CC_BCAST "p25-cc-bcast" #define RCD_DMR_DEBUG "dmr-debug" +#define RCD_DMR_DUMP_CSBK "dmr-dump-csbk" #define RCD_P25_DEBUG "p25-debug" #define RCD_P25_DUMP_TSBK "p25-dump-tsbk" #define RCD_NXDN_DEBUG "nxdn-debug" +#define RCD_NXDN_DUMP_RCCH "nxdn-dump-rcch" #define RCD_DMRD_MDM_INJ "debug-dmrd-mdm-inj" #define RCD_P25D_MDM_INJ "debug-p25d-mdm-inj" @@ -299,7 +301,8 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx std::string modemPort = uartConfig["port"].as(); uint32_t portSpeed = uartConfig["speed"].as(115200U); - reply += string_format("Host State: %u, Port Type: %s, Modem Port: %s, Port Speed: %u, Proto Ver: %u", host->m_state, type.c_str(), modemPort.c_str(), portSpeed, host->m_modem->getVersion()); + reply += string_format("Host State: %u, DMR: %u, P25: %u, NXDN: %u, Port Type: %s, Modem Port: %s, Port Speed: %u, Proto Ver: %u", host->m_state, + dmr != NULL, p25 != NULL, nxdn != NULL, type.c_str(), modemPort.c_str(), portSpeed, host->m_modem->getVersion()); } { @@ -848,8 +851,15 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx #if defined(ENABLE_DMR) else if (rcom == RCD_DMR_DEBUG) { if (argCnt < 2U) { - LogWarning(LOG_RCON, BAD_CMD_STR); - reply = BAD_CMD_STR; + if (dmr != NULL) { + bool debug = dmr->getDebug(); + bool verbose = dmr->getVerbose(); + reply = string_format("dmr->debug = %u, dmr->verbose = %u", debug, verbose); + } + else { + reply = CMD_FAILED_STR "DMR mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } } else { uint8_t debug = getArgUInt8(args, 0U); @@ -863,12 +873,41 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx } } } + else if (rcom == RCD_DMR_DUMP_CSBK) { + if (argCnt < 1U) { + if (dmr != NULL) { + bool csbkDump = dmr->getCSBKVerbose(); + reply = string_format("dmr->dumpCsbkData = %u", csbkDump); + } + else { + reply = CMD_FAILED_STR "DMR mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } + } + else { + uint8_t verbose = getArgUInt8(args, 0U); + if (dmr != NULL) { + dmr->setCSBKVerbose((verbose == 1U) ? true : false); + } + else { + reply = CMD_FAILED_STR "DMR mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } + } + } #endif // defined(ENABLE_DMR) #if defined(ENABLE_P25) else if (rcom == RCD_P25_DEBUG) { if (argCnt < 2U) { - LogWarning(LOG_RCON, BAD_CMD_STR); - reply = BAD_CMD_STR; + if (p25 != NULL) { + bool debug = p25->getDebug(); + bool verbose = p25->getVerbose(); + reply = string_format("p25->debug = %u, p25->verbose = %u", debug, verbose); + } + else { + reply = CMD_FAILED_STR "P25 mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } } else { uint8_t debug = getArgUInt8(args, 0U); @@ -884,8 +923,14 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx } else if (rcom == RCD_P25_DUMP_TSBK) { if (argCnt < 1U) { - LogWarning(LOG_RCON, BAD_CMD_STR); - reply = BAD_CMD_STR; + if (p25 != NULL) { + bool tsbkDump = p25->trunk()->getTSBKVerbose(); + reply = string_format("p25->dumpTsbkData = %u", tsbkDump); + } + else { + reply = CMD_FAILED_STR "P25 mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } } else { uint8_t verbose = getArgUInt8(args, 0U); @@ -902,8 +947,15 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx #if defined(ENABLE_NXDN) else if (rcom == RCD_NXDN_DEBUG) { if (argCnt < 2U) { - LogWarning(LOG_RCON, BAD_CMD_STR); - reply = BAD_CMD_STR; + if (nxdn != NULL) { + bool debug = nxdn->getDebug(); + bool verbose = nxdn->getVerbose(); + reply = string_format("nxdn->debug = %u, nxdn->verbose = %u", debug, verbose); + } + else { + reply = CMD_FAILED_STR "NXDN mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } } else { uint8_t debug = getArgUInt8(args, 0U); @@ -917,6 +969,28 @@ void RemoteControl::process(Host* host, dmr::Control* dmr, p25::Control* p25, nx } } } + else if (rcom == RCD_NXDN_DUMP_RCCH) { + if (argCnt < 1U) { + if (nxdn != NULL) { + bool rcchDump = nxdn->getRCCHVerbose(); + reply = string_format("nxdn->dumpRcchData = %u", rcchDump); + } + else { + reply = CMD_FAILED_STR "NXDN mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } + } + else { + uint8_t verbose = getArgUInt8(args, 0U); + if (nxdn != NULL) { + nxdn->setRCCHVerbose((verbose == 1U) ? true : false); + } + else { + reply = CMD_FAILED_STR "NXDN mode is not enabled!"; + LogError(LOG_RCON, reply.c_str()); + } + } + } #endif // defined(ENABLE_NXDN) #if defined(ENABLE_DMR) else if (rcom == RCD_DMRD_MDM_INJ && argCnt >= 1U) { @@ -1231,13 +1305,27 @@ std::string RemoteControl::displayHelp() reply += " rid-whitelist Whitelists the specified RID in the host ACL tables\r\n"; reply += " rid-blacklist Blacklists the specified RID in the host ACL tables\r\n"; reply += "\r\n"; +#if defined(ENABLE_DMR) reply += " dmr-beacon Transmits a DMR beacon burst\r\n"; +#endif // defined(ENABLE_DMR) +#if defined(ENABLE_P25) reply += " p25-cc Transmits a non-continous P25 CC burst\r\n"; reply += " p25-cc-fallback <0/1> Sets the P25 CC into conventional fallback mode\r\n"; +#endif // defined(ENABLE_P25) reply += "\r\n"; +#if defined(ENABLE_DMR) reply += " dmr-debug \r\n"; + reply += " dmr-dump-csbk <0/1>\r\n"; +#endif // defined(ENABLE_DMR) +#if defined(ENABLE_P25) reply += " p25-debug \r\n"; + reply += " p25-dump-tsbk <0/1>\r\n"; +#endif // defined(ENABLE_P25) +#if defined(ENABLE_NXDN) reply += " nxdn-debug \r\n"; + reply += " nxdn-dump-rcch <0/1>\r\n"; +#endif // defined(ENABLE_NXDN) +#if defined(ENABLE_DMR) reply += "\r\nDMR Commands:\r\n"; reply += " dmr-rid-page Pages/Calls the specified RID\r\n"; reply += " dmr-rid-check Radio Checks the specified RID\r\n"; @@ -1246,6 +1334,8 @@ std::string RemoteControl::displayHelp() reply += "\r\n"; reply += " dmr-cc-dedicated <0/1> Enables or disables dedicated control channel\r\n"; reply += " dmr-cc-bcast <0/1> Enables or disables broadcast of the control channel\r\n"; +#endif // defined(ENABLE_DMR) +#if defined(ENABLE_P25) reply += "\r\nP25 Commands:\r\n"; reply += " p25-set-mfid Sets the P25 MFId for the next sent P25 command\r\n"; reply += " p25-rid-page Pages/Calls the specified RID\r\n"; @@ -1260,6 +1350,7 @@ std::string RemoteControl::displayHelp() reply += "\r\n"; reply += " p25-cc-dedicated <0/1> Enables or disables dedicated control channel\r\n"; reply += " p25-cc-bcast <0/1> Enables or disables broadcast of the control channel\r\n"; +#endif // defined(ENABLE_P25) return reply; } diff --git a/nxdn/Control.cpp b/nxdn/Control.cpp index b6558930..79c0c5e3 100644 --- a/nxdn/Control.cpp +++ b/nxdn/Control.cpp @@ -605,6 +605,15 @@ void Control::setDebugVerbose(bool debug, bool verbose) m_verbose = m_voice->m_verbose = m_data->m_verbose; } +/// +/// Helper to change the RCCH verbose state. +/// +/// Flag indicating whether RCCH dumping is enabled. +void Control::setRCCHVerbose(bool verbose) +{ + m_dumpRCCH = verbose; +} + // --------------------------------------------------------------------------- // Private Class Members // --------------------------------------------------------------------------- diff --git a/nxdn/Control.h b/nxdn/Control.h index 82339d8f..e7b4d51d 100644 --- a/nxdn/Control.h +++ b/nxdn/Control.h @@ -106,8 +106,16 @@ namespace nxdn /// Flag indicating whether the processor or is busy or not. bool isBusy() const; + /// Flag indicating whether NXDN debug is enabled or not. + bool getDebug() const { return m_debug; }; + /// Flag indicating whether NXDN verbosity is enabled or not. + bool getVerbose() const { return m_verbose; }; /// Helper to change the debug and verbose state. void setDebugVerbose(bool debug, bool verbose); + /// Flag indicating whether NXDN RCCH verbosity is enabled or not. + bool getRCCHVerbose() const { return m_dumpRCCH; }; + /// Helper to change the RCCH verbose state. + void setRCCHVerbose(bool verbose); private: friend class packet::Voice; diff --git a/p25/Control.h b/p25/Control.h index 583340d1..667e59ae 100644 --- a/p25/Control.h +++ b/p25/Control.h @@ -120,6 +120,10 @@ namespace p25 /// Flag indicating whether the processor or is busy or not. bool isBusy() const; + /// Flag indicating whether P25 debug is enabled or not. + bool getDebug() const { return m_debug; }; + /// Flag indicating whether P25 verbosity is enabled or not. + bool getVerbose() const { return m_verbose; }; /// Helper to change the debug and verbose state. void setDebugVerbose(bool debug, bool verbose); diff --git a/p25/packet/Trunk.h b/p25/packet/Trunk.h index bb12fea3..c44ce465 100644 --- a/p25/packet/Trunk.h +++ b/p25/packet/Trunk.h @@ -103,6 +103,8 @@ namespace p25 /// Helper to change the conventional fallback state. void setConvFallback(bool fallback); + /// Flag indicating whether P25 TSBK verbosity is enabled or not. + bool getTSBKVerbose() const { return m_dumpTSBK; }; /// Helper to change the TSBK verbose state. void setTSBKVerbose(bool verbose);