diff --git a/sw/deployer/src/main.rs b/sw/deployer/src/main.rs index cf63b1e..7dee5c0 100644 --- a/sw/deployer/src/main.rs +++ b/sw/deployer/src/main.rs @@ -60,6 +60,9 @@ enum Commands { /// Print information about connected SC64 device Info, + /// Reset SC64 state (same as after power-up) + Reset, + /// Update persistent settings on SC64 device Set { #[command(subcommand)] @@ -317,6 +320,7 @@ fn handle_command(command: &Commands, port: Option, remote: Option handle_debug_command(connection, args), Commands::Dump(args) => handle_dump_command(connection, args), Commands::Info => handle_info_command(connection), + Commands::Reset => handle_reset_command(connection), Commands::Set { command } => handle_set_command(connection, command), Commands::Firmware { command } => handle_firmware_command(connection, command), Commands::Server(args) => handle_server_command(connection, args), @@ -739,6 +743,16 @@ fn handle_info_command(connection: Connection) -> Result<(), sc64::Error> { Ok(()) } +fn handle_reset_command(connection: Connection) -> Result<(), sc64::Error> { + let mut sc64 = init_sc64(connection, true)?; + + sc64.reset_state()?; + + println!("SC64 state has been reset"); + + Ok(()) +} + fn handle_set_command(connection: Connection, command: &SetCommands) -> Result<(), sc64::Error> { let mut sc64 = init_sc64(connection, true)?;