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

Fix repeat frames #24

Closed LandryNorris closed 7 months ago

LandryNorris commented 7 months ago

Frames previously were not properly repeating. This PR should fix that. Tested with the following js program

CanBridge.sendCANMessage(descriptor, 0xCBA321, [0x12, 0x34, 0x56, 0x78], 150)

await new Promise((resolve) => setTimeout(resolve, 2000));

CanBridge.sendCANMessage(descriptor, 0xCBA321, [0x34, 0x56, 0x78, 0x12], 150)

await new Promise((resolve) => setTimeout(resolve, 2000));

CanBridge.sendCANMessage(descriptor, 0xCBA321, [0x34, 0x56, 0x78, 0x12], 100)

await new Promise((resolve) => setTimeout(resolve, 2000));

CanBridge.sendCANMessage(descriptor, 0xCBA321, [0x34, 0x56, 0x78, 0x12], 0)