diff --git a/src/api/boot.rs b/src/api/boot.rs index aa24406..f3331f9 100644 --- a/src/api/boot.rs +++ b/src/api/boot.rs @@ -9,7 +9,6 @@ use pbkdf2::{ use tokio::net::TcpStream; use tokio::io::AsyncWriteExt; use tokio::io::AsyncReadExt; -use std::error::Error; static COMMANDS: [(&str, u8); 3] = [("start", 0x1) , ("stop", 0x2), ("reboot", 0x3)]; @@ -45,8 +44,6 @@ async fn pc_boot(command: String, pass: String) -> Result { 1 => { return Ok("Failed".to_string()) }, _ => { return Ok("Invalid response".to_string()) } } - - Ok("Hello".to_string()) } #[get("/api/pc/status")] @@ -60,8 +57,8 @@ async fn pc_status() -> Result { } async fn esp_boot_request(command: u8) -> Result { - let mut stream = None; let mut retry = 3; + let mut stream; println!("send request to esp"); loop {