File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const FLASH_CMD: &[u8] = b"flash:";
13
13
const ERASE_CMD : & [ u8 ] = b"erase:" ;
14
14
const CONTINUE_CMD : & [ u8 ] = b"continue" ;
15
15
const REBOOT_CMD : & [ u8 ] = b"reboot" ;
16
+ const REBOOT_BOOTLOADER_CMD : & [ u8 ] = b"reboot-bootloader" ;
16
17
17
18
#[ derive( Debug , Clone ) ]
18
19
enum Reply {
@@ -181,6 +182,16 @@ pub trait Fastboot: Read + Write + Sized {
181
182
_ => Err ( "Unknown failure" . to_owned ( ) ) ,
182
183
}
183
184
}
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
+ }
184
195
}
185
196
186
197
// TODO: not sure if it's a right way to do things
You can’t perform that action at this time.
0 commit comments