Fix end of transmission markers in the NXDN protocol.

This commit is contained in:
Jonathan Naylor 2018-03-15 18:58:43 +00:00
parent 50d109aefe
commit 6db1672ff7
3 changed files with 6 additions and 6 deletions

View File

@ -67,8 +67,8 @@ bool CNXDNNetwork::writeData(const unsigned char* data, unsigned int length, uns
buffer[9U] |= grp ? 0x01U : 0x00U;
if (data[0U] == 0x81U || data[0U] == 0x83U) {
buffer[9U] |= buffer[5U] == 0x01U ? 0x04U : 0x00U;
buffer[9U] |= buffer[5U] == 0x08U ? 0x08U : 0x00U;
buffer[9U] |= data[5U] == 0x01U ? 0x04U : 0x00U;
buffer[9U] |= data[5U] == 0x08U ? 0x08U : 0x00U;
}
::memcpy(buffer + 10U, data, 33U);

View File

@ -85,7 +85,7 @@ void CNXDNParrot::run()
parrot.write(buffer, len);
watchdogTimer.start();
if ((buffer[9U] & 0x04U) == 0x04U) {
if ((buffer[9U] & 0x08U) == 0x08U) {
::fprintf(stdout, "Received end of transmission\n");
turnaroundTimer.start();
watchdogTimer.stop();

View File

@ -263,7 +263,7 @@ void CNXDNReflector::run()
nxCoreNetwork->write(buffer, len);
}
if ((buffer[9U] & 0x04U) == 0x04U) {
if ((buffer[9U] & 0x08U) == 0x08U) {
LogMessage("Received end of transmission");
watchdogTimer.stop();
current = NULL;