c-open icon indicating copy to clipboard operation
c-open copied to clipboard

Event-based communication error handling

Open nattgris opened this issue 5 years ago • 0 comments
trafficstars

Currently, communication errors are polled for in the CO_JOB_PERIODIC context by calling co_emcy_handle_can_state(). To avoid the need for periodic polling (see #6), the drivers could send events on errors, just like RX is handled.

For embedded controllers they most likely provide the ability to interrupt on error flags.

SocketCAN on linux can be told to send error events through the regular RX path, see https://www.kernel.org/doc/html/latest/networking/can.html#raw-socket-option-can-raw-err-filter for details.

If some platform doesn't support it, there's always the option to fall back to a separate polling thread.

nattgris avatar Feb 13 '20 09:02 nattgris