This is a basic implementation of loopback transfers and frames for Cyphal/CAN.
The timestamp of a loopback frame is taken from the now timestamp passed to the driver's transmit function. That may or may not be accurate enough for time synchronization.
To receive a loopback transfer, the node needs to have a corresponding subscription. That means that it will also receive transfers on the same port from all other nodes. Sometimes we don't want that. In the future, there should be a way to subscribe to loopback transfers only.
This includes one test that uses message transfers (not requests) and tests the node and CAN transport code.
With recent changes, the bxcan driver now has access to the clock and calls clock.now() for every frame, so the timestamps of the loopback frames can be more accurate.
This is a basic implementation of loopback transfers and frames for Cyphal/CAN.
The timestamp of a loopback frame is taken from the
now
timestamp passed to the driver's transmit function. That may or may not be accurate enough for time synchronization.To receive a loopback transfer, the node needs to have a corresponding subscription. That means that it will also receive transfers on the same port from all other nodes. Sometimes we don't want that. In the future, there should be a way to subscribe to loopback transfers only.
This includes one test that uses message transfers (not requests) and tests the node and CAN transport code.
Closes #11