use num_traits::FromPrimitive;
use crate::Error;
use crate::ember::Status;
use crate::ember::security::initial::State;
crate::frame::parameters::frame!(
0x0068,
{ state: State },
impl {
impl Command {
#[must_use]
pub const fn new(state: State) -> Self {
Self { state }
}
}
},
{ success: u8 } => Security(security)::SetInitialSecurityState,
impl {
impl TryFrom<Response> for () {
type Error = Error;
fn try_from(response: Response) -> Result<Self, Self::Error> {
match Status::from_u8(response.success).ok_or(response.success) {
Ok(Status::Success) => Ok(()),
other => Err(other.into()),
}
}
}
}
);