pub struct KwpIOCTLManager<'a> { /* private fields */ }
Expand description

Handler for Input output control by local identifier requests (IOCTL) This allows for short term or long term actuation’s of components an ECU controls, or reporting a components current state.

USE WITH CAUTION!

Implementations§

source§

impl<'a> KwpIOCTLManager<'a>

source

pub fn new( identifier: u8, server: &'a mut DynamicDiagSession ) -> DiagServerResult<Self>

Creates an IOCTL manager

§Parameters
  • identifier - A identifier for the component or function to control. Valid ranges are
    • 0x10-0xF9 - Input output local Identifier
    • 0xFA-0xFE - System supplier specific
    • 0xFF - Input output local identifier Other values may result in an ECU rejecting the request.
  • server - KWP2000 server reference
source

pub fn return_control_to_ecu(&self) -> DiagServerResult<()>

Asks the ECU to take back control of the identifier.

source

pub fn report_current_state(&self) -> DiagServerResult<Vec<u8>>

Asks the ECU to report the current state of the identifier.

source

pub fn reset_to_default_state(&self) -> DiagServerResult<()>

Asks the ECU to return the component identifier back to its default (Factory) state

source

pub fn freeze_current_state(&self) -> DiagServerResult<()>

Asks the ECU to freeze the current state of the identifier

source

pub fn short_term_actuate(&self, args: &[u8]) -> DiagServerResult<()>

Actuates the component at the provided identifier. This is a short term actuation. Once the ECU looses power or returns to its default session state, the component will be controlled by the ECU normally

source

pub fn long_term_adjust(&self, args: &[u8]) -> DiagServerResult<()>

Adjusts the component’s value. This is an optional command and is NOT supported by all ECUs. This allows for long-term adjustments (Such as fuel trims) to be made to the ECU. The ECU will retain the values even after a power reset.

Trait Implementations§

source§

impl<'a> Debug for KwpIOCTLManager<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for KwpIOCTLManager<'a>

§

impl<'a> !RefUnwindSafe for KwpIOCTLManager<'a>

§

impl<'a> Send for KwpIOCTLManager<'a>

§

impl<'a> Sync for KwpIOCTLManager<'a>

§

impl<'a> Unpin for KwpIOCTLManager<'a>

§

impl<'a> !UnwindSafe for KwpIOCTLManager<'a>

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.