From 771aba25571b999538108183d1e493e1dc3d36bf Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Sat, 20 Jan 2024 22:03:24 +0000 Subject: [PATCH] Update the P25 symbols bits to be the correct values. --- P25Control.cpp | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/P25Control.cpp b/P25Control.cpp index 43383d2..a75d7aa 100644 --- a/P25Control.cpp +++ b/P25Control.cpp @@ -293,7 +293,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) m_rfFrames++; m_lastDUID = duid; - // Add busy bits + // Add busy bits, inbound busy addBusyBits(data + 2U, P25_LDU_FRAME_LENGTH_BITS, false, true); #if defined(DUMP_P25) @@ -339,7 +339,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) m_rfFrames++; m_lastDUID = duid; - // Add busy bits + // Add busy bits, inbound busy addBusyBits(data + 2U, P25_LDU_FRAME_LENGTH_BITS, false, true); #if defined(DUMP_P25) @@ -392,8 +392,8 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) // Regenerate TDULC Data m_rfData.encodeTSDU(data + 2U); - // Add busy bits - addBusyBits(data + 2U, P25_TSDU_FRAME_LENGTH_BITS, true, false); + // Add busy bits, inbound busy + addBusyBits(data + 2U, P25_TSDU_FRAME_LENGTH_BITS, false, true); // Set first busy bits to 1,1 setBusyBits(data + 2U, P25_SS0_START, true, true); @@ -418,8 +418,8 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) // Regenerate TDULC Data m_rfData.encodeTSDU(data + 2U); - // Add busy bits - addBusyBits(data + 2U, P25_TSDU_FRAME_LENGTH_BITS, true, false); + // Add busy bits, inbound busy + addBusyBits(data + 2U, P25_TSDU_FRAME_LENGTH_BITS, false, true); // Set first busy bits to 1,1 setBusyBits(data + 2U, P25_SS0_START, true, true); @@ -450,7 +450,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) // Regenerate NID m_nid.encode(data + 2U, P25_DUID_TERM); - // Add busy bits + // Add busy bits, inbound busy addBusyBits(data + 2U, P25_TERM_FRAME_LENGTH_BITS, false, true); bool grp = m_rfData.getLCF() == P25_LCF_GROUP; @@ -565,7 +565,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len) // Regenerate NID m_nid.encode(pdu + 2U, P25_DUID_PDU); - // Add busy bits + // Add busy bits, inbound busy addBusyBits(pdu + 2U, newBitLength, false, true); if (m_duplex) { @@ -922,7 +922,7 @@ void CP25Control::createRFHeader() // Add the dummy header m_rfData.encodeHeader(buffer + 2U); - // Add busy bits + // Add busy bits, inbound busy addBusyBits(buffer + 2U, P25_HDR_FRAME_LENGTH_BITS, false, true); m_rfFrames = 0U; @@ -996,9 +996,11 @@ void CP25Control::createNetHeader() // Add busy bits if (m_remoteGateway) - addBusyBits(buffer + 2U, P25_HDR_FRAME_LENGTH_BITS, false, false); + // Add busy bits, inbound/outbound + addBusyBits(buffer + 2U, P25_HDR_FRAME_LENGTH_BITS, true, false); else - addBusyBits(buffer + 2U, P25_HDR_FRAME_LENGTH_BITS, false, true); + // Add busy bits, inbound idle + addBusyBits(buffer + 2U, P25_HDR_FRAME_LENGTH_BITS, true, true); writeQueueNet(buffer, P25_HDR_FRAME_LENGTH_BYTES + 2U); } @@ -1040,9 +1042,11 @@ void CP25Control::createNetLDU1() // Add busy bits if (m_remoteGateway) - addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, false, false); + // Add busy bits, inbound/outbound + addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, true, false); else - addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, false, true); + // Add busy bits, inbound idle + addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, true, true); writeQueueNet(buffer, P25_LDU_FRAME_LENGTH_BYTES + 2U); @@ -1088,9 +1092,11 @@ void CP25Control::createNetLDU2() // Add busy bits if (m_remoteGateway) - addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, false, false); + // Add busy bits, inbound/outbound + addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, true, false); else - addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, false, true); + // Add busy bits, inbound idle + addBusyBits(buffer + 2U, P25_LDU_FRAME_LENGTH_BITS, true, true); writeQueueNet(buffer, P25_LDU_FRAME_LENGTH_BYTES + 2U); @@ -1115,9 +1121,11 @@ void CP25Control::createNetTerminator() // Add busy bits if (m_remoteGateway) - addBusyBits(buffer + 2U, P25_TERM_FRAME_LENGTH_BITS, false, false); + // Add busy bits, inbound/outbound + addBusyBits(buffer + 2U, P25_TERM_FRAME_LENGTH_BITS, true, false); else - addBusyBits(buffer + 2U, P25_TERM_FRAME_LENGTH_BITS, false, true); + // Add busy bits, inbound idle + addBusyBits(buffer + 2U, P25_TERM_FRAME_LENGTH_BITS, true, true); writeQueueNet(buffer, P25_TERM_FRAME_LENGTH_BYTES + 2U);