embedded-hal icon indicating copy to clipboard operation
embedded-hal copied to clipboard

It's not clear when `can::ErrorKind::Acknowledge` should be returned

Open jonas-schievink opened this issue 3 years ago • 3 comments
trafficstars

Its docs say "An ACK error shall be detected by a transmitter whenever it does not monitor a dominant bit during the ACK slot.", but Can::transmit only enqueues a frame for transmission, so it's impossible to detect this condition for the frame passed there. Can::transmit could check if any previous frame caused an ACK error and return an error, but then its return value indicates whether a different frame was transmitted successfully.

jonas-schievink avatar May 25 '22 13:05 jonas-schievink

cc: @timokroeger

eldruin avatar Jun 06 '22 08:06 eldruin

I fully agree with jonas here. The error kinds were chosen to map to the error conditions defined by the CAN spec (same wording in the doc strings as the description in the spec). For our transmit() interface returning an ACK error does not make sense as those should be handled internally by the controller.

timokroeger avatar Jun 06 '22 08:06 timokroeger

We discussed in the WG meeting that we could keep the variant but improve its documentation. Any change suggestions?

eldruin avatar Jul 05 '22 07:07 eldruin