Struct socketcan::frame::CanFdFrame
source · pub struct CanFdFrame(/* private fields */);
Expand description
The CAN flexible data rate frame with up to 64-bytes of data.
This is highly compatible with the canfd_frame
from libc.
(ref)
Implementations§
source§impl CanFdFrame
impl CanFdFrame
sourcepub fn with_flags(
id: impl Into<Id>,
data: &[u8],
flags: FdFlags
) -> Option<Self>
pub fn with_flags( id: impl Into<Id>, data: &[u8], flags: FdFlags ) -> Option<Self>
Create a new FD frame with FD flags
sourcepub fn flags(&self) -> FdFlags
pub fn flags(&self) -> FdFlags
Gets the flags for the FD frame.
These are the bits from the separate FD frame flags, not the flags in the composite ID word.
Trait Implementations§
source§impl AsPtr for CanFdFrame
impl AsPtr for CanFdFrame
source§fn as_ptr(&self) -> *const Self::Inner
fn as_ptr(&self) -> *const Self::Inner
Gets a pointer to the CAN frame structure that is compatible with the Linux C API.
source§fn as_mut_ptr(&mut self) -> *mut Self::Inner
fn as_mut_ptr(&mut self) -> *mut Self::Inner
Gets a mutable pointer to the CAN frame structure that is compatible with the Linux C API.
§type Inner = canfd_frame
type Inner = canfd_frame
source§impl AsRef<canfd_frame> for CanFdFrame
impl AsRef<canfd_frame> for CanFdFrame
source§fn as_ref(&self) -> &canfd_frame
fn as_ref(&self) -> &canfd_frame
source§impl Clone for CanFdFrame
impl Clone for CanFdFrame
source§fn clone(&self) -> CanFdFrame
fn clone(&self) -> CanFdFrame
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CanFdFrame
impl Debug for CanFdFrame
source§impl Default for CanFdFrame
impl Default for CanFdFrame
source§impl Frame for CanFdFrame
impl Frame for CanFdFrame
source§fn new_remote(_id: impl Into<Id>, _dlc: usize) -> Option<Self>
fn new_remote(_id: impl Into<Id>, _dlc: usize) -> Option<Self>
CAN FD frames don’t support remote
source§fn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Check if frame uses 29-bit extended ID format.
source§fn is_remote_frame(&self) -> bool
fn is_remote_frame(&self) -> bool
The FD frames don’t support remote request
source§fn data(&self) -> &[u8] ⓘ
fn data(&self) -> &[u8] ⓘ
A slice into the actual data.
For normal CAN frames the slice will always be <= 8 bytes in length.
source§fn is_standard(&self) -> bool
fn is_standard(&self) -> bool
source§fn is_data_frame(&self) -> bool
fn is_data_frame(&self) -> bool
source§impl Frame for CanFdFrame
impl Frame for CanFdFrame
source§fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
Sets the data payload of the frame.
source§fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
source§fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
source§fn is_error_frame(&self) -> bool
fn is_error_frame(&self) -> bool
source§impl From<CanDataFrame> for CanFdFrame
impl From<CanDataFrame> for CanFdFrame
source§fn from(frame: CanDataFrame) -> Self
fn from(frame: CanDataFrame) -> Self
source§impl From<CanFdFrame> for CanAnyFrame
impl From<CanFdFrame> for CanAnyFrame
source§fn from(frame: CanFdFrame) -> Self
fn from(frame: CanFdFrame) -> Self
source§impl From<canfd_frame> for CanFdFrame
impl From<canfd_frame> for CanFdFrame
source§fn from(frame: canfd_frame) -> Self
fn from(frame: canfd_frame) -> Self
source§impl TryFrom<CanFdFrame> for CanDataFrame
impl TryFrom<CanFdFrame> for CanDataFrame
§type Error = ConstructionError
type Error = ConstructionError
source§impl TryFrom<CanFdFrame> for CanFrame
impl TryFrom<CanFdFrame> for CanFrame
source§fn try_from(
frame: CanFdFrame
) -> Result<Self, <Self as TryFrom<CanFdFrame>>::Error>
fn try_from( frame: CanFdFrame ) -> Result<Self, <Self as TryFrom<CanFdFrame>>::Error>
Try to convert a CAN FD frame into a classic CAN 2.0 frame.
This should work if it’s a data frame with 8 or fewer data bytes.
§type Error = ConstructionError
type Error = ConstructionError
source§impl UpperHex for CanFdFrame
impl UpperHex for CanFdFrame
impl Copy for CanFdFrame
Auto Trait Implementations§
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
source§impl<T> ControllerSpecificErrorInformation for Twhere
T: Frame,
impl<T> ControllerSpecificErrorInformation for Twhere T: Frame,
source§fn get_ctrl_err(&self) -> Option<&[u8]>
fn get_ctrl_err(&self) -> Option<&[u8]>
Get the controller specific error information.