Struct ecu_diagnostics::hardware::socketcan::SocketCanIsoTPChannel
source · pub struct SocketCanIsoTPChannel { /* private fields */ }
Expand description
SocketCAN CAN channel
Trait Implementations§
source§impl Debug for SocketCanIsoTPChannel
impl Debug for SocketCanIsoTPChannel
source§impl Drop for SocketCanIsoTPChannel
impl Drop for SocketCanIsoTPChannel
source§impl IsoTPChannel for SocketCanIsoTPChannel
impl IsoTPChannel for SocketCanIsoTPChannel
source§fn set_iso_tp_cfg(&mut self, cfg: IsoTPSettings) -> ChannelResult<()>
fn set_iso_tp_cfg(&mut self, cfg: IsoTPSettings) -> ChannelResult<()>
Sets the ISO-TP specific configuration for the Channel Read more
source§impl PayloadChannel for SocketCanIsoTPChannel
impl PayloadChannel for SocketCanIsoTPChannel
source§fn write_bytes(
&mut self,
addr: u32,
ext_id: Option<u8>,
buffer: &[u8],
timeout_ms: u32
) -> ChannelResult<()>
fn write_bytes( &mut self, addr: u32, ext_id: Option<u8>, buffer: &[u8], timeout_ms: u32 ) -> ChannelResult<()>
Writes bytes to socketcan socket.
NOTE: Due to how ISO-TP channeling on SocketCAN works, there is a limitation when sending on a different address to what was defined in Self::set_iso_tp_cfg. It should work for most alternate address messages (EG: Global tester present), but longer messages will fail.
If buffer
is less than 7 bytes (With Standard ISO-TP addressing), or less than 6 bytes (With Extended ISO-TP addressing),
this function will attempt to open a parallel socketCAN channel in order to send an ISO-TP single frame request on the alternate requested
address.
If buffer
is more than 7 bytes and you request on an alternate address, then this function will fail with ChannelError::UnsupportedRequest
source§fn open(&mut self) -> ChannelResult<()>
fn open(&mut self) -> ChannelResult<()>
This function opens the interface.
It is ONLY called after set_ids and any other configuration function
source§fn close(&mut self) -> ChannelResult<()>
fn close(&mut self) -> ChannelResult<()>
Closes and destroys the channel
source§fn set_ids(&mut self, send: u32, recv: u32) -> ChannelResult<()>
fn set_ids(&mut self, send: u32, recv: u32) -> ChannelResult<()>
Configures the diagnostic channel with specific IDs for configuring the diagnostic server Read more
source§fn read_bytes(&mut self, timeout_ms: u32) -> ChannelResult<Vec<u8>>
fn read_bytes(&mut self, timeout_ms: u32) -> ChannelResult<Vec<u8>>
Attempts to read bytes from the channel. Read more
source§fn clear_rx_buffer(&mut self) -> ChannelResult<()>
fn clear_rx_buffer(&mut self) -> ChannelResult<()>
Tells the channel to clear its Rx buffer.
This means all pending messages to be read should be wiped from the devices queue,
such that PayloadChannel::read_bytes does not read them
source§fn clear_tx_buffer(&mut self) -> ChannelResult<()>
fn clear_tx_buffer(&mut self) -> ChannelResult<()>
Tells the channel to clear its Tx buffer.
This means all messages that are queued to be sent to the ECU should be wiped.
Auto Trait Implementations§
impl Freeze for SocketCanIsoTPChannel
impl RefUnwindSafe for SocketCanIsoTPChannel
impl Send for SocketCanIsoTPChannel
impl Sync for SocketCanIsoTPChannel
impl Unpin for SocketCanIsoTPChannel
impl UnwindSafe for SocketCanIsoTPChannel
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