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/).
1010- Added ` core::error::Error ` implementations for every custom ` impl Error `
1111- Increased MSRV to 1.81 due to ` core::error::Error `
1212
13+ ### Added
14+
15+ - ` as_raw ` getter function for ` Id `
16+
1317## [ v0.4.1] - 2022-09-28
1418
1519### Removed
Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ pub enum Id {
104104 Extended ( ExtendedId ) ,
105105}
106106
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+
107118/// Implement `Ord` according to the CAN arbitration rules
108119///
109120/// When performing arbitration, frames are looked at bit for bit starting
You can’t perform that action at this time.
0 commit comments