Struct UdsClient

Source
pub struct UdsClient { /* private fields */ }
Expand description

Main struct providing all API calls.

Implementations§

Source§

impl UdsClient

Source

pub async fn clear_diagnostic_information( &self, group_of_dtc: u32, ) -> EcuResponseResult

Source§

impl UdsClient

Source

pub async fn ecu_reset(&self, reset_type: ResetType) -> EcuResponseResult

Source§

impl UdsClient

Source

pub async fn read_data_by_identifier( &self, data_identifiers: &[u16], ) -> EcuResponseResult

Source§

impl UdsClient

Source

pub async fn report_number_of_dtc_by_status_mask( &self, dtc_status_mask: u8, ) -> EcuResponseResult

0x01

Source

pub async fn report_dtc_by_status_mask( &self, dtc_status_mask: u8, ) -> EcuResponseResult

0x02

Source

pub async fn report_dtc_ext_data_record_by_dtc_number( &self, dtc_mask_record: u32, dtc_ext_data_record_number: u8, ) -> EcuResponseResult

0x06

Source

pub async fn report_most_recent_confirmed_dtc(&self) -> EcuResponseResult

0x0E

Source§

impl UdsClient

Source

pub async fn read_memory_by_address( &self, address_and_memory_length_format_identifier: u8, memory_address: &[u8], memory_size: &[u8], ) -> EcuResponseResult

address_and_memory_length_format_identifier (explained in ISOTP table 152) is two values encoded in single message - could be split into two separate values mem_length and address_length. Or create wrapper, that would take two parameters.

Or could be even more simplified, by accepting just address and mem_size values, but that would be less flexible

Takes memory address and byte size encoded in u8 slice. MSB is at position 0. Examples are shown in ISOTP documentation chapter 10.3.5.2

Source

pub async fn read_memory_by_address_simplified( &self, memory_address: u64, memory_size: u64, memory_address_len: Option<u8>, memory_size_len: Option<u8>, ) -> EcuResponseResult

Simplified method, where address_and_memory_length_format_identifier will be assumed from provided arguments if not specified. If assumption will take place, the lowest possible size will be used.

Source§

impl UdsClient

Source

pub async fn write_data_by_identifier( &self, data_identifier: u16, data_record: &[u8], ) -> EcuResponseResult

Source§

impl UdsClient

Source

pub fn new( canifc: &str, src: impl Into<Id>, dst: impl Into<Id>, ) -> Result<UdsClient, UdsError>

Source

pub fn new_from_socket(socket: UdsSocket) -> UdsClient

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

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.