mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
Merge pull request #1891 from srcejon/fix_1826
Reverse byte ordering of CRC in packet mode in M17 modem
This commit is contained in:
commit
c7eca5e92e
@ -309,8 +309,8 @@ public:
|
|||||||
if (last_packet)
|
if (last_packet)
|
||||||
{
|
{
|
||||||
packet_assembly[25] = 0x80 | ((packet_size+2)<<2); // sent packet size includes CRC
|
packet_assembly[25] = 0x80 | ((packet_size+2)<<2); // sent packet size includes CRC
|
||||||
packet_assembly[packet_size] = crc_.get_bytes()[1];
|
packet_assembly[packet_size] = crc_.get_bytes()[0];
|
||||||
packet_assembly[packet_size+1] = crc_.get_bytes()[0];
|
packet_assembly[packet_size+1] = crc_.get_bytes()[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -328,7 +328,7 @@ bool M17DemodProcessor::decode_packet(modemm17::M17FrameDecoder::packet_buffer_t
|
|||||||
crc16(*it);
|
crc16(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t calcChecksum = crc16.get_bytes()[0] + (crc16.get_bytes()[1]<<8);
|
uint16_t calcChecksum = crc16.get_bytes()[1] + (crc16.get_bytes()[0]<<8);
|
||||||
uint16_t xmitChecksum = m_currentPacket.back() + (m_currentPacket.end()[-2]<<8);
|
uint16_t xmitChecksum = m_currentPacket.back() + (m_currentPacket.end()[-2]<<8);
|
||||||
|
|
||||||
if (calcChecksum == xmitChecksum) // (checksum == 0x0f47)
|
if (calcChecksum == xmitChecksum) // (checksum == 0x0f47)
|
||||||
|
Loading…
Reference in New Issue
Block a user