Struct fdcanusb::CanFdFrame
source · pub struct CanFdFrame {
pub arbitration_id: u16,
pub data: Vec<u8>,
pub extended_id: Option<bool>,
pub brs: Option<bool>,
pub fd_can_frame: Option<bool>,
pub remote_frame: Option<bool>,
pub timestamp: Option<u32>,
}Expand description
CanFdFrame represents a single frame of data on the CAN bus.
Fields§
§arbitration_id: u16The arbitration id of the frame.
data: Vec<u8>The data of the frame, up to 64 bytes.
extended_id: Option<bool>If the frame has an extended id.
brs: Option<bool>If the frame has bit rate switching.
fd_can_frame: Option<bool>If the frame is a CAN FD frame.
remote_frame: Option<bool>If the frame is a remote frame.
timestamp: Option<u32>The timestamp of the frame.
Implementations§
source§impl CanFdFrame
impl CanFdFrame
sourcepub fn new(arbitration_id: u16, data: &[u8]) -> Result<CanFdFrame>
pub fn new(arbitration_id: u16, data: &[u8]) -> Result<CanFdFrame>
Create a new CanFdFrame with the given arbitration id and data.
returns an Err if the length of data is > 64
Use CanFdFrame::new_with_flags to set the flags.
sourcepub fn new_with_flags(
arbitration_id: u16,
data: &[u8],
extended_id: Option<bool>,
brs: Option<bool>,
fd_can_frame: Option<bool>,
remote_frame: Option<bool>,
timestamp: Option<u32>,
) -> Result<CanFdFrame>
pub fn new_with_flags( arbitration_id: u16, data: &[u8], extended_id: Option<bool>, brs: Option<bool>, fd_can_frame: Option<bool>, remote_frame: Option<bool>, timestamp: Option<u32>, ) -> Result<CanFdFrame>
Create a new CanFdFrame with the given arbitration id, data and flags.
returns an Err if the length of data is > 64
Trait Implementations§
source§impl Debug for CanFdFrame
impl Debug for CanFdFrame
source§impl Default for CanFdFrame
impl Default for CanFdFrame
source§fn default() -> CanFdFrame
fn default() -> CanFdFrame
Returns the “default value” for a type. Read more
source§impl From<CanFdFrame> for FdCanUSBFrame
impl From<CanFdFrame> for FdCanUSBFrame
source§fn from(frame: CanFdFrame) -> FdCanUSBFrame
fn from(frame: CanFdFrame) -> FdCanUSBFrame
Converts to this type from the input type.
source§impl TryFrom<FdCanUSBFrame> for CanFdFrame
impl TryFrom<FdCanUSBFrame> for CanFdFrame
Auto Trait Implementations§
impl Freeze for CanFdFrame
impl RefUnwindSafe for CanFdFrame
impl Send for CanFdFrame
impl Sync for CanFdFrame
impl Unpin for CanFdFrame
impl UnwindSafe for CanFdFrame
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more