From 110824e73b4addf64db11b2ba9428529d0b6a7a9 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Fri, 21 Mar 2025 11:50:47 -0400 Subject: [PATCH] fix implementation for acking Start of Stream (writeImmediate wasn't really necessary using STT_NON_IMBE_NO_JITTER causes queued packets to bypass jitter buffer timing); --- src/host/modem/ModemV24.cpp | 35 ++++++++++------------------------- src/host/modem/ModemV24.h | 8 -------- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/host/modem/ModemV24.cpp b/src/host/modem/ModemV24.cpp index 2818c8f9..f8d6e338 100644 --- a/src/host/modem/ModemV24.cpp +++ b/src/host/modem/ModemV24.cpp @@ -1178,6 +1178,15 @@ void ModemV24::convertToAirTIA(const uint8_t *data, uint32_t length) } break; + case BlockType::START_OF_STREAM_ACK: + { + if (m_debug) + ::LogDebugEx(LOG_MODEM, "ModemV24::convertToAirTIA()", "Start of Stream ACK"); + + // do nothing with the start of stream ack + } + break; + case BlockType::VOICE_HEADER_P1: { // copy to call data VHDR1 @@ -1942,7 +1951,7 @@ void ModemV24::ackStartOfStreamTIA() if (m_trace) Utils::dump(1U, "ModemV24::ackStartOfStreamTIA() Ack StartOfStream", buffer, length); - writeImmediate(buffer, length); + queueP25Frame(buffer, length, STT_NON_IMBE_NO_JITTER); } /* Internal helper to convert from TIA-102 air interface to V.24/DFSI. */ @@ -2570,27 +2579,3 @@ void ModemV24::convertFromAirTIA(uint8_t* data, uint32_t length) } } } - -/* Writes raw data to the air interface modem. */ - -int ModemV24::writeImmediate(const uint8_t* data, uint32_t length) -{ - assert(data != nullptr); - - // add the DVM start byte, length byte, CMD byte, and padding 0 - uint8_t header[4U]; - header[0U] = DVM_SHORT_FRAME_START; - header[1U] = length & 0xFFU; - header[2U] = CMD_P25_DATA; - header[3U] = 0x00U; - - // get the actual data - UInt8Array __buffer = std::make_unique(length + 4U); - uint8_t* buffer = __buffer.get(); - - ::memset(buffer, 0x00U, length + 4U); - ::memcpy(buffer, header, 4U); - ::memcpy(buffer + 4U, data, length); - - return m_port->write(data, length); -} diff --git a/src/host/modem/ModemV24.h b/src/host/modem/ModemV24.h index 04f93aab..f4069f91 100644 --- a/src/host/modem/ModemV24.h +++ b/src/host/modem/ModemV24.h @@ -408,14 +408,6 @@ namespace modem * @param length Length of buffer. */ void convertFromAirTIA(uint8_t* data, uint32_t length); - - /** - * @brief Writes raw data to the air interface modem (with no jitter delay). - * @param data Data to write to modem. - * @param length Length of data to write. - * @returns int Actual length of data written. - */ - int writeImmediate(const uint8_t* data, uint32_t length); }; } // namespace modem