automotive_diag/uds/reset_types.rs
1crate::utils::enum_wrapper!(uds, ResetType, ResetTypeByte);
2
3/// Reset ECU subcommand
4#[repr(u8)]
5#[derive(strum::FromRepr, Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[cfg_attr(feature = "iter", derive(strum::EnumIter))]
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9pub enum ResetType {
10 /// Signals the ECU to perform a hard-reset,
11 /// simulating a forceful power off/on cycle
12 ///
13 /// This might result in both non-volatile memory and volatile memory locations being re-initialized
14 HardReset = 0x01,
15
16 /// Signals the ECU to perform a simulated key off/on cycle,
17 /// simulating the usual key-off/on cycle
18 ///
19 /// This typically results in the preservation of non-volatile memory,
20 /// but volatile memory will be re-initialized
21 KeyOffReset = 0x02,
22
23 /// Signals the ECU to perform a soft reset, simply rebooting the current
24 /// application running on it.
25 ///
26 /// This will result in the preservation of both non-volatile and volatile memory
27 SoftReset = 0x03,
28
29 /// Enables a rapid power shutdown on the ECU during a key-off cycle.
30 ///
31 /// IMPORTANT: Once this has been used, the diagnostic server **cannot** send
32 /// any other messages other than `ECUReset` in order to not disturb the rapid power
33 /// shutdown function.
34 EnableRapidPowerShutDown = 0x04,
35
36 /// Disables a rapid power shutdown on the ECU during a key-off cycle.
37 DisableRapidPowerShutDown = 0x05,
38}