The current embedded-hal CAN trait seems to only support 'transmit' and 'receive', but commonly higher level applications will need support at least:
- Opening and closing the node
- Setting the baudrate
Additionally, it can be useful to have support for:
- Reading the bus state flags
- Putting the device into listen-only mode
For instance, consider the options supported by the linux can-utils slcand daemon: https://github.com/linux-can/can-utils/blob/master/slcand.c
I think that it would be reasonable to have some CanState trait, that supports open/close, alongside a CanSpeed trait that allows setting (+getting?) the device baudrate -- but I would be interested to hear other opinions/comments.
The current embedded-hal CAN trait seems to only support 'transmit' and 'receive', but commonly higher level applications will need support at least:
Additionally, it can be useful to have support for:
For instance, consider the options supported by the linux can-utils slcand daemon: https://github.com/linux-can/can-utils/blob/master/slcand.c
I think that it would be reasonable to have some
CanStatetrait, that supports open/close, alongside aCanSpeedtrait that allows setting (+getting?) the device baudrate -- but I would be interested to hear other opinions/comments.