From c77f7eda644956fa71a179fb83e548c9502edaef Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 1 Mar 2023 08:12:13 -0500 Subject: [PATCH] remove P25 emergency flags from config (emergency functions are unsupported); support *receiving* the P25 emergency alarm request; [Future Note: Emergency modes are not expressly supported by DVM or DVM Project. This project should *never* be used in situations where emergency mode functionality is required.] --- config.example.yml | 4 ---- p25/Control.cpp | 5 ----- p25/Control.h | 1 - p25/packet/Trunk.cpp | 41 +++++++++++++---------------------------- p25/packet/Trunk.h | 1 - 5 files changed, 13 insertions(+), 39 deletions(-) diff --git a/config.example.yml b/config.example.yml index a51f499a..0595724d 100644 --- a/config.example.yml +++ b/config.example.yml @@ -194,16 +194,12 @@ protocols: noMessageAck: true # Flag indicating that unit-to-unit availiability checks should be performed for a private call. unitToUnitAvailCheck: true - # Flag indicating that emergency alarm's will be acknowledged. - localEmergAlarm: false # Flag indicating whether or not the host will respond to SNDCP data grant requests. sndcpGrant: false # BER/Error threshold for silencing voice packets. silenceThreshold: 124 # Flag indicating whether or not a voice HDU will transmitted at the start of a call from the network. disableNetworkHDU: false - # Flag indicating whether or not emergency support is enabled. - emergDisabled: true # Internal data queue size (in P25 packets). queueSize: 12 # Flag indicating whether or not verbose logging is enabled. diff --git a/p25/Control.cpp b/p25/Control.cpp index c9d7807b..fefff9d9 100644 --- a/p25/Control.cpp +++ b/p25/Control.cpp @@ -104,7 +104,6 @@ Control::Control(bool authoritative, uint32_t nac, uint32_t callHang, uint32_t q m_voiceOnControl(false), m_ackTSBKRequests(true), m_disableNetworkHDU(false), - m_emergDisabled(true), m_idenTable(idenTable), m_ridLookup(ridLookup), m_tidLookup(tidLookup), @@ -241,7 +240,6 @@ void Control::setOptions(yaml::Node& conf, const std::string cwCallsign, const s m_trunk->m_noMessageAck = p25Protocol["noMessageAck"].as(true); m_trunk->m_unitToUnitAvailCheck = p25Protocol["unitToUnitAvailCheck"].as(true); - m_trunk->m_localEmergAlarm = p25Protocol["localEmergAlarm"].as(false); m_trunk->m_sndcpChGrant = p25Protocol["sndcpGrant"].as(false); yaml::Node control = p25Protocol["control"]; @@ -316,8 +314,6 @@ void Control::setOptions(yaml::Node& conf, const std::string cwCallsign, const s uint32_t ccBcstInterval = p25Protocol["control"]["interval"].as(300U); m_trunk->m_adjSiteUpdateInterval += ccBcstInterval; - m_emergDisabled = p25Protocol["emergDisabled"].as(true); - if (printOptions) { LogInfo(" Silence Threshold: %u (%.1f%%)", m_voice->m_silenceThreshold, float(m_voice->m_silenceThreshold) / 12.33F); @@ -330,7 +326,6 @@ void Control::setOptions(yaml::Node& conf, const std::string cwCallsign, const s if (!m_trunk->m_ctrlTSDUMBF) { LogInfo(" Disable Multi-Block TSDUs: yes"); } - LogInfo(" Emergency Support Disabled: %s", m_emergDisabled ? "yes" : "no"); LogInfo(" Time/Date Announcement TSBK: %s", m_trunk->m_ctrlTimeDateAnn ? "yes" : "no"); LogInfo(" Inhibit Illegal: %s", m_inhibitIllegal ? "yes" : "no"); diff --git a/p25/Control.h b/p25/Control.h index 944cef30..59cc1261 100644 --- a/p25/Control.h +++ b/p25/Control.h @@ -164,7 +164,6 @@ namespace p25 bool m_voiceOnControl; bool m_ackTSBKRequests; bool m_disableNetworkHDU; - bool m_emergDisabled; ::lookups::IdenTableLookup* m_idenTable; ::lookups::RadioIdLookup* m_ridLookup; diff --git a/p25/packet/Trunk.cpp b/p25/packet/Trunk.cpp index b284f46e..0125ea15 100644 --- a/p25/packet/Trunk.cpp +++ b/p25/packet/Trunk.cpp @@ -475,23 +475,18 @@ bool Trunk::process(uint8_t* data, uint32_t len, std::unique_ptr preDe break; case TSBK_ISP_EMERG_ALRM_REQ: { - if (!m_p25->m_emergDisabled) { - ISP_EMERG_ALRM_REQ* isp = static_cast(tsbk.get()); - if (isp->getEmergency()) { - if (m_verbose) { - LogMessage(LOG_RF, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request), srcId = %u, dstId = %u", - srcId, dstId); - } + ISP_EMERG_ALRM_REQ* isp = static_cast(tsbk.get()); + if (isp->getEmergency()) { + if (m_verbose) { + LogMessage(LOG_RF, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request), srcId = %u, dstId = %u", + srcId, dstId); + } - ::ActivityLog("P25", true, "emergency alarm request request from %u", srcId); + ::ActivityLog("P25", true, "emergency alarm request request from %u", srcId); - writeRF_TSDU_ACK_FNE(srcId, TSBK_ISP_EMERG_ALRM_REQ, false, true); - if (m_localEmergAlarm) { - writeRF_TSDU_Emerg_Alrm(srcId, dstId); - } - } - } else { - LogWarning(LOG_RF, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request) denial, emergency while emergency disabled, srcId = %u", srcId); + // emergency functions are expressly not supported by DVM -- DVM will *ACKNOWLEDGE* the request but will not do any + // further processing with it + writeRF_TSDU_ACK_FNE(srcId, TSBK_ISP_EMERG_ALRM_REQ, false, true); } } break; @@ -858,14 +853,9 @@ bool Trunk::processNetwork(uint8_t* data, uint32_t len, lc::LC& control, data::L // ignore a network deny command return true; // don't allow this to write to the air } else { - if (!m_p25->m_emergDisabled) { - if (m_verbose) { - LogMessage(LOG_NET, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request), srcId = %u, dstId = %u", - srcId, dstId); - } - } else { - LogWarning(LOG_NET, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request) denial, emergency while emergency disabled, srcId = %u", srcId); - return true; // don't allow this to write to the air + if (m_verbose) { + LogMessage(LOG_NET, P25_TSDU_STR ", TSBK_ISP_EMERG_ALRM_REQ (Emergency Alarm Request), srcId = %u, dstId = %u", + srcId, dstId); } } } @@ -1126,10 +1116,6 @@ void Trunk::writeRF_TSDU_U_Reg_Cmd(uint32_t dstId) /// void Trunk::writeRF_TSDU_Emerg_Alrm(uint32_t srcId, uint32_t dstId) { - if (m_p25->m_emergDisabled) { - return; - } - std::unique_ptr isp = new_unique(ISP_EMERG_ALRM_REQ); isp->setSrcId(srcId); isp->setDstId(dstId); @@ -1209,7 +1195,6 @@ Trunk::Trunk(Control* p25, network::BaseNetwork* network, bool dumpTSBKData, boo m_microslotCount(0U), m_ctrlTimeDateAnn(false), m_ctrlTSDUMBF(true), - m_localEmergAlarm(false), m_sndcpChGrant(false), m_dumpTSBK(dumpTSBKData), m_verbose(verbose), diff --git a/p25/packet/Trunk.h b/p25/packet/Trunk.h index af7d3d29..08a7b882 100644 --- a/p25/packet/Trunk.h +++ b/p25/packet/Trunk.h @@ -148,7 +148,6 @@ namespace p25 bool m_ctrlTSDUMBF; - bool m_localEmergAlarm; bool m_sndcpChGrant; bool m_dumpTSBK;