mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-27 04:10:25 +00:00
Add mutable accessors for ID in Header and Frame structs
This commit is contained in:
parent
b67c2e06d5
commit
dbd10486b3
@ -59,6 +59,11 @@ impl Header {
|
||||
&self.id
|
||||
}
|
||||
|
||||
/// Get mutable reference to ID
|
||||
pub fn id_mut(&mut self) -> &mut embedded_can::Id {
|
||||
&mut self.id
|
||||
}
|
||||
|
||||
/// Return length as u8
|
||||
pub fn len(&self) -> u8 {
|
||||
self.len
|
||||
@ -207,6 +212,11 @@ impl Frame {
|
||||
&self.can_header.id
|
||||
}
|
||||
|
||||
/// Get mutable reference to ID
|
||||
pub fn id_mut(&mut self) -> &mut embedded_can::Id {
|
||||
&mut self.can_header.id
|
||||
}
|
||||
|
||||
/// Get reference to data
|
||||
pub fn data(&self) -> &[u8] {
|
||||
&self.data.raw()[..self.can_header.len as usize]
|
||||
|
Loading…
x
Reference in New Issue
Block a user