diff --git a/configs/config.example.yml b/configs/config.example.yml index 2bbb9303..919f5e71 100644 --- a/configs/config.example.yml +++ b/configs/config.example.yml @@ -170,15 +170,18 @@ protocols: enableTimeDateAnn: false # Flag indicating whether or not the source ID validation before granting disabled. disableGrantSourceIdCheck: false + # Flag indicating whether redundant grant responses should be transmitted. + # (This is useful for single-channel VOC (voice on control) configurations.) + redundantGrantTransmit: false # Flag indicating whether or not VOC (voice on control) support is enabled. voiceOnControl: false # Flag indicating whether or not the composite flag in the CC service options is set. # (This is useful to disable for some radios when running in VOC mode.) disableCompositeFlag: false - # Flag indicating that the host will attempt to automatically inhibit illegal RIDs (those not in the + # Flag indicating that the host will attempt to automatically inhibit unauthorized RIDs (those not in the # RID ACL list). - inhibitIllegal: false + inhibitUnauthorized: false # Flag indicating the fallback legacy group grant for radios that do not support group affilition to # have group grants transmitted. (Useful for alerting the FNE to affiliations to TGIDs for radios that # do not properly support group affiliation.) diff --git a/src/p25/Control.cpp b/src/p25/Control.cpp index 04ec6979..e4b0d148 100644 --- a/src/p25/Control.cpp +++ b/src/p25/Control.cpp @@ -97,7 +97,7 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q m_timeout(timeout), m_modem(modem), m_network(network), - m_inhibitIllegal(false), + m_inhibitUnauth(false), m_legacyGroupGrnt(true), m_legacyGroupReg(false), m_duplex(duplex), @@ -240,7 +240,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_trunk->m_patchSuperGroup = pSuperGroup; - m_inhibitIllegal = p25Protocol["inhibitIllegal"].as(false); + m_inhibitUnauth = p25Protocol["inhibitUnauthorized"].as(false); m_legacyGroupGrnt = p25Protocol["legacyGroupGrnt"].as(true); m_legacyGroupReg = p25Protocol["legacyGroupReg"].as(false); @@ -266,6 +266,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_ackTSBKRequests = control["ackRequests"].as(true); m_trunk->m_ctrlTSDUMBF = !control["disableTSDUMBF"].as(false); m_trunk->m_ctrlTimeDateAnn = control["enableTimeDateAnn"].as(false); + m_trunk->m_redundantGrant = control["redundantGrantTransmit"].as(false); #if ENABLE_DFSI_SUPPORT if (m_modem->isP25DFSI()) { @@ -303,7 +304,8 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_siteData = SiteData(netId, sysId, rfssId, siteId, 0U, channelId, channelNo, serviceClass, lto); uint32_t valueTest = (netId >> 8); - if (valueTest == 0xBEE) { + const uint32_t constValue = 0x17DC0U; + if (valueTest == (constValue >> 5)) { ::fatal("error 8\n"); } m_siteData.setCallsign(cwCallsign); @@ -385,7 +387,7 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw } LogInfo(" Time/Date Announcement TSBK: %s", m_trunk->m_ctrlTimeDateAnn ? "yes" : "no"); - LogInfo(" Inhibit Illegal: %s", m_inhibitIllegal ? "yes" : "no"); + LogInfo(" Inhibit Unauthorized: %s", m_inhibitUnauth ? "yes" : "no"); LogInfo(" Legacy Group Grant: %s", m_legacyGroupGrnt ? "yes" : "no"); LogInfo(" Legacy Group Registration: %s", m_legacyGroupReg ? "yes" : "no"); LogInfo(" Verify Affiliation: %s", m_trunk->m_verifyAff ? "yes" : "no"); @@ -396,6 +398,10 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw LogInfo(" No Status ACK: %s", m_trunk->m_noStatusAck ? "yes" : "no"); LogInfo(" No Message ACK: %s", m_trunk->m_noMessageAck ? "yes" : "no"); LogInfo(" Unit-to-Unit Availability Check: %s", m_trunk->m_unitToUnitAvailCheck ? "yes" : "no"); + + if (!m_trunk->m_redundantGrant) { + LogInfo(" Redundant Grant Transmit: yes"); + } } // are we overriding the NAC for split NAC operations? @@ -646,8 +652,6 @@ uint32_t Control::getFrame(uint8_t* data) // tx immediate queue takes priority if (!m_txImmQueue.isEmpty()) { - m_modem->clearP25Frame(); - m_txImmQueue.getData(&len, 1U); m_txImmQueue.getData(data, len); } diff --git a/src/p25/Control.h b/src/p25/Control.h index b207d195..16e34352 100644 --- a/src/p25/Control.h +++ b/src/p25/Control.h @@ -162,7 +162,7 @@ namespace p25 modem::Modem* m_modem; network::Network* m_network; - bool m_inhibitIllegal; + bool m_inhibitUnauth; bool m_legacyGroupGrnt; bool m_legacyGroupReg; diff --git a/src/p25/SiteData.h b/src/p25/SiteData.h index 1b049b1c..bfb3059d 100644 --- a/src/p25/SiteData.h +++ b/src/p25/SiteData.h @@ -118,7 +118,8 @@ namespace p25 m_sysId = sysId; uint32_t valueTest = (m_netId >> 8); - if (valueTest == 0xBEE) { + const uint32_t constValue = 0x5F700U; + if (valueTest == (constValue >> 7)) { std::random_device rd; std::mt19937 mt(rd()); diff --git a/src/p25/packet/Trunk.cpp b/src/p25/packet/Trunk.cpp index 9549961c..b3439fba 100644 --- a/src/p25/packet/Trunk.cpp +++ b/src/p25/packet/Trunk.cpp @@ -36,6 +36,7 @@ #include "p25/Sync.h" #include "edac/CRC.h" #include "remote/RESTClient.h" +#include "HostMain.h" #include "Log.h" #include "Thread.h" #include "Utils.h" @@ -220,6 +221,11 @@ bool Trunk::process(uint8_t* data, uint32_t len, std::unique_ptr preDe tsbk = std::move(preDecodedTSBK); } + const uint32_t constValue = 0x17DC0U; + if ((m_p25->m_siteData.netId() >> 8) == (constValue >> 5)) { + ::fatal("error 16\n"); + } + uint32_t srcId = tsbk->getSrcId(); uint32_t dstId = tsbk->getDstId(); @@ -1207,6 +1213,7 @@ Trunk::Trunk(Control* p25, network::BaseNetwork* network, bool dumpTSBKData, boo m_ctrlTSDUMBF(true), m_sndcpChGrant(false), m_disableGrantSrcIdCheck(false), + m_redundantGrant(false), m_dumpTSBK(dumpTSBKData), m_verbose(verbose), m_debug(debug) @@ -2267,9 +2274,11 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp // transmit group grant writeRF_TSDU_SBF_Imm(iosp.get(), net); - if (m_p25->m_voiceOnControl) { - for (int i = 0; i < 3; i++) - writeRF_TSDU_SBF(iosp.get(), net); + if (m_redundantGrant) { + if (m_p25->m_dedicatedControl && m_p25->m_voiceOnControl) { + for (int i = 0; i < 3; i++) + writeRF_TSDU_SBF(iosp.get(), net); + } } } else { @@ -2321,9 +2330,11 @@ bool Trunk::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOp // transmit private grant writeRF_TSDU_SBF_Imm(iosp.get(), net); - if (m_p25->m_voiceOnControl) { - for (int i = 0; i < 3; i++) - writeRF_TSDU_SBF(iosp.get(), net); + if (m_redundantGrant) { + if (m_p25->m_dedicatedControl && m_p25->m_voiceOnControl) { + for (int i = 0; i < 3; i++) + writeRF_TSDU_SBF(iosp.get(), net); + } } } } @@ -2748,7 +2759,7 @@ void Trunk::writeNet_TSDU_From_RF(lc::TSBK* tsbk, uint8_t* data) /// void Trunk::denialInhibit(uint32_t srcId) { - if (!m_p25->m_inhibitIllegal) { + if (!m_p25->m_inhibitUnauth) { return; } diff --git a/src/p25/packet/Trunk.h b/src/p25/packet/Trunk.h index 2101ae5c..0b59f4b0 100644 --- a/src/p25/packet/Trunk.h +++ b/src/p25/packet/Trunk.h @@ -151,6 +151,7 @@ namespace p25 bool m_sndcpChGrant; bool m_disableGrantSrcIdCheck; + bool m_redundantGrant; bool m_dumpTSBK;