File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
//! Controller Area Network
2
2
3
3
/// A CAN2.0 Frame
4
- pub trait Frame {
5
- /// Creates a new frame with a standard identifier.
6
- fn new_standard ( id : u32 , data : & [ u8 ] ) -> Self ;
7
-
8
- /// Creates a new frame with an extended identifier.
9
- fn new_extended ( id : u32 , data : & [ u8 ] ) -> Self ;
4
+ pub trait Frame : Sized {
5
+ /// Creates a new frame with a standard identifier (0..=0x7FF).
6
+ /// Returns an error when the the identifier is not valid.
7
+ fn new_standard ( id : u16 , data : & [ u8 ] ) -> Result < Self , ( ) > ;
8
+
9
+ /// Creates a new frame with an extended identifier (0..=0x1FFF_FFFF).
10
+ /// Returns an error when the the identifier is not valid.
11
+ fn new_extended ( id : u32 , data : & [ u8 ] ) -> Result < Self , ( ) > ;
10
12
11
13
/// Marks this frame as a remote frame (by setting the RTR bit).
12
14
fn with_rtr ( & mut self , dlc : usize ) -> & mut Self ;
You can’t perform that action at this time.
0 commit comments