File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 3
3
/// A blocking CAN interface that is able to transmit and receive frames.
4
4
pub trait Can {
5
5
/// Associated frame type.
6
- type Frame : crate :: can :: Frame ;
6
+ type Frame : crate :: Frame ;
7
7
8
8
/// Associated error type.
9
9
type Error ;
10
10
11
11
/// Puts a frame in the transmit buffer. Blocks until space is available in
12
12
/// the transmit buffer.
13
- fn try_transmit ( & mut self , frame : & Self :: Frame ) -> Result < ( ) , Self :: Error > ;
13
+ fn try_write ( & mut self , frame : & Self :: Frame ) -> Result < ( ) , Self :: Error > ;
14
14
15
15
/// Blocks until a frame was received or an error occured.
16
- fn try_receive ( & mut self ) -> Result < Self :: Frame , Self :: Error > ;
16
+ fn try_read ( & mut self ) -> Result < Self :: Frame , Self :: Error > ;
17
17
}
18
18
19
19
/// Default implementation of `blocking::can::Can` for implementers of `can::Can`
26
26
type Frame = S :: Frame ;
27
27
type Error = S :: Error ;
28
28
29
- fn try_transmit ( & mut self , frame : & Self :: Frame ) -> Result < ( ) , Self :: Error > {
29
+ fn try_write ( & mut self , frame : & Self :: Frame ) -> Result < ( ) , Self :: Error > {
30
30
let mut replaced_frame;
31
31
let mut frame_to_transmit = frame;
32
32
while let Some ( f) = nb:: block!( self . try_transmit( & frame_to_transmit) ) ? {
36
36
Ok ( ( ) )
37
37
}
38
38
39
- fn try_receive ( & mut self ) -> Result < Self :: Frame , Self :: Error > {
39
+ fn try_read ( & mut self ) -> Result < Self :: Frame , Self :: Error > {
40
40
nb:: block!( self . try_receive( ) )
41
41
}
42
42
}
You can’t perform that action at this time.
0 commit comments