ezsp/frame/parameters/bootloader/
launch_standalone_bootloader.rs1use num_traits::FromPrimitive;
4
5use crate::Error;
6use crate::ember::Status;
7
8crate::frame::parameters::frame!(
9 0x008F,
10 { mode: u8 },
11 impl {
12 impl Command {
13 #[must_use]
15 pub const fn new(mode: u8) -> Self {
16 Self { mode }
17 }
18 }
19 },
20 { status: u8 } => Bootloader(bootloader)::LaunchStandaloneBootloader,
21 impl {
22 impl TryFrom<Response> for () {
24 type Error = Error;
25
26 fn try_from(response: Response) -> Result<Self, Self::Error> {
27 match Status::from_u8(response.status).ok_or(response.status) {
28 Ok(Status::Success) => Ok(()),
29 other => Err(other.into()),
30 }
31 }
32 }
33 }
34);