From 3c4f98a9a618082e3385272c213d2c6e98bc11c7 Mon Sep 17 00:00:00 2001 From: msraya Date: Thu, 5 Sep 2019 12:39:20 +0200 Subject: [PATCH] Keep DG-ID Information Remove setDGID to zero. Keep change DGID if selected in configuration file. --- YSFControl.cpp | 43 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/YSFControl.cpp b/YSFControl.cpp index d1d0880..78aefd4 100644 --- a/YSFControl.cpp +++ b/YSFControl.cpp @@ -258,8 +258,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; @@ -273,7 +271,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -299,8 +297,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; @@ -314,7 +310,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -354,9 +350,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) m_display->writeFusionBER(float(errors) / 7.2F); 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; @@ -366,7 +360,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -435,8 +429,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; @@ -450,7 +442,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -476,8 +468,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; @@ -491,7 +481,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -552,8 +542,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; @@ -563,7 +551,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -642,7 +630,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]; @@ -664,7 +651,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(buffer + 2U); @@ -682,8 +669,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; @@ -693,7 +678,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -759,8 +744,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; @@ -774,7 +757,7 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -852,8 +835,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; @@ -863,7 +844,7 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) if (m_duplex) { // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); fich.setMR(m_remoteGateway ? YSF_MR_NOT_BUSY : YSF_MR_BUSY); fich.setDev(m_lowDeviation); fich.encode(data + 2U); @@ -1005,7 +986,7 @@ void CYSFControl::writeNetwork() } // Add the DG-ID information. - fich.setDGId(m_dgIdEnabled ? m_dgIdValue : 0U); + if (m_dgIdEnabled) fich.setDGId(m_dgIdValue); if (m_remoteGateway) { fich.setVoIP(false);