Skip to content

Commit

Permalink
derive FromRepr for FpMode
Browse files Browse the repository at this point in the history
Useful for getting an FpMode from the output of the fp mode command
  • Loading branch information
ChocolateLoverRaj committed Dec 18, 2024
1 parent 4b5329c commit 40d8add
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crosec/src/commands/fp_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use std::os::fd::AsRawFd;

use bytemuck::{Pod, Zeroable};
use strum::IntoEnumIterator;
use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum_macros::{EnumIter, EnumString, FromRepr, IntoStaticStr};

use crate::{ec_command::ec_command_bytemuck, EcCmdResult};

use super::CrosEcCmd;

/// Note that with the ChromiumOS ectool, to start enrolling, as well as continue the next step in enrolling, you do `ectool --name=cros_fp fpmode enroll`. The equivalent of this is to do `ectool fp-mode EnrollImage EnrollSession`.
#[derive(EnumString, EnumIter, IntoStaticStr, Clone, Copy, Debug)]
#[derive(EnumString, EnumIter, IntoStaticStr, Clone, Copy, Debug, FromRepr)]
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
#[repr(u32)]
pub enum FpMode {
Expand Down

0 comments on commit 40d8add

Please sign in to comment.