From d0be614c27223307c03f51af64b0d7e688921ea6 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Thu, 13 Jul 2023 20:42:25 -0400 Subject: [PATCH] split announcement group config into its own config var; --- configs/config.example.yml | 6 ++++-- src/host/Host.cpp | 5 +---- src/host/Host.h | 1 - src/p25/Control.cpp | 11 +++++++---- src/p25/Control.h | 3 +-- src/p25/packet/Trunk.cpp | 7 ++++--- src/p25/packet/Trunk.h | 1 + 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/configs/config.example.yml b/configs/config.example.yml index 5ced356f..584fc290 100644 --- a/configs/config.example.yml +++ b/configs/config.example.yml @@ -368,8 +368,10 @@ system: # NXDN Random Access Number. ran: 1 - # P25 Patch Super Group. - pSuperGroup: FFFF + # Patch Super Group. + pSuperGroup: FFFE + # Announcment Talkgroup Group. + announcementGroup: FFFE # DMR network ID. dmrNetId: 1 diff --git a/src/host/Host.cpp b/src/host/Host.cpp index 8b18ea66..362ec71f 100644 --- a/src/host/Host.cpp +++ b/src/host/Host.cpp @@ -133,7 +133,6 @@ Host::Host(const std::string& confFile) : m_dmrNetId(1U), m_dmrColorCode(1U), m_p25NAC(0x293U), - m_p25PatchSuperGroup(0xFFFFU), m_p25NetId(0xBB800U), m_p25RfssId(1U), m_nxdnRAN(1U), @@ -508,7 +507,7 @@ int Host::run() m_network, m_timeout, m_rfTalkgroupHang, m_duplex, m_ridLookup, m_tidLookup, m_idenTable, rssi, p25DumpDataPacket, p25RepeatDataPacket, p25DumpTsbkData, p25Debug, p25Verbose)); p25->setOptions(m_conf, m_supervisor, m_cwCallsign, m_voiceChNo, m_voiceChData, m_controlChData, - m_p25PatchSuperGroup, m_p25NetId, m_sysId, m_p25RfssId, m_siteId, m_channelId, m_channelNo, true); + m_p25NetId, m_sysId, m_p25RfssId, m_siteId, m_channelId, m_channelNo, true); if (p25CtrlChannel) { p25->setCCRunning(true); @@ -1912,7 +1911,6 @@ bool Host::readParams() LogWarning(LOG_HOST, "Only use txNAC when split NAC operations are needed. nac and txNAC should not be the same!"); } - m_p25PatchSuperGroup = (uint32_t)::strtoul(rfssConfig["pSuperGroup"].as("FFFF").c_str(), NULL, 16); m_p25NetId = (uint32_t)::strtoul(rfssConfig["netId"].as("BB800").c_str(), NULL, 16); m_p25NetId = p25::P25Utils::netId(m_p25NetId); if (m_p25NetId == 0xBEE00) { @@ -1954,7 +1952,6 @@ bool Host::readParams() LogInfo(" P25 Tx NAC: $%03X", p25TxNAC); } - LogInfo(" P25 Patch Super Group: $%04X", m_p25PatchSuperGroup); LogInfo(" P25 Network Id: $%05X", m_p25NetId); LogInfo(" P25 RFSS Id: $%02X", m_p25RfssId); LogInfo(" NXDN RAN: %u", m_nxdnRAN); diff --git a/src/host/Host.h b/src/host/Host.h index 7bb73e7e..d5a2f674 100644 --- a/src/host/Host.h +++ b/src/host/Host.h @@ -140,7 +140,6 @@ private: uint32_t m_dmrNetId; uint32_t m_dmrColorCode; uint32_t m_p25NAC; - uint32_t m_p25PatchSuperGroup; uint32_t m_p25NetId; uint8_t m_p25RfssId; uint32_t m_nxdnRAN; diff --git a/src/p25/Control.cpp b/src/p25/Control.cpp index cfad68b2..5467b7c9 100644 --- a/src/p25/Control.cpp +++ b/src/p25/Control.cpp @@ -220,8 +220,7 @@ void Control::reset() /// void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, const std::unordered_map voiceChData, const ::lookups::VoiceChData controlChData, - uint32_t pSuperGroup, uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, - uint32_t channelNo, bool printOptions) + uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool printOptions) { yaml::Node systemConf = conf["system"]; yaml::Node p25Protocol = conf["protocols"]["p25"]; @@ -230,7 +229,9 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_tduPreambleCount = p25Protocol["tduPreambleCount"].as(8U); - m_trunk->m_patchSuperGroup = pSuperGroup; + yaml::Node rfssConfig = systemConf["config"]; + m_trunk->m_patchSuperGroup = (uint32_t)::strtoul(rfssConfig["pSuperGroup"].as("FFFE").c_str(), NULL, 16); + m_trunk->m_announcementGroup = (uint32_t)::strtoul(rfssConfig["announcementGroup"].as("FFFE").c_str(), NULL, 16); m_inhibitUnauth = p25Protocol["inhibitUnauthorized"].as(false); m_legacyGroupGrnt = p25Protocol["legacyGroupGrnt"].as(true); @@ -360,7 +361,6 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw m_trunk->m_disableGrantSrcIdCheck = p25Protocol["control"]["disableGrantSourceIdCheck"].as(false); - yaml::Node rfssConfig = systemConf["config"]; yaml::Node controlCh = rfssConfig["controlCh"]; m_notifyCC = controlCh["notifyEnable"].as(false); @@ -384,6 +384,9 @@ void Control::setOptions(yaml::Node& conf, bool supervisor, const std::string cw LogInfo(" Control Data Only: yes"); } + LogInfo(" Patch Super Group: $%04X", m_trunk->m_patchSuperGroup); + LogInfo(" Announcement Group: $%04X", m_trunk->m_announcementGroup); + LogInfo(" Notify Control: %s", m_notifyCC ? "yes" : "no"); LogInfo(" Disable Network HDUs: %s", m_disableNetworkHDU ? "yes" : "no"); if (!m_trunk->m_ctrlTSDUMBF) { diff --git a/src/p25/Control.h b/src/p25/Control.h index 319230b2..4c73ef68 100644 --- a/src/p25/Control.h +++ b/src/p25/Control.h @@ -84,8 +84,7 @@ namespace p25 /// Helper to set P25 configuration options. void setOptions(yaml::Node& conf, bool supervisor, const std::string cwCallsign, const std::vector voiceChNo, const std::unordered_map voiceChData, const ::lookups::VoiceChData controlChData, - uint32_t pSuperGroup, uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, - uint32_t channelNo, bool printOptions); + uint32_t netId, uint32_t sysId, uint8_t rfssId, uint8_t siteId, uint8_t channelId, uint32_t channelNo, bool printOptions); /// Gets a flag indicating whether the P25 control channel is running. bool getCCRunning() { return m_ccRunning; } diff --git a/src/p25/packet/Trunk.cpp b/src/p25/packet/Trunk.cpp index db2d51a1..05f292fe 100644 --- a/src/p25/packet/Trunk.cpp +++ b/src/p25/packet/Trunk.cpp @@ -1191,7 +1191,8 @@ void Trunk::setTSBKVerbose(bool verbose) Trunk::Trunk(Control* p25, network::BaseNetwork* network, bool dumpTSBKData, bool debug, bool verbose) : m_p25(p25), m_network(network), - m_patchSuperGroup(0xFFFFU), + m_patchSuperGroup(0xFFFEU), + m_announcementGroup(0xFFFEU), m_verifyAff(false), m_verifyReg(false), m_rfMBF(nullptr), @@ -2514,7 +2515,7 @@ bool Trunk::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId) std::unique_ptr iosp = new_unique(IOSP_GRP_AFF); iosp->setMFId(m_lastMFID); - iosp->setAnnounceGroup(m_patchSuperGroup); // this isn't right... + iosp->setAnnounceGroup(m_announcementGroup); iosp->setSrcId(srcId); iosp->setDstId(dstId); iosp->setResponse(P25_RSP_ACCEPT); @@ -2548,7 +2549,7 @@ bool Trunk::writeRF_TSDU_Grp_Aff_Rsp(uint32_t srcId, uint32_t dstId) if (iosp->getResponse() == P25_RSP_ACCEPT) { if (m_verbose) { LogMessage(LOG_RF, P25_TSDU_STR ", %s, anncId = %u, srcId = %u, dstId = %u", - iosp->toString().c_str(), m_patchSuperGroup, srcId, dstId); + iosp->toString().c_str(), m_announcementGroup, srcId, dstId); } ::ActivityLog("P25", true, "group affiliation request from %u to %s %u", srcId, "TG ", dstId); diff --git a/src/p25/packet/Trunk.h b/src/p25/packet/Trunk.h index 1ecab020..0c8c8096 100644 --- a/src/p25/packet/Trunk.h +++ b/src/p25/packet/Trunk.h @@ -111,6 +111,7 @@ namespace p25 network::BaseNetwork* m_network; uint32_t m_patchSuperGroup; + uint32_t m_announcementGroup; bool m_verifyAff; bool m_verifyReg;