send a return ACK on reception of a Start of Stream;

pull/86/head
Bryan Biedenkapp 11 months ago
parent de02fdd445
commit db5a2310a4

@ -85,6 +85,8 @@ namespace p25
START_OF_STREAM = 9, //! Start of Stream START_OF_STREAM = 9, //! Start of Stream
END_OF_STREAM = 10, //! End of Stream END_OF_STREAM = 10, //! End of Stream
START_OF_STREAM_ACK = 14, //! Start of Stream Ack
UNDEFINED = 127 //! Undefined UNDEFINED = 127 //! Undefined
}; };
} }

@ -1140,6 +1140,10 @@ void ModemV24::convertToAirTIA(const uint8_t *data, uint32_t length)
// bryanb: maybe compare the NACs? // bryanb: maybe compare the NACs?
dataOffs += StartOfStream::LENGTH; dataOffs += StartOfStream::LENGTH;
// ack start of stream
// bryanb: is this really the right place to be doing this...
ackStartOfStreamTIA();
} }
break; break;
case BlockType::END_OF_STREAM: case BlockType::END_OF_STREAM:
@ -1895,6 +1899,32 @@ void ModemV24::endOfStreamTIA()
m_txCallInProgress = false; m_txCallInProgress = false;
} }
/* Send a start of stream ACK. */
void ModemV24::ackStartOfStreamTIA()
{
uint16_t length = 0U;
uint8_t buffer[P25_HDU_LENGTH_BYTES];
::memset(buffer, 0x00U, P25_HDU_LENGTH_BYTES);
// generate control octet
ControlOctet ctrl = ControlOctet();
ctrl.setBlockHeaderCnt(1U);
ctrl.encode(buffer);
length += ControlOctet::LENGTH;
// generate block header
BlockHeader hdr = BlockHeader();
hdr.setBlockType(BlockType::START_OF_STREAM_ACK);
hdr.encode(buffer + 1U);
length += BlockHeader::LENGTH;
if (m_trace)
Utils::dump(1U, "ModemV24::ackStartOfStreamTIA() Ack StartOfStream", buffer, length);
queueP25Frame(buffer, length, STT_NON_IMBE);
}
/* Internal helper to convert from TIA-102 air interface to V.24/DFSI. */ /* Internal helper to convert from TIA-102 air interface to V.24/DFSI. */
void ModemV24::convertFromAir(uint8_t* data, uint32_t length) void ModemV24::convertFromAir(uint8_t* data, uint32_t length)

@ -391,6 +391,10 @@ namespace modem
* @brief Send an end of stream sequence (TDU, etc) to the connected UDP TIA-102 device. * @brief Send an end of stream sequence (TDU, etc) to the connected UDP TIA-102 device.
*/ */
void endOfStreamTIA(); void endOfStreamTIA();
/**
* @brief Send a start of stream ACK.
*/
void ackStartOfStreamTIA();
/** /**
* @brief Internal helper to convert from TIA-102 air interface to V.24/DFSI. * @brief Internal helper to convert from TIA-102 air interface to V.24/DFSI.

Loading…
Cancel
Save

Powered by TurnKey Linux.