It is done for my robot but can be used everywhere else.
Using a system of descriptors, you can easily:
- send data to the bus periodically
- automatically store data with specific IDs
- send data in response to the RTR request frame
The developer should specify Store, Response, and Transmit (with a period in ms) descriptors and the library will do the rest.
(See the examples: https://github.com/an-dr/zklib_espidf_canbus/blob/4d035b858cc110205f38b9929921d9b5e17ceaf2/examples/node_second/main/main.cpp?fbclid=IwAR1EUVprCHFiITDI6DBwHrnfDYgci81jCXmbXv-WSzSBdhhNuxY-8lDkLOQ#L35-L64)
The only missing and important thing is a mechanism to check which device is online. It will be implemented soon:
As always, any contribution is welcome. See the opened issues (https://github.com/an-dr/zklib_espidf_canbus/issues) or create a new one.
Join the group on Facebook! https://www.facebook.com/groups/zakhar