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
//! Provides methods to manipulate the ECUs diagnostic session mode

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

impl DynamicDiagSession {
    /// Set KWP session mode
    pub fn kwp_set_session(&self, mode: KwpSessionTypeByte) -> DiagServerResult<()> {
        self.send_command_with_response(KwpCommand::StartDiagnosticSession  , &[mode.into()])?;
        Ok(())
    }
}