REVrobotics / CANBridge

Generic CAN Bridge emulating FRC netcomm CAN driver for connecting a PC to the CAN Bus with WPILib 2020+ and SPARK MAX (FW 1.5.0 or higher) or other drivers, currently only supported in Windows.
Other
11 stars 5 forks source link

Make ReceiveMessage behave like netcomm for HAL interface purposes #4

Closed ThadHouse closed 4 years ago

ThadHouse commented 5 years ago

This is based off of #3

When calling ReceiveMessage in netcomm, if it has a message, it returns it, and then removes it from its internal store. This means a 2nd call for the same message will return MessageNotFound if a new one hasn't shown up yet. This is how the ReceivePacketNew call in the CAN API works, as all it does is return a packet if netcomm returns one (It also sets the packet in the internal message store so later calls to Latest and Timeout work property). This changes so messages can be marked invalid, and messages returned will only return valid packets.