File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
10
10
- Added ` core::error::Error ` implementations for every custom ` impl Error `
11
11
- Increased MSRV to 1.81 due to ` core::error::Error `
12
12
13
+ ### Added
14
+
15
+ - ` as_raw ` getter function for ` Id `
16
+
13
17
## [ v0.4.1] - 2022-09-28
14
18
15
19
### Removed
Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ pub enum Id {
104
104
Extended ( ExtendedId ) ,
105
105
}
106
106
107
+ impl Id {
108
+ /// Returns the CAN Identifier as a raw 32-bit integer.
109
+ #[ inline]
110
+ pub fn as_raw ( & self ) -> u32 {
111
+ match self {
112
+ Id :: Standard ( id) => id. as_raw ( ) as u32 ,
113
+ Id :: Extended ( id) => id. as_raw ( ) ,
114
+ }
115
+ }
116
+ }
117
+
107
118
/// Implement `Ord` according to the CAN arbitration rules
108
119
///
109
120
/// When performing arbitration, frames are looked at bit for bit starting
You can’t perform that action at this time.
0 commit comments