1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Minimal abstraction for an asynchronous CAN bus. Allows the library to plug
//! into various implementations (embedded HAL, desktop driver, etc.).
use crateCanFrame;
/// Contract to send and receive CAN frames asynchronously.
///
/// # Errors are terminal
///
/// **Any `Err` returned by [`CanBus::send`] or [`CanBus::recv`] stops
/// `AddressRunner` for good.** It surfaces as `AddressSupervisorRunError` and
/// `drive()` returns; nothing restarts it, and the node keeps no address.
///
/// The driver must therefore absorb what it can recover from: arbitration loss,
/// a full TX mailbox, a bus-off recovery cycle. Return an error only for a
/// condition the caller has to act on, such as a closed socket or a dead
/// peripheral.
///
/// The library deliberately does not retry. It cannot tell a transient failure
/// from a permanent one through an opaque `Error`, and a blind retry loop on a
/// dead bus is worse than stopping.