ecu_diagnostics 0.105.0

A rust crate for ECU diagnostic servers and communication APIs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! This service requests the ECU to perform a reset

use crate::{dynamic_diag::DynamicDiagSession, DiagServerResult};
use automotive_diag::kwp2000::{KwpCommand, ResetType};

impl DynamicDiagSession {
    /// Performs an ECU Reset operation
    ///
    /// ## Params
    /// * mode - [ResetMode] to send to the ECU
    pub fn kwp_reset_ecu(&self, mode: ResetType) -> DiagServerResult<()> {
        self.send_command_with_response(KwpCommand::ECUReset, &[mode.into()])?;
        Ok(())
    }
}