implement CSBK and RCCH verbosity control support (similar to P25 TSBK verbosity control); allow CSBK and RCCH verbosity to be set from RCON; enhance RCON to properly omit digital protocols not compiled in; enhance RCON commands for debug, verbosity and data dumping to report currently set settings;

2.0-maint
Bryan Biedenkapp 3 years ago
parent 779e232397
commit 73a2f03be4

@ -389,6 +389,17 @@ void Control::setDebugVerbose(bool debug, bool verbose)
m_slot2->setDebugVerbose(debug, verbose);
}
/// <summary>
/// Helper to change the CSBK verbose state.
/// </summary>
/// <param name="verbose">Flag indicating whether CSBK dumping is enabled.</param>
void Control::setCSBKVerbose(bool verbose)
{
m_dumpCSBKData = verbose;
m_slot1->setCSBKVerbose(verbose);
m_slot2->setCSBKVerbose(verbose);
}
// ---------------------------------------------------------------------------
// Private Class Members
// ---------------------------------------------------------------------------

@ -98,8 +98,16 @@ namespace dmr
/// <summary>Flag indicating whether the processor or is busy or not.</summary>
bool isBusy() const;
/// <summary>Flag indicating whether DMR debug is enabled or not.</summary>
bool getDebug() const { return m_debug; };
/// <summary>Flag indicating whether DMR verbosity is enabled or not.</summary>
bool getVerbose() const { return m_verbose; };
/// <summary>Helper to change the debug and verbose state.</summary>
void setDebugVerbose(bool debug, bool verbose);
/// <summary>Flag indicating whether DMR CSBK verbosity is enabled or not.</summary>
bool getCSBKVerbose() const { return m_dumpCSBKData; };
/// <summary>Helper to change the CSBK verbose state.</summary>
void setCSBKVerbose(bool verbose);
private:
friend class Slot;

@ -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;
}
/// <summary>
/// Helper to change the CSBK verbose state.
/// </summary>
/// <param name="verbose">Flag indicating whether CSBK dumping is enabled.</param>
void Slot::setCSBKVerbose(bool verbose)
{
m_dumpCSBKData = verbose;
}
/// <summary>
/// Helper to enable and configure TSCC support for this slot.
/// </summary>

@ -99,6 +99,8 @@ namespace dmr
/// <summary>Helper to change the debug and verbose state.</summary>
void setDebugVerbose(bool debug, bool verbose);
/// <summary>Helper to change the CSBK verbose state.</summary>
void setCSBKVerbose(bool verbose);
/// <summary>Helper to enable and configure TSCC support for this slot.</summary>
void setTSCC(bool enable, bool dedicated);

@ -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<std::string>();
uint32_t portSpeed = uartConfig["speed"].as<uint32_t>(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 <rid> Whitelists the specified RID in the host ACL tables\r\n";
reply += " rid-blacklist <rid> 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 <debug 0/1> <verbose 0/1>\r\n";
reply += " dmr-dump-csbk <0/1>\r\n";
#endif // defined(ENABLE_DMR)
#if defined(ENABLE_P25)
reply += " p25-debug <debug 0/1> <verbose 0/1>\r\n";
reply += " p25-dump-tsbk <0/1>\r\n";
#endif // defined(ENABLE_P25)
#if defined(ENABLE_NXDN)
reply += " nxdn-debug <debug 0/1> <verbose 0/1>\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 <rid> Pages/Calls the specified RID\r\n";
reply += " dmr-rid-check <rid> 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 <mfid> Sets the P25 MFId for the next sent P25 command\r\n";
reply += " p25-rid-page <rid> 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;
}

@ -605,6 +605,15 @@ void Control::setDebugVerbose(bool debug, bool verbose)
m_verbose = m_voice->m_verbose = m_data->m_verbose;
}
/// <summary>
/// Helper to change the RCCH verbose state.
/// </summary>
/// <param name="verbose">Flag indicating whether RCCH dumping is enabled.</param>
void Control::setRCCHVerbose(bool verbose)
{
m_dumpRCCH = verbose;
}
// ---------------------------------------------------------------------------
// Private Class Members
// ---------------------------------------------------------------------------

@ -106,8 +106,16 @@ namespace nxdn
/// <summary>Flag indicating whether the processor or is busy or not.</summary>
bool isBusy() const;
/// <summary>Flag indicating whether NXDN debug is enabled or not.</summary>
bool getDebug() const { return m_debug; };
/// <summary>Flag indicating whether NXDN verbosity is enabled or not.</summary>
bool getVerbose() const { return m_verbose; };
/// <summary>Helper to change the debug and verbose state.</summary>
void setDebugVerbose(bool debug, bool verbose);
/// <summary>Flag indicating whether NXDN RCCH verbosity is enabled or not.</summary>
bool getRCCHVerbose() const { return m_dumpRCCH; };
/// <summary>Helper to change the RCCH verbose state.</summary>
void setRCCHVerbose(bool verbose);
private:
friend class packet::Voice;

@ -120,6 +120,10 @@ namespace p25
/// <summary>Flag indicating whether the processor or is busy or not.</summary>
bool isBusy() const;
/// <summary>Flag indicating whether P25 debug is enabled or not.</summary>
bool getDebug() const { return m_debug; };
/// <summary>Flag indicating whether P25 verbosity is enabled or not.</summary>
bool getVerbose() const { return m_verbose; };
/// <summary>Helper to change the debug and verbose state.</summary>
void setDebugVerbose(bool debug, bool verbose);

@ -103,6 +103,8 @@ namespace p25
/// <summary>Helper to change the conventional fallback state.</summary>
void setConvFallback(bool fallback);
/// <summary>Flag indicating whether P25 TSBK verbosity is enabled or not.</summary>
bool getTSBKVerbose() const { return m_dumpTSBK; };
/// <summary>Helper to change the TSBK verbose state.</summary>
void setTSBKVerbose(bool verbose);

Loading…
Cancel
Save

Powered by TurnKey Linux.