From 01d8fe1a58173b9f31ac39d6551cd6d103a301f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20S=C3=A1nchez=20Raya?= Date: Mon, 3 Aug 2020 19:38:21 +0200 Subject: [PATCH 1/3] Do not remove DG-ID information for use in new servers Please remove reset to zero or setting of DG-ID because is not necessary. There are many reflectors that use DG-ID to change communication between TGs or rooms. --- YSFControl.cpp | 61 -------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/YSFControl.cpp b/YSFControl.cpp index 73c8e8f..9ac7631 100644 --- a/YSFControl.cpp +++ b/YSFControl.cpp @@ -32,8 +32,6 @@ m_display(display), m_duplex(duplex), m_lowDeviation(lowDeviation), m_remoteGateway(remoteGateway), -m_dgIdEnabled(false), -m_dgIdValue(0U), m_queue(5000U, "YSF Control"), m_rfState(RS_RF_LISTENING), m_netState(RS_NET_IDLE), @@ -100,12 +98,6 @@ CYSFControl::~CYSFControl() delete[] m_selfCallsign; } -void CYSFControl::setDGId(bool on, unsigned char value) -{ - m_dgIdEnabled = on; - m_dgIdValue = value; -} - bool CYSFControl::writeModem(unsigned char *data, unsigned int len) { assert(data != NULL); @@ -167,13 +159,6 @@ bool CYSFControl::writeModem(unsigned char *data, unsigned int len) if (valid) m_lastFICH = fich; - // Validate the DG-ID value if enabled - if (m_dgIdEnabled) { - unsigned char value = m_lastFICH.getDGId(); - if (value != m_dgIdValue) - return false; - } - #ifdef notdef // Stop repeater packets coming through, unless we're acting as a remote gateway if (m_remoteGateway) { @@ -258,8 +243,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -272,8 +255,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -299,8 +280,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_EOT; @@ -313,8 +292,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -355,8 +332,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) LogDebug("YSF, V Mode 3, seq %u, AMBE FEC %u/720 (%.1f%%)", m_rfFrames % 128, errors, float(errors) / 7.2F); } - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -365,8 +340,6 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) writeNetwork(data, m_rfFrames % 128U); if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -435,8 +408,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -449,8 +420,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -476,8 +445,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_EOT; @@ -490,8 +457,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -552,8 +517,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -562,8 +525,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) writeNetwork(data, m_rfFrames % 128U); if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -642,7 +603,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; fich.setFI(YSF_FI_HEADER); - fich.setDGId(0U); fich.encode(buffer + 2U); unsigned char csd1[20U], csd2[20U]; @@ -663,8 +623,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) writeNetwork(buffer, m_rfFrames % 128U); if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(buffer + 2U); @@ -682,8 +640,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -692,8 +648,6 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) writeNetwork(data, m_rfFrames % 128U); if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -759,8 +713,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -773,8 +725,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -800,8 +750,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_EOT; @@ -814,8 +762,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) #endif if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -852,8 +798,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) CYSFFICH fich = m_lastFICH; - // Remove any DG-ID information - fich.setDGId(0U); fich.encode(data + 2U); data[0U] = TAG_DATA; @@ -862,8 +806,6 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) writeNetwork(data, m_rfFrames % 128U); if (m_duplex) { - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -1004,9 +946,6 @@ void CYSFControl::writeNetwork() ::memcpy(m_netDest, "ALL ", YSF_CALLSIGN_LENGTH); } - // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); - if (m_remoteGateway) { fich.setVoIP(false); fich.setMR(YSF_MR_DIRECT); From 52ca12e88a7a57094ff44b92d02523cadc960d7e Mon Sep 17 00:00:00 2001 From: msraya Date: Mon, 3 Aug 2020 19:48:25 +0100 Subject: [PATCH 2/3] Update files to remove DG-ID and mantain consistency in code --- Conf.cpp | 17 +---------------- Conf.h | 4 ---- MMDVMHost.cpp | 6 ------ YSFControl.h | 4 ---- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index fce38b5..7491717 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -155,8 +155,6 @@ m_fusionLowDeviation(false), m_fusionRemoteGateway(false), m_fusionSelfOnly(false), m_fusionTXHang(4U), -m_fusionDGIdEnabled(false), -m_fusionDGId(0U), m_fusionModeHang(10U), m_p25Enabled(false), m_p25Id(0U), @@ -667,10 +665,7 @@ bool CConf::read() m_fusionEnabled = ::atoi(value) == 1; else if (::strcmp(key, "LowDeviation") == 0) m_fusionLowDeviation = ::atoi(value) == 1; - else if (::strcmp(key, "DGID") == 0) { - m_fusionDGIdEnabled = true; - m_fusionDGId = (unsigned int)::atoi(value); - } else if (::strcmp(key, "RemoteGateway") == 0) + else if (::strcmp(key, "RemoteGateway") == 0) m_fusionRemoteGateway = ::atoi(value) == 1; else if (::strcmp(key, "SelfOnly") == 0) m_fusionSelfOnly = ::atoi(value) == 1; @@ -1444,16 +1439,6 @@ bool CConf::getFusionSelfOnly() const return m_fusionSelfOnly; } -bool CConf::getFusionDGIdEnabled() const -{ - return m_fusionDGIdEnabled; -} - -unsigned char CConf::getFusionDGId() const -{ - return m_fusionDGId; -} - unsigned int CConf::getFusionModeHang() const { return m_fusionModeHang; diff --git a/Conf.h b/Conf.h index 2c698df..335d461 100644 --- a/Conf.h +++ b/Conf.h @@ -145,8 +145,6 @@ public: bool getFusionRemoteGateway() const; bool getFusionSelfOnly() const; unsigned int getFusionTXHang() const; - bool getFusionDGIdEnabled() const; - unsigned char getFusionDGId() const; unsigned int getFusionModeHang() const; // The P25 section @@ -421,8 +419,6 @@ private: bool m_fusionRemoteGateway; bool m_fusionSelfOnly; unsigned int m_fusionTXHang; - bool m_fusionDGIdEnabled; - unsigned char m_fusionDGId; unsigned int m_fusionModeHang; bool m_p25Enabled; diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 4869818..f174b83 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -535,8 +535,6 @@ int CMMDVMHost::run() bool remoteGateway = m_conf.getFusionRemoteGateway(); unsigned int txHang = m_conf.getFusionTXHang(); bool selfOnly = m_conf.getFusionSelfOnly(); - bool dgIdEnabled = m_conf.getFusionDGIdEnabled(); - unsigned char dgId = m_conf.getFusionDGId(); m_ysfRFModeHang = m_conf.getFusionModeHang(); LogInfo("YSF RF Parameters"); @@ -544,13 +542,9 @@ int CMMDVMHost::run() LogInfo(" Remote Gateway: %s", remoteGateway ? "yes" : "no"); LogInfo(" TX Hang: %us", txHang); LogInfo(" Self Only: %s", selfOnly ? "yes" : "no"); - LogInfo(" DG-ID: %s", dgIdEnabled ? "yes" : "no"); - if (dgIdEnabled) - LogInfo(" DG-ID Value: %u", dgId); LogInfo(" Mode Hang: %us", m_ysfRFModeHang); m_ysf = new CYSFControl(m_callsign, selfOnly, m_ysfNetwork, m_display, m_timeout, m_duplex, lowDeviation, remoteGateway, rssi); - m_ysf->setDGId(dgIdEnabled, dgId); } if (m_p25Enabled) { diff --git a/YSFControl.h b/YSFControl.h index eadd40f..ff2d4af 100644 --- a/YSFControl.h +++ b/YSFControl.h @@ -38,8 +38,6 @@ public: CYSFControl(const std::string& callsign, bool selfOnly, CYSFNetwork* network, CDisplay* display, unsigned int timeout, bool duplex, bool lowDeviation, bool remoteGateway, CRSSIInterpolator* rssiMapper); ~CYSFControl(); - void setDGId(bool on, unsigned char value); - bool writeModem(unsigned char* data, unsigned int len); unsigned int readModem(unsigned char* data); @@ -59,8 +57,6 @@ private: bool m_duplex; bool m_lowDeviation; bool m_remoteGateway; - bool m_dgIdEnabled; - unsigned char m_dgIdValue; CRingBuffer m_queue; RPT_RF_STATE m_rfState; RPT_NET_STATE m_netState; From 9ab838f653cdaa46bf1f37e74c0f5b60e42df16b Mon Sep 17 00:00:00 2001 From: msraya Date: Mon, 3 Aug 2020 19:56:08 +0100 Subject: [PATCH 3/3] Update files to remove DG-ID and maintain consistency in code --- MMDVM.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/MMDVM.ini b/MMDVM.ini index 2eed9b9..ccc561b 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -117,7 +117,6 @@ Enable=1 LowDeviation=0 SelfOnly=0 TXHang=4 -#DGID=1 RemoteGateway=0 # ModeHang=10