diff --git a/DMRControl.cpp b/DMRControl.cpp index 57610808..40178bab 100644 --- a/DMRControl.cpp +++ b/DMRControl.cpp @@ -50,7 +50,7 @@ bool CDMRControl::processWakeup(const unsigned char* data) assert(data != NULL); // Wakeups always come in on slot 1 - if (data[0U] != TAG_DATA || data[1U] != (DMR_IDLE_RX | DMR_SYNC_DATA | DT_CSBK)) + if (data[0U] != TAG_DATA1 || data[1U] != (DMR_IDLE_RX | DMR_SYNC_DATA | DT_CSBK)) return false; CDMRCSBK csbk; diff --git a/DMRDefines.h b/DMRDefines.h index 5b53c33d..ca08c19a 100644 --- a/DMRDefines.h +++ b/DMRDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ #if !defined(DMRDefines_H) #define DMRDefines_H -#include "Defines.h" // For TAG_DATA +#include "Defines.h" // For TAG_DATA1 const unsigned int DMR_FRAME_LENGTH_BITS = 264U; const unsigned int DMR_FRAME_LENGTH_BYTES = 33U; @@ -54,13 +54,13 @@ const unsigned char DIRECT_SLOT2_DATA_SYNC[] = {0x0DU, 0x75U, 0x57U, 0xF5U, 0xF const unsigned char SYNC_MASK[] = {0x0FU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xFFU, 0xF0U}; // The PR FILL and Data Sync pattern. -const unsigned char DMR_IDLE_DATA[] = {TAG_DATA, 0x00U, +const unsigned char DMR_IDLE_DATA[] = {TAG_DATA1, 0x00U, 0x53U, 0xC2U, 0x5EU, 0xABU, 0xA8U, 0x67U, 0x1DU, 0xC7U, 0x38U, 0x3BU, 0xD9U, 0x36U, 0x00U, 0x0DU, 0xFFU, 0x57U, 0xD7U, 0x5DU, 0xF5U, 0xD0U, 0x03U, 0xF6U, 0xE4U, 0x65U, 0x17U, 0x1BU, 0x48U, 0xCAU, 0x6DU, 0x4FU, 0xC6U, 0x10U, 0xB4U}; // A silence frame only -const unsigned char DMR_SILENCE_DATA[] = {TAG_DATA, 0x00U, +const unsigned char DMR_SILENCE_DATA[] = {TAG_DATA1, 0x00U, 0xB9U, 0xE8U, 0x81U, 0x52U, 0x61U, 0x73U, 0x00U, 0x2AU, 0x6BU, 0xB9U, 0xE8U, 0x81U, 0x52U, 0x60U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x01U, 0x73U, 0x00U, 0x2AU, 0x6BU, 0xB9U, 0xE8U, 0x81U, 0x52U, 0x61U, 0x73U, 0x00U, 0x2AU, 0x6BU}; diff --git a/DMRSlot.cpp b/DMRSlot.cpp index 1f405ca4..374dc400 100644 --- a/DMRSlot.cpp +++ b/DMRSlot.cpp @@ -255,7 +255,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; m_rfTimeoutTimer.start(); @@ -315,7 +315,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) bptc.decode(data + 2U, payload); bptc.encode(payload, data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -404,7 +404,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = m_rfFrames == 0U ? TAG_EOT : TAG_DATA; + data[0U] = m_rfFrames == 0U ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -472,7 +472,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -545,7 +545,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) m_rfFrames--; - data[0U] = m_rfFrames == 0U ? TAG_EOT : TAG_DATA; + data[0U] = m_rfFrames == 0U ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -586,7 +586,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) m_display->writeDMRRSSI(m_slotNo, m_rssi); if (!m_rfTimeout) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -752,7 +752,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) emb.getData(data + 2U); if (!m_rfTimeout) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetworkRF(data, DT_VOICE, errors); @@ -828,7 +828,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) slotType.setDataType(DT_VOICE_LC_HEADER); slotType.getData(start + 2U); - start[0U] = TAG_DATA; + start[0U] = TAG_DATA1; start[1U] = 0x00U; m_rfTimeoutTimer.start(); @@ -880,7 +880,7 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len) m_rfBits += 141U; m_rfFrames++; - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; if (m_duplex) @@ -1088,7 +1088,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; m_lastFrameValid = false; @@ -1177,7 +1177,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) slotType.setDataType(DT_VOICE_LC_HEADER); slotType.getData(start + 2U); - start[0U] = TAG_DATA; + start[0U] = TAG_DATA1; start[1U] = 0x00U; if (m_duplex) { @@ -1224,7 +1224,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) bptc.decode(data + 2U, payload); bptc.encode(payload, data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeQueueNet(data); @@ -1304,7 +1304,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = m_netFrames == 0U ? TAG_EOT : TAG_DATA; + data[0U] = m_netFrames == 0U ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; // Put a small delay into starting transmission @@ -1374,7 +1374,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) slotType.setDataType(DT_VOICE_LC_HEADER); slotType.getData(start + 2U); - start[0U] = TAG_DATA; + start[0U] = TAG_DATA1; start[1U] = 0x00U; if (m_duplex) { @@ -1417,7 +1417,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) m_netErrs += m_fec.regenerateDMR(data + 2U); m_netBits += 141U; - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; // Convert the Audio Sync to be from the BS or MS as needed @@ -1572,7 +1572,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) emb.setLCSS(lcss); emb.getData(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; // Initialise the lost packet data @@ -1633,7 +1633,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) // Convert the Data Sync to be from the BS or MS as needed CSync::addDMRDataSync(data + 2U, m_duplex); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; if (csbko == CSBKO_PRECCSBK && csbk.getDataContent()) { @@ -1732,7 +1732,7 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData) m_netFrames--; - data[0U] = m_netFrames == 0U ? TAG_EOT : TAG_DATA; + data[0U] = m_netFrames == 0U ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; #if defined(DUMP_DMR) diff --git a/DStarControl.cpp b/DStarControl.cpp index 786702a1..61837dba 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2019 Jonathan Naylor, G4KLX + * Copyright (C) 2015-2019,2021 Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -429,7 +429,7 @@ bool CDStarControl::writeModem(unsigned char *data, unsigned int len) } return false; - } else if (type == TAG_DATA) { + } else if (type == TAG_DATA1) { if (m_rfState == RS_RF_REJECTED) { return false; } else if (m_rfState == RS_RF_INVALID) { @@ -779,13 +779,13 @@ void CDStarControl::writeNetwork() LogMessage("D-Star, received network end of transmission from %8.8s/%4.4s to %8.8s, %.1f seconds, %u%% packet loss, BER: %.1f%%", my1, my2, your, float(m_netFrames) / 50.0F, (m_netLost * 100U) / m_netFrames, float(m_netErrs * 100U) / float(m_netBits)); writeEndNet(); - } else if (type == TAG_DATA) { + } else if (type == TAG_DATA1) { if (m_netState != RS_NET_AUDIO) return; unsigned char n = data[1U]; - data[1U] = TAG_DATA; + data[1U] = TAG_DATA1; unsigned int errors = 0U; if (!m_netHeader.isDataPacket()) diff --git a/DStarDefines.h b/DStarDefines.h index 2a3e90cd..f6ad749b 100644 --- a/DStarDefines.h +++ b/DStarDefines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016,2018,2019 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2018,2019,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,8 +35,8 @@ const unsigned char DSTAR_NULL_SLOW_SYNC_BYTES[] = { 0x55, 0x2D, 0x16 }; // Note that these are already scrambled, 0x66 0x66 0x66 otherwise const unsigned char DSTAR_NULL_SLOW_DATA_BYTES[] = { 0x16, 0x29, 0xF5 }; -const unsigned char DSTAR_NULL_FRAME_SYNC_BYTES[] = { TAG_DATA, 0x9E, 0x8D, 0x32, 0x88, 0x26, 0x1A, 0x3F, 0x61, 0xE8, 0x55, 0x2D, 0x16 }; -const unsigned char DSTAR_NULL_FRAME_DATA_BYTES[] = { TAG_DATA, 0x9E, 0x8D, 0x32, 0x88, 0x26, 0x1A, 0x3F, 0x61, 0xE8, 0x16, 0x29, 0xF5 }; +const unsigned char DSTAR_NULL_FRAME_SYNC_BYTES[] = { TAG_DATA1, 0x9E, 0x8D, 0x32, 0x88, 0x26, 0x1A, 0x3F, 0x61, 0xE8, 0x55, 0x2D, 0x16 }; +const unsigned char DSTAR_NULL_FRAME_DATA_BYTES[] = { TAG_DATA1, 0x9E, 0x8D, 0x32, 0x88, 0x26, 0x1A, 0x3F, 0x61, 0xE8, 0x16, 0x29, 0xF5 }; const unsigned int DSTAR_VOICE_FRAME_LENGTH_BYTES = 9U; const unsigned int DSTAR_DATA_FRAME_LENGTH_BYTES = 3U; diff --git a/DStarNetwork.cpp b/DStarNetwork.cpp index 4a978e26..2de9051b 100644 --- a/DStarNetwork.cpp +++ b/DStarNetwork.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014,2016,2019,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2014,2016,2019,2020,2021 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -263,7 +263,7 @@ void CDStarNetwork::clock(unsigned int ms) m_inId = 0U; ctrl[1U] = TAG_EOT; } else { - ctrl[1U] = TAG_DATA; + ctrl[1U] = TAG_DATA1; } ctrl[2U] = buffer[7] & 0x3FU; @@ -299,7 +299,7 @@ unsigned int CDStarNetwork::read(unsigned char* data, unsigned int length) switch (buffer[0U]) { case TAG_HEADER: - case TAG_DATA: + case TAG_DATA1: case TAG_EOT: ::memcpy(data, buffer, c); return c; diff --git a/Defines.h b/Defines.h index 0381a430..58f43483 100644 --- a/Defines.h +++ b/Defines.h @@ -36,9 +36,10 @@ const unsigned char MODE_ERROR = 100U; const unsigned char MODE_QUIT = 110U; const unsigned char TAG_HEADER = 0x00U; -const unsigned char TAG_DATA = 0x01U; -const unsigned char TAG_LOST = 0x02U; -const unsigned char TAG_EOT = 0x03U; +const unsigned char TAG_DATA1 = 0x01U; +const unsigned char TAG_DATA2 = 0x02U; +const unsigned char TAG_LOST = 0x03U; +const unsigned char TAG_EOT = 0x04U; const unsigned int DSTAR_MODEM_DATA_LEN = 220U; diff --git a/FMControl.cpp b/FMControl.cpp index 7f1ff073..1708c61a 100644 --- a/FMControl.cpp +++ b/FMControl.cpp @@ -81,7 +81,7 @@ bool CFMControl::writeModem(const unsigned char* data, unsigned int length) if (data[0U] == TAG_EOT) return m_network->writeEOT(); - if (data[0U] != TAG_DATA) + if (data[0U] != TAG_DATA1) return false; m_incomingRFAudio.addData(data + 1U, length - 1U); diff --git a/M17Control.cpp b/M17Control.cpp index aaf2342c..653413df 100644 --- a/M17Control.cpp +++ b/M17Control.cpp @@ -135,6 +135,12 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len) return false; } + // Ignore packet data + if (type == TAG_DATA2) { + m_rfState = RS_RF_LISTENING; + return false; + } + // Have we got RSSI bytes on the end? if (len == (M17_FRAME_LENGTH_BYTES + 4U)) { uint16_t raw = 0U; @@ -200,12 +206,12 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len) } } - if (m_rfState == RS_RF_LISTENING && data[0U] == TAG_DATA) { + if (m_rfState == RS_RF_LISTENING && data[0U] == TAG_DATA1) { m_rfState = RS_RF_LATE_ENTRY; m_rfLSF.reset(); } - if (m_rfState == RS_RF_LATE_ENTRY && data[0U] == TAG_DATA) { + if (m_rfState == RS_RF_LATE_ENTRY && data[0U] == TAG_DATA1) { bool valid1, valid2, valid3, valid4; unsigned int lich1 = CGolay24128::decode24128(data + 2U + M17_SYNC_LENGTH_BYTES + 0U, valid1); unsigned int lich2 = CGolay24128::decode24128(data + 2U + M17_SYNC_LENGTH_BYTES + 3U, valid2); @@ -247,7 +253,7 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len) } } - if (m_rfState == RS_RF_AUDIO && data[0U] == TAG_DATA) { + if (m_rfState == RS_RF_AUDIO && data[0U] == TAG_DATA1) { #if defined(DUMP_M17) writeFile(data + 2U); #endif @@ -271,7 +277,7 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len) unsigned char rfData[2U + M17_FRAME_LENGTH_BYTES]; - rfData[0U] = TAG_DATA; + rfData[0U] = TAG_DATA1; rfData[1U] = 0x00U; // Generate the sync @@ -487,7 +493,7 @@ void CM17Control::writeNetwork() if (m_netState == RS_NET_AUDIO) { unsigned char data[M17_FRAME_LENGTH_BYTES + 2U]; - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; // Generate the sync @@ -547,6 +553,10 @@ void CM17Control::writeNetwork() bool CM17Control::processRFHeader(bool lateEntry) { + unsigned char packetStream = m_rfLSF.getPacketStream(); + if (packetStream == M17_PACKET_TYPE) + return false; + unsigned char can = m_rfLSF.getCAN(); if (can != m_can) return false; diff --git a/Modem.cpp b/Modem.cpp index 795302b0..1a33935c 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -468,7 +468,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - m_offset + 1U; m_rxDStarData.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA1; m_rxDStarData.addData(&data, 1U); m_rxDStarData.addData(m_buffer + m_offset, m_length - m_offset); @@ -509,7 +509,7 @@ void CModem::clock(unsigned int ms) if (m_buffer[3U] == (DMR_SYNC_DATA | DT_TERMINATOR_WITH_LC)) data = TAG_EOT; else - data = TAG_DATA; + data = TAG_DATA1; m_rxDMRData1.addData(&data, 1U); m_rxDMRData1.addData(m_buffer + m_offset, m_length - m_offset); @@ -526,7 +526,7 @@ void CModem::clock(unsigned int ms) if (m_buffer[3U] == (DMR_SYNC_DATA | DT_TERMINATOR_WITH_LC)) data = TAG_EOT; else - data = TAG_DATA; + data = TAG_DATA1; m_rxDMRData2.addData(&data, 1U); m_rxDMRData2.addData(m_buffer + m_offset, m_length - m_offset); @@ -564,7 +564,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - m_offset + 1U; m_rxYSFData.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA1; m_rxYSFData.addData(&data, 1U); m_rxYSFData.addData(m_buffer + m_offset, m_length - m_offset); @@ -604,7 +604,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - m_offset + 1U; m_rxP25Data.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA1; m_rxP25Data.addData(&data, 1U); m_rxP25Data.addData(m_buffer + m_offset, m_length - m_offset); @@ -630,7 +630,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - m_offset + 1U; m_rxNXDNData.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA1; m_rxNXDNData.addData(&data, 1U); m_rxNXDNData.addData(m_buffer + m_offset, m_length - m_offset); @@ -670,7 +670,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - 2U; m_rxM17Data.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA1; m_rxM17Data.addData(&data, 1U); m_rxM17Data.addData(m_buffer + 3U, m_length - 3U); @@ -684,7 +684,7 @@ void CModem::clock(unsigned int ms) unsigned char data = m_length - 2U; m_rxM17Data.addData(&data, 1U); - data = TAG_DATA; + data = TAG_DATA2; m_rxM17Data.addData(&data, 1U); m_rxM17Data.addData(m_buffer + 3U, m_length - 3U); @@ -710,7 +710,7 @@ void CModem::clock(unsigned int ms) unsigned int data1 = m_length - m_offset + 1U; m_rxFMData.addData((unsigned char*)&data1, sizeof(unsigned int)); - unsigned char data2 = TAG_DATA; + unsigned char data2 = TAG_DATA1; m_rxFMData.addData(&data2, 1U); m_rxFMData.addData(m_buffer + m_offset, m_length - m_offset); @@ -1322,7 +1322,7 @@ bool CModem::writeDStarData(const unsigned char* data, unsigned int length) case TAG_HEADER: buffer[2U] = MMDVM_DSTAR_HEADER; break; - case TAG_DATA: + case TAG_DATA1: buffer[2U] = MMDVM_DSTAR_DATA; break; case TAG_EOT: @@ -1361,7 +1361,7 @@ bool CModem::writeDMRData1(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[40U]; @@ -1384,7 +1384,7 @@ bool CModem::writeDMRData2(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[40U]; @@ -1414,7 +1414,7 @@ bool CModem::writeYSFData(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[130U]; @@ -1444,7 +1444,7 @@ bool CModem::writeP25Data(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_HEADER && data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_HEADER && data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[250U]; @@ -1474,7 +1474,7 @@ bool CModem::writeNXDNData(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[130U]; @@ -1504,7 +1504,7 @@ bool CModem::writeM17Data(const unsigned char* data, unsigned int length) assert(data != NULL); assert(length > 0U); - if (data[0U] != TAG_HEADER && data[0U] != TAG_DATA && data[0U] != TAG_EOT) + if (data[0U] != TAG_HEADER && data[0U] != TAG_DATA1 && data[0U] != TAG_EOT) return false; unsigned char buffer[130U]; @@ -1823,7 +1823,7 @@ bool CModem::writePOCSAGInfo(unsigned int ric, const std::string& message) unsigned char buffer[250U]; buffer[0U] = MMDVM_FRAME_START; - buffer[1U] = length + 11U; + buffer[1U] = (unsigned char)length + 11U; buffer[2U] = MMDVM_QSO_INFO; buffer[3U] = MODE_POCSAG; @@ -1832,7 +1832,7 @@ bool CModem::writePOCSAGInfo(unsigned int ric, const std::string& message) ::memcpy(buffer + 11U, message.c_str(), length); - int ret = m_port->write(buffer, length + 11U); + int ret = m_port->write(buffer, (unsigned int)length + 11U); return ret != int(length + 11U); } @@ -1846,14 +1846,14 @@ bool CModem::writeIPInfo(const std::string& address) unsigned char buffer[25U]; buffer[0U] = MMDVM_FRAME_START; - buffer[1U] = length + 4U; + buffer[1U] = (unsigned char)length + 4U; buffer[2U] = MMDVM_QSO_INFO; buffer[3U] = 250U; ::memcpy(buffer + 4U, address.c_str(), length); - int ret = m_port->write(buffer, length + 4U); + int ret = m_port->write(buffer, (unsigned int)length + 4U); return ret != int(length + 4U); } @@ -2485,7 +2485,7 @@ bool CModem::sendCWId(const std::string& callsign) { assert(m_port != NULL); - unsigned int length = callsign.length(); + unsigned int length = (unsigned int)callsign.length(); if (length > 200U) length = 200U; @@ -2631,7 +2631,7 @@ bool CModem::setFMCallsignParams() assert(m_port != NULL); unsigned char buffer[80U]; - unsigned char len = 10U + m_fmCallsign.size(); + unsigned char len = 10U + (unsigned char)m_fmCallsign.size(); buffer[0U] = MMDVM_FRAME_START; buffer[1U] = len; @@ -2692,7 +2692,7 @@ bool CModem::setFMAckParams() assert(m_port != NULL); unsigned char buffer[80U]; - unsigned char len = 8U + m_fmRfAck.size(); + unsigned char len = 8U + (unsigned char)m_fmRfAck.size(); buffer[0U] = MMDVM_FRAME_START; buffer[1U] = len; @@ -2811,7 +2811,7 @@ bool CModem::setFMExtParams() assert(m_port != NULL); unsigned char buffer[80U]; - unsigned char len = 7U + m_fmExtAck.size(); + unsigned char len = 7U + (unsigned char)m_fmExtAck.size(); buffer[0U] = MMDVM_FRAME_START; buffer[1U] = len; diff --git a/NXDNControl.cpp b/NXDNControl.cpp index 119fad65..d040ca78 100644 --- a/NXDNControl.cpp +++ b/NXDNControl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 Jonathan Naylor, G4KLX + * Copyright (C) 2015-2021 Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -223,7 +223,7 @@ bool CNXDNControl::processVoice(unsigned char usc, unsigned char option, unsigne m_rfLayer3 = layer3; - data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA; + data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; CSync::addNXDNSync(data + 2U); @@ -401,7 +401,7 @@ bool CNXDNControl::processVoice(unsigned char usc, unsigned char option, unsigne // Create a dummy start message unsigned char start[NXDN_FRAME_LENGTH_BYTES + 2U]; - start[0U] = TAG_DATA; + start[0U] = TAG_DATA1; start[1U] = 0x00U; // Generate the sync @@ -539,7 +539,7 @@ bool CNXDNControl::processVoice(unsigned char usc, unsigned char option, unsigne facch12.getRaw(netData + 5U + 14U); } - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; scrambler(data + 2U); @@ -638,12 +638,12 @@ bool CNXDNControl::processData(unsigned char option, unsigned char *data) if (validUDCH) { type = layer3.getMessageType(); - data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA; + data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA1; udch.setRAN(m_ran); udch.encode(data + 2U); } else { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; } @@ -785,7 +785,7 @@ void CNXDNControl::writeNetwork() } if (m_netState == RS_NET_DATA) { - data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA; + data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; CNXDNUDCH udch; @@ -826,7 +826,7 @@ void CNXDNControl::writeNetwork() facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_LENGTH_BITS); facch.encode(data + 2U, NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS + NXDN_SACCH_LENGTH_BITS + NXDN_FACCH1_LENGTH_BITS); - data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA; + data[0U] = type == NXDN_MESSAGE_TYPE_TX_REL ? TAG_EOT : TAG_DATA1; data[1U] = 0x00U; scrambler(data + 2U); @@ -907,7 +907,7 @@ void CNXDNControl::writeNetwork() // Create a dummy start message unsigned char start[NXDN_FRAME_LENGTH_BYTES + 2U]; - start[0U] = TAG_DATA; + start[0U] = TAG_DATA1; start[1U] = 0x00U; // Generate the sync @@ -942,7 +942,7 @@ void CNXDNControl::writeNetwork() m_netFrames++; - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; CNXDNSACCH sacch; diff --git a/P25Control.cpp b/P25Control.cpp index b9825f01..3e382eaf 100644 --- a/P25Control.cpp +++ b/P25Control.cpp @@ -1,5 +1,5 @@ /* -* Copyright (C) 2016-2019 by Jonathan Naylor G4KLX +* Copyright (C) 2016-2019,2021 by Jonathan Naylor G4KLX * Copyright (C) 2018 by Bryan Biedenkapp * * This program is free software; you can redistribute it and/or modify @@ -303,7 +303,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) ::memcpy(m_rfLDU, data + 2U, P25_LDU_FRAME_LENGTH_BYTES); if (m_duplex) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeQueueRF(data, P25_LDU_FRAME_LENGTH_BYTES + 2U); } @@ -349,7 +349,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) ::memcpy(m_rfLDU, data + 2U, P25_LDU_FRAME_LENGTH_BYTES); if (m_duplex) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeQueueRF(data, P25_LDU_FRAME_LENGTH_BYTES + 2U); } @@ -399,7 +399,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) setBusyBits(data + 2U, P25_SS0_START, true, true); if (m_duplex) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeQueueRF(data, P25_TSDU_FRAME_LENGTH_BYTES + 2U); @@ -425,7 +425,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) setBusyBits(data + 2U, P25_SS0_START, true, true); if (m_duplex) { - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeQueueRF(data, P25_TSDU_FRAME_LENGTH_BYTES + 2U); @@ -569,7 +569,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) addBusyBits(pdu + 2U, newBitLength, false, true); if (m_duplex) { - pdu[0U] = TAG_DATA; + pdu[0U] = TAG_DATA1; pdu[1U] = 0x00U; writeQueueRF(pdu, newByteLength + 2U); } @@ -1010,7 +1010,7 @@ void CP25Control::createNetLDU1() unsigned char buffer[P25_LDU_FRAME_LENGTH_BYTES + 2U]; ::memset(buffer, 0x00U, P25_LDU_FRAME_LENGTH_BYTES + 2U); - buffer[0U] = TAG_DATA; + buffer[0U] = TAG_DATA1; buffer[1U] = 0x00U; // Add the sync @@ -1058,7 +1058,7 @@ void CP25Control::createNetLDU2() unsigned char buffer[P25_LDU_FRAME_LENGTH_BYTES + 2U]; ::memset(buffer, 0x00U, P25_LDU_FRAME_LENGTH_BYTES + 2U); - buffer[0U] = TAG_DATA; + buffer[0U] = TAG_DATA1; buffer[1U] = 0x00U; // Add the sync diff --git a/Version.h b/Version.h index 36c3a746..7dbf25da 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20210328"; +const char* VERSION = "20210329"; #endif diff --git a/YSFControl.cpp b/YSFControl.cpp index 88551600..efb2213c 100644 --- a/YSFControl.cpp +++ b/YSFControl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2020 Jonathan Naylor, G4KLX + * Copyright (C) 2015-2021 Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -265,7 +265,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -358,7 +358,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -434,7 +434,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -540,7 +540,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -636,7 +636,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) CYSFPayload payload; payload.writeHeader(buffer + 2U, csd1, csd2); - buffer[0U] = TAG_DATA; + buffer[0U] = TAG_DATA1; buffer[1U] = 0x00U; writeNetwork(buffer, m_rfFrames % 128U); @@ -660,7 +660,7 @@ bool CYSFControl::processDNData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -733,7 +733,7 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -814,7 +814,7 @@ bool CYSFControl::processFRData(bool valid, unsigned char *data) fich.encode(data + 2U); - data[0U] = TAG_DATA; + data[0U] = TAG_DATA1; data[1U] = 0x00U; writeNetwork(data, m_rfFrames % 128U); @@ -949,7 +949,7 @@ void CYSFControl::writeNetwork() return; } - data[33U] = end ? TAG_EOT : TAG_DATA; + data[33U] = end ? TAG_EOT : TAG_DATA1; data[34U] = 0x00U; if (valid) {