pull/28/merge
pyopower 2 weeks ago committed by GitHub
commit d18c3c50d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -102,6 +102,17 @@ void CNXDNProtocol::Task(void)
OnDvFramePacketIn(Frames[1], &Ip);
OnDvFramePacketIn(Frames[2], &Ip);
OnDvFramePacketIn(Frames[3], &Ip);
// end of transmission flagged in byte 9 (bit 0x08), as sent by
// NXDNGateway/MMDVMHost: close the stream with a last packet so the
// other protocols send their terminator instead of timing out
if ( (Buffer.data()[9U] & 0x08U) && (m_uiStreamId != 0) )
{
uint8_t ambe[9];
memset(ambe, 0x00, sizeof(ambe));
auto last = std::unique_ptr<CDvFramePacket>(new CDvFramePacket(ambe, m_uiStreamId, 0, true));
OnDvFramePacketIn(last, &Ip);
m_uiStreamId = 0;
}
}
else if ( IsValidDvHeaderPacket(Ip, Buffer, Header) )
{
@ -114,6 +125,13 @@ void CNXDNProtocol::Task(void)
}
else if ( IsValidDvLastFramePacket(Ip, Buffer) )
{
if ( m_uiStreamId != 0 )
{
uint8_t ambe[9];
memset(ambe, 0x00, sizeof(ambe));
auto last = std::unique_ptr<CDvFramePacket>(new CDvFramePacket(ambe, m_uiStreamId, 0, true));
OnDvFramePacketIn(last, &Ip);
}
m_uiStreamId = 0;
}
else if ( IsValidConnectPacket(Buffer, &Callsign) )

@ -352,14 +352,17 @@ bool CP25Protocol::IsValidDvPacket(const CIp &Ip, const CBuffer &Buffer, std::un
offset = 4U;
break;
case 0x80U:
// terminator: reset the stream id AFTER building the last packet,
// otherwise it gets id 0, is dropped as orphaned and the stream times out
last = true;
m_uiStreamId = 0;
break;
default:
break;
}
frame = std::unique_ptr<CDvFramePacket>(new CDvFramePacket(&(Buffer.data()[offset]), m_uiStreamId, last));
if ( last )
m_uiStreamId = 0;
return true;
}
return false;

Loading…
Cancel
Save

Powered by TurnKey Linux.