@@ -42,8 +42,8 @@ pub trait Frame: Sized {
42
42
fn data ( & self ) -> & [ u8 ] ;
43
43
}
44
44
45
- /// A CAN interface that is able to transmit frames.
46
- pub trait Transmitter {
45
+ /// A CAN interface that is able to transmit and receive frames.
46
+ pub trait Can {
47
47
/// Associated frame type.
48
48
type Frame : Frame ;
49
49
@@ -54,16 +54,8 @@ pub trait Transmitter {
54
54
///
55
55
/// If the buffer is full, this function will try to replace a lower priority frame
56
56
/// and return it. This is to avoid the priority inversion problem.
57
+ /// Transmits frames of equal identifier in FIFO fashion.
57
58
fn transmit ( & mut self , frame : & Self :: Frame ) -> nb:: Result < Option < Self :: Frame > , Self :: Error > ;
58
- }
59
-
60
- /// A CAN interface that is able to receive frames.
61
- pub trait Receiver {
62
- /// Associated frame type.
63
- type Frame : Frame ;
64
-
65
- /// Associated error type.
66
- type Error ;
67
59
68
60
/// Returns a received frame if available.
69
61
fn receive ( & mut self ) -> nb:: Result < Self :: Frame , Self :: Error > ;
@@ -163,8 +155,8 @@ pub trait Filter {
163
155
fn remote_only ( & mut self ) -> & mut Self ;
164
156
}
165
157
166
- /// A CAN interface that is able to receive frames and specify filters.
167
- pub trait FilteredReceiver : Receiver {
158
+ /// A CAN interface that is able to specify receive filters.
159
+ pub trait FilteredReceiver : Can {
168
160
/// Associated filter type.
169
161
type Filter : Filter ;
170
162
0 commit comments