Skip to content

Commit 1fcb547

Browse files
committed
add reboot-bootloader to protocol
1 parent 19f4851 commit 1fcb547

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/fastboot.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const FLASH_CMD: &[u8] = b"flash:";
1313
const ERASE_CMD: &[u8] = b"erase:";
1414
const CONTINUE_CMD: &[u8] = b"continue";
1515
const REBOOT_CMD: &[u8] = b"reboot";
16+
const REBOOT_BOOTLOADER_CMD: &[u8] = b"reboot-bootloader";
1617

1718
#[derive(Debug, Clone)]
1819
enum Reply {
@@ -181,6 +182,16 @@ pub trait Fastboot: Read + Write + Sized {
181182
_ => Err("Unknown failure".to_owned()),
182183
}
183184
}
185+
186+
/// Reboots a client.
187+
fn reboot_bootloader(&mut self) -> FbResult<()> {
188+
let reply = fb_send(self, REBOOT_BOOTLOADER_CMD)?;
189+
match reply {
190+
Reply::Okay(_) => Ok(()),
191+
Reply::Fail(message) => Err(message),
192+
_ => Err("Unknown failure".to_owned()),
193+
}
194+
}
184195
}
185196

186197
// TODO: not sure if it's a right way to do things

0 commit comments

Comments
 (0)