Struct UdsClient

Source
pub struct UdsClient<'a, T: CanSocketTx> { /* private fields */ }

Implementations§

Source§

impl<'a, T: CanSocketTx> UdsClient<'a, T>

Source

pub fn new(channel: T, id: u32, resp: &'a LazyLock<Arc<ResponseSlot>>) -> Self

Source

pub fn send_command<P: Into<u8>, M: Into<u8>>( &mut self, pci: P, cmd: M, args: &[u8], ) -> Result<(), DiagError>

Send a command without the response. The frame includes as ISO 15765-2

Source

pub async fn send_command_with_response<P: Into<u8>, M: Into<u8>>( &mut self, pci: P, cmd: M, args: &[u8], ) -> Result<UdsResponse, DiagError>

Send a command with the response. The frame includes as ISO 15765-2

Source

pub async fn receive(&mut self) -> Response

Receive the frame from UDS server

Source§

impl<T: CanSocketTx> UdsClient<'_, T>

Source

pub async fn uds_reset_118(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x40 Description: The function will request an ECU reset event for Realtime chip.

Source

pub async fn uds_reset_148(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x41 Description: The function will request an ECU reset event for Telematic chip.

Source

pub async fn uds_reset_imx(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x42 Description: The function will request an ECU reset event for IMX chip.

Source

pub async fn uds_reset_esp32_wifi(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x43 Description: The function will request an ECU reset event for Esp-Wifi chip.

Source

pub async fn uds_reset_esp32_ble(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x44 Description: The function will request an ECU reset event for Esp-Ble chip.

Source

pub async fn uds_reset_lte(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x45 Description: The function will request an ECU reset event for LTE chip.

Source

pub async fn uds_reset_lizard(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x46 Description: The function will request an ECU reset event for Lizard chip.

Source

pub async fn uds_reset_cendric(&mut self) -> Result<(), DiagError>

Service ID: 0x11 - ECU Reset Sub-ID: 0x47 Description: The function will request an ECU reset event for Cendric chip.

Source§

impl<T: CanSocketTx> UdsClient<'_, T>

Source

pub async fn get_ecu_log(&mut self, _file: File) -> Result<(), DiagError>

Service ID: 0x36 - Transfer Data Description: The function will request a data transfer from ECU. The data will store in the as raw binary

Source§

impl<T: CanSocketTx> UdsClient<'_, T>

Source

pub async fn uds_real_time_data_slow(&mut self) -> Result<(), DiagError>

Service ID: 0x2A - Data Transmission Sub-ID: 0x01 Description: The function will request an Realtime data sent from ECU with slow rate.

Source

pub async fn uds_real_time_data_medium(&mut self) -> Result<(), DiagError>

Service ID: 0x2A - Data Transmission Sub-ID: 0x02 Description: The function will request an Realtime data sent from ECU with medium rate.

Source

pub async fn uds_real_time_data_fast(&mut self) -> Result<(), DiagError>

Service ID: 0x2A - Data Transmission Sub-ID: 0x03 Description: The function will request an Realtime data sent from ECU with fast rate.

Source

pub async fn uds_real_time_data_stop(&mut self) -> Result<(), DiagError>

Service ID: 0x2A - Data Transmission Sub-ID: 0x04 Description: The function will send a stop event for realtime data from ECU.

Auto Trait Implementations§

§

impl<'a, T> Freeze for UdsClient<'a, T>
where T: Freeze,

§

impl<'a, T> !RefUnwindSafe for UdsClient<'a, T>

§

impl<'a, T> Send for UdsClient<'a, T>
where T: Send,

§

impl<'a, T> Sync for UdsClient<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for UdsClient<'a, T>
where T: Unpin,

§

impl<'a, T> !UnwindSafe for UdsClient<'a, T>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

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

Source§

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.