Skip to content

Commit

Permalink
Mask out reserved bits when giving ID to candlelib
Browse files Browse the repository at this point in the history
  • Loading branch information
LandryNorris committed Sep 19, 2024
1 parent 07998fa commit 273bc50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/native/include/rev/CANMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#define EXTENDED_ID_MASK 0x40000000
#define REMOTE_FRAME_MASK 0x80000000
#define NON_RESERVED_ARB_ID_MASK 0x1FFFFFFF

namespace rev {
namespace usb {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CandleWinUSBDeviceThread :public DriverDeviceThread {
candle_frame_t frame;
frame.can_dlc = el.m_msg.GetSize();

uint32_t messageId = el.m_msg.GetMessageId();
uint32_t messageId = el.m_msg.GetMessageId() & NON_RESERVED_ARB_ID_MASK;

bool isExtended = true; // FRC CAN is always extended
bool isRtr = messageId & REMOTE_FRAME_MASK;
Expand Down

0 comments on commit 273bc50

Please sign in to comment.