pub struct UsbCanSocket { /* private fields */ }Implementations§
Source§impl UsbCanSocket
impl UsbCanSocket
pub fn open_with_usb_bus(bus: UsbBus) -> UsbCanSocket
Sourcepub fn open_with_timing(
bus: UsbBus,
timing: &CanBitTiming,
) -> Result<UsbCanSocket, CanError>
pub fn open_with_timing( bus: UsbBus, timing: &CanBitTiming, ) -> Result<UsbCanSocket, CanError>
Opens a CAN socket with custom bit timing.
Use CAN_TIMING_BOUNDARIES for valid ranges.
§Examples
let timing = CanBitTiming::new(8, 1, 13, 2)?; // 500 kbit/s
let socket = UsbCanSocket::open_with_timing(UsbBus::USB1, &timing)?;Sourcepub fn open_fd_with_timing(
bus: UsbBus,
timing: &CanFdBitTiming,
) -> Result<UsbCanSocket, CanError>
pub fn open_fd_with_timing( bus: UsbBus, timing: &CanFdBitTiming, ) -> Result<UsbCanSocket, CanError>
Opens a CAN FD socket with custom timing for nominal and data phases.
§Examples
let timing = CanFdBitTiming::new(
10, 4, 13, 2, // Nominal phase
5, 2, 6, 1 // Data phase
)?;
let socket = UsbCanSocket::open_fd_with_timing(UsbBus::USB1, &timing)?;Trait Implementations§
Source§impl Debug for UsbCanSocket
impl Debug for UsbCanSocket
Source§impl Drop for UsbCanSocket
impl Drop for UsbCanSocket
Source§impl PartialEq for UsbCanSocket
impl PartialEq for UsbCanSocket
impl StructuralPartialEq for UsbCanSocket
Auto Trait Implementations§
impl Freeze for UsbCanSocket
impl RefUnwindSafe for UsbCanSocket
impl Send for UsbCanSocket
impl Sync for UsbCanSocket
impl Unpin for UsbCanSocket
impl UnwindSafe for UsbCanSocket
Blanket Implementations§
Source§impl<T> AcceptanceFilter11Bit for Twhere
T: HasAcceptanceFilter11Bit + Channel,
impl<T> AcceptanceFilter11Bit for Twhere
T: HasAcceptanceFilter11Bit + Channel,
Source§impl<T> AcceptanceFilter29Bit for Twhere
T: HasAcceptanceFilter29Bit + Channel,
impl<T> AcceptanceFilter29Bit for Twhere
T: HasAcceptanceFilter29Bit + Channel,
Source§impl<T> AllowEchoFrames for Twhere
T: HasAllowEchoFrames + Channel,
impl<T> AllowEchoFrames for Twhere
T: HasAllowEchoFrames + Channel,
Source§impl<T> AllowErrorFrames for Twhere
T: HasAllowErrorFrames + Channel,
impl<T> AllowErrorFrames for Twhere
T: HasAllowErrorFrames + Channel,
Source§impl<T> AllowRTRFrames for Twhere
T: HasAllowRTRFrames + Channel,
impl<T> AllowRTRFrames for Twhere
T: HasAllowRTRFrames + Channel,
Source§impl<T> AllowStatusFrames for Twhere
T: HasAllowStatusFrames + Channel,
impl<T> AllowStatusFrames for Twhere
T: HasAllowStatusFrames + Channel,
Source§impl<T> AnalogValue for Twhere
T: HasAnalogValue + Channel,
impl<T> AnalogValue for Twhere
T: HasAnalogValue + Channel,
Source§impl<T> BitrateInfo for Twhere
T: HasBitrateInfo + Channel,
impl<T> BitrateInfo for Twhere
T: HasBitrateInfo + Channel,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more