From 8455eb891e8ef728525b974a19f3cf9c8d3cf3dc Mon Sep 17 00:00:00 2001 From: LandryNorris Date: Wed, 2 Oct 2024 16:30:38 -0500 Subject: [PATCH 1/2] Check non-masked message ID --- .../include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h b/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h index 0415c53..f7c111d 100644 --- a/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h +++ b/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h @@ -176,7 +176,7 @@ class CandleWinUSBDeviceThread :public DriverDeviceThread { uint32_t messageId = el.m_msg.GetMessageId() & NON_RESERVED_ARB_ID_MASK; bool isExtended = true; // FRC CAN is always extended - bool isRtr = messageId & HAL_CAN_IS_FRAME_REMOTE; + bool isRtr = el.m_msg.GetMessageId() & HAL_CAN_IS_FRAME_REMOTE; frame.can_id = messageId; if(isExtended) { From dbfe43a075d5f9f378cfe7ec384f1b5b1132b854 Mon Sep 17 00:00:00 2001 From: LandryNorris Date: Wed, 2 Oct 2024 16:33:40 -0500 Subject: [PATCH 2/2] Move messageId later to avoid this happening again --- .../rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h b/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h index f7c111d..7499db6 100644 --- a/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h +++ b/src/main/native/include/rev/Drivers/CandleWinUSB/CandleWinUSBDeviceThread.h @@ -173,11 +173,11 @@ class CandleWinUSBDeviceThread :public DriverDeviceThread { candle_frame_t frame; frame.can_dlc = el.m_msg.GetSize(); - uint32_t messageId = el.m_msg.GetMessageId() & NON_RESERVED_ARB_ID_MASK; - bool isExtended = true; // FRC CAN is always extended bool isRtr = el.m_msg.GetMessageId() & HAL_CAN_IS_FRAME_REMOTE; + uint32_t messageId = el.m_msg.GetMessageId() & NON_RESERVED_ARB_ID_MASK; + frame.can_id = messageId; if(isExtended) { frame.can_id |= CANDLE_EXTENDED_ID_MASK;