pub struct SocketCanIsoTPChannel { /* private fields */ }
Expand description

SocketCAN CAN channel

Trait Implementations§

source§

impl Debug for SocketCanIsoTPChannel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for SocketCanIsoTPChannel

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl IsoTPChannel for SocketCanIsoTPChannel

source§

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

source§

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<()>

This function opens the interface. It is ONLY called after set_ids and any other configuration function
source§

fn close(&mut self) -> ChannelResult<()>

Closes and destroys the channel
source§

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>>

Attempts to read bytes from the channel. Read more
source§

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<()>

Tells the channel to clear its Tx buffer. This means all messages that are queued to be sent to the ECU should be wiped.
source§

fn read_write_bytes( &mut self, addr: u32, ext_id: Option<u8>, buffer: &[u8], write_timeout_ms: u32, read_timeout_ms: u32 ) -> ChannelResult<Vec<u8>>

Attempts to write bytes to the channel, then listen for the channels response Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.