1
0
Fork 0

Fix for process long Wires-X commands

ycs232-kbc
Andy CA6JAU 6 years ago
parent 1c91d981f4
commit 3b3d2881bf

@ -200,11 +200,11 @@ WX_STATUS CWiresX::process(const unsigned char* data, const unsigned char* sourc
if (!valid) if (!valid)
return WXS_NONE; return WXS_NONE;
} else { } else {
bool valid = payload.readDataFRModeData1(data, m_command + (fn - 1U) * 20U + 0U); bool valid = payload.readDataFRModeData1(data, m_command + (fn - 2U) * 40U + 20U);
if (!valid) if (!valid)
return WXS_NONE; return WXS_NONE;
valid = payload.readDataFRModeData2(data, m_command + (fn - 1U) * 20U + 20U); valid = payload.readDataFRModeData2(data, m_command + (fn - 2U) * 40U + 40U);
if (!valid) if (!valid)
return WXS_NONE; return WXS_NONE;
} }
@ -213,7 +213,7 @@ WX_STATUS CWiresX::process(const unsigned char* data, const unsigned char* sourc
bool valid = false; bool valid = false;
// Find the end marker // Find the end marker
for (unsigned int i = fn * 20U; i > 0U; i--) { for (unsigned int i = (fn - 1U) * 40U + 20U; i > 0U; i--) {
if (m_command[i] == 0x03U) { if (m_command[i] == 0x03U) {
unsigned char crc = CCRC::addCRC(m_command, i + 1U); unsigned char crc = CCRC::addCRC(m_command, i + 1U);
if (crc == m_command[i + 1U]) if (crc == m_command[i + 1U])

Loading…
Cancel
Save