From 3b3d2881bf96a43a373881777b3e2e8dbe4365cd Mon Sep 17 00:00:00 2001 From: Andy CA6JAU Date: Sun, 29 Jul 2018 19:00:47 -0400 Subject: [PATCH] Fix for process long Wires-X commands --- YSFGateway/WiresX.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/YSFGateway/WiresX.cpp b/YSFGateway/WiresX.cpp index b7d9380..1489d2f 100644 --- a/YSFGateway/WiresX.cpp +++ b/YSFGateway/WiresX.cpp @@ -200,11 +200,11 @@ WX_STATUS CWiresX::process(const unsigned char* data, const unsigned char* sourc if (!valid) return WXS_NONE; } 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) 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) return WXS_NONE; } @@ -213,7 +213,7 @@ WX_STATUS CWiresX::process(const unsigned char* data, const unsigned char* sourc bool valid = false; // 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) { unsigned char crc = CCRC::addCRC(m_command, i + 1U); if (crc == m_command[i + 1U])