Struct ecu_diagnostics::kwp2000::KwpIOCTLManager
source · 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>
impl<'a> KwpIOCTLManager<'a>
sourcepub fn new(
identifier: u8,
server: &'a mut DynamicDiagSession
) -> DiagServerResult<Self>
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
sourcepub fn return_control_to_ecu(&self) -> DiagServerResult<()>
pub fn return_control_to_ecu(&self) -> DiagServerResult<()>
Asks the ECU to take back control of the identifier.
sourcepub fn report_current_state(&self) -> DiagServerResult<Vec<u8>>
pub fn report_current_state(&self) -> DiagServerResult<Vec<u8>>
Asks the ECU to report the current state of the identifier.
sourcepub fn reset_to_default_state(&self) -> DiagServerResult<()>
pub fn reset_to_default_state(&self) -> DiagServerResult<()>
Asks the ECU to return the component identifier back to its default (Factory) state
sourcepub fn freeze_current_state(&self) -> DiagServerResult<()>
pub fn freeze_current_state(&self) -> DiagServerResult<()>
Asks the ECU to freeze the current state of the identifier
sourcepub fn short_term_actuate(&self, args: &[u8]) -> DiagServerResult<()>
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
sourcepub fn long_term_adjust(&self, args: &[u8]) -> DiagServerResult<()>
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.