|
|
|
|
@ -36,8 +36,9 @@ bool CallSimNetwork::writeDMRCall(const dmr::data::NetData& data, CallStreamStat
|
|
|
|
|
if (message == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const uint16_t sequence = nextSequence(stream, end);
|
|
|
|
|
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_DMR }, message.get(), messageLength,
|
|
|
|
|
nextSequence(stream, end), stream.streamId);
|
|
|
|
|
sequence, stream.streamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Writes a P25 LDU1 using call-specific RTP state. */
|
|
|
|
|
@ -46,13 +47,17 @@ bool CallSimNetwork::writeP25LDU1Call(const p25::lc::LC& control, const p25::dat
|
|
|
|
|
const uint8_t* data, CallStreamState& stream)
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_writeMutex);
|
|
|
|
|
if (stream.streamId == 0U)
|
|
|
|
|
stream.streamId = createStreamId();
|
|
|
|
|
|
|
|
|
|
uint32_t messageLength = 0U;
|
|
|
|
|
UInt8Array message = createP25_LDU1Message(messageLength, control, lsd, data, P25DEF::FrameType::DATA_UNIT, 0U);
|
|
|
|
|
if (message == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const uint16_t sequence = nextSequence(stream, false);
|
|
|
|
|
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength,
|
|
|
|
|
nextSequence(stream, false), stream.streamId);
|
|
|
|
|
sequence, stream.streamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Writes a P25 LDU2 using call-specific RTP state. */
|
|
|
|
|
@ -61,13 +66,17 @@ bool CallSimNetwork::writeP25LDU2Call(const p25::lc::LC& control, const p25::dat
|
|
|
|
|
const uint8_t* data, CallStreamState& stream)
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_writeMutex);
|
|
|
|
|
if (stream.streamId == 0U)
|
|
|
|
|
stream.streamId = createStreamId();
|
|
|
|
|
|
|
|
|
|
uint32_t messageLength = 0U;
|
|
|
|
|
UInt8Array message = createP25_LDU2Message(messageLength, control, lsd, data, 0U);
|
|
|
|
|
if (message == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const uint16_t sequence = nextSequence(stream, false);
|
|
|
|
|
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength,
|
|
|
|
|
nextSequence(stream, false), stream.streamId);
|
|
|
|
|
sequence, stream.streamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Writes a terminating P25 TDU using call-specific RTP state. */
|
|
|
|
|
@ -76,13 +85,17 @@ bool CallSimNetwork::writeP25TDUCall(const p25::lc::LC& control, const p25::data
|
|
|
|
|
CallStreamState& stream)
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_writeMutex);
|
|
|
|
|
if (stream.streamId == 0U)
|
|
|
|
|
stream.streamId = createStreamId();
|
|
|
|
|
|
|
|
|
|
uint32_t messageLength = 0U;
|
|
|
|
|
UInt8Array message = createP25_TDUMessage(messageLength, control, lsd, 0U);
|
|
|
|
|
if (message == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const uint16_t sequence = nextSequence(stream, true);
|
|
|
|
|
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25 }, message.get(), messageLength,
|
|
|
|
|
nextSequence(stream, true), stream.streamId);
|
|
|
|
|
sequence, stream.streamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Writes an NXDN frame using call-specific RTP state. */
|
|
|
|
|
@ -91,13 +104,17 @@ bool CallSimNetwork::writeNXDNCall(const nxdn::lc::RTCH& control, const uint8_t*
|
|
|
|
|
CallStreamState& stream, bool end)
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_writeMutex);
|
|
|
|
|
if (stream.streamId == 0U)
|
|
|
|
|
stream.streamId = createStreamId();
|
|
|
|
|
|
|
|
|
|
uint32_t messageLength = 0U;
|
|
|
|
|
UInt8Array message = createNXDN_Message(messageLength, control, data, length);
|
|
|
|
|
if (message == nullptr)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const uint16_t sequence = nextSequence(stream, end);
|
|
|
|
|
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_NXDN }, message.get(), messageLength,
|
|
|
|
|
nextSequence(stream, end), stream.streamId);
|
|
|
|
|
sequence, stream.streamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Writes a group-call grant request while excluding concurrent frame writers. */
|
|
|
|
|
|