File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
//! Async CAN API
2
2
3
- /// An async CAN interface that is able to transmit and receive frames.
4
- pub trait Can {
3
+ /// An async CAN interface that is able to transmit frames.
4
+ pub trait CanTx {
5
5
/// Associated frame type.
6
6
type Frame : crate :: Frame ;
7
7
8
8
/// Associated error type.
9
9
type Error : crate :: Error ;
10
10
11
- /// Puts a frame in the transmit buffer.
12
- /// Awaits until space is available in the transmit buffer.
11
+ /// Puts a frame in the transmit buffer or awaits until space is available
12
+ /// in the transmit buffer.
13
13
async fn transmit ( & mut self , frame : & Self :: Frame ) -> Result < ( ) , Self :: Error > ;
14
+ }
15
+
16
+ /// An async CAN interface that is able to receive frames.
17
+ pub trait CanRx {
18
+ /// Associated frame type.
19
+ type Frame : crate :: Frame ;
20
+
21
+ /// Associated error type.
22
+ type Error : crate :: Error ;
14
23
15
- /// Awaits until a frame was received or an error occurred .
24
+ /// Awaits until a frame was received or an error occurs .
16
25
async fn receive ( & mut self ) -> Result < Self :: Frame , Self :: Error > ;
17
26
}
You can’t perform that action at this time.
0 commit comments