diff --git a/DGIdGateway/IMRSNetwork.cpp b/DGIdGateway/IMRSNetwork.cpp index e1bac60..672c278 100644 --- a/DGIdGateway/IMRSNetwork.cpp +++ b/DGIdGateway/IMRSNetwork.cpp @@ -124,9 +124,9 @@ bool CIMRSNetwork::writeHeaderTrailer(IMRSDGId* ptr, CYSFFICH& fich, const unsig buffer[0U] = 0x33U; } - // Copy the sequence number (2 bytes) - buffer[1U] = (ptr->m_seqNo << 8) & 0xFFU; - buffer[2U] = (ptr->m_seqNo << 0) & 0xFFU; + // Copy the sequence number LE (2 bytes) + buffer[1U] = (ptr->m_seqNo << 0) & 0xFFU; + buffer[2U] = (ptr->m_seqNo << 8) & 0xFFU; // Copy CSD1 and CSD2 (40 bytes) CYSFPayload payload; @@ -166,9 +166,9 @@ bool CIMRSNetwork::writeData(IMRSDGId* ptr, CYSFFICH& fich, const unsigned char* buffer[0U] = 0x22U; - // Copy the sequence number (2 bytes) - buffer[1U] = (ptr->m_seqNo << 8) & 0xFFU; - buffer[2U] = (ptr->m_seqNo << 0) & 0xFFU; + // Copy the sequence number LE (2 bytes) + buffer[1U] = (ptr->m_seqNo << 0) & 0xFFU; + buffer[2U] = (ptr->m_seqNo << 8) & 0xFFU; unsigned char dt = fich.getDT(); unsigned char ft = fich.getFT(); @@ -272,7 +272,7 @@ void CIMRSNetwork::readHeaderTrailer(IMRSDGId* ptr, CYSFFICH& fich, const unsign buffer[34U] = 0x00U; } else { - uint16_t seqNo = (data[1U] << 8) + (data[2U] << 0); + uint16_t seqNo = (data[1U] << 0) + (data[2U] << 8); buffer[34U] = 0x01U | ((seqNo & 0x7FU) << 1); } @@ -309,7 +309,7 @@ void CIMRSNetwork::readData(IMRSDGId* ptr, CYSFFICH& fich, const unsigned char* ::memcpy(buffer + 14U, ptr->m_source, YSF_CALLSIGN_LENGTH); ::memcpy(buffer + 24U, ptr->m_dest, YSF_CALLSIGN_LENGTH); - uint16_t seqNo = (data[1U] << 8) + (data[2U] << 0); + uint16_t seqNo = (data[1U] << 0) + (data[2U] << 8); buffer[34U] = (seqNo & 0x7FU) << 1; ::memcpy(buffer + 35U, YSF_SYNC_BYTES, YSF_SYNC_LENGTH_BYTES); diff --git a/DGIdGateway/Version.h b/DGIdGateway/Version.h index 04ee492..62f73da 100644 --- a/DGIdGateway/Version.h +++ b/DGIdGateway/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20200928"; +const char* VERSION = "20200929"; #endif