fix warnings
All checks were successful
build docker container automatically / build (push) Successful in 3m43s
All checks were successful
build docker container automatically / build (push) Successful in 3m43s
This commit is contained in:
@ -9,7 +9,6 @@ use pbkdf2::{
|
|||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
use tokio::io::AsyncWriteExt;
|
use tokio::io::AsyncWriteExt;
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
use std::error::Error;
|
|
||||||
|
|
||||||
static COMMANDS: [(&str, u8); 3] = [("start", 0x1) , ("stop", 0x2), ("reboot", 0x3)];
|
static COMMANDS: [(&str, u8); 3] = [("start", 0x1) , ("stop", 0x2), ("reboot", 0x3)];
|
||||||
|
|
||||||
@ -45,8 +44,6 @@ async fn pc_boot(command: String, pass: String) -> Result<String, HttpError> {
|
|||||||
1 => { return Ok("Failed".to_string()) },
|
1 => { return Ok("Failed".to_string()) },
|
||||||
_ => { return Ok("Invalid response".to_string()) }
|
_ => { return Ok("Invalid response".to_string()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok("Hello".to_string())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/api/pc/status")]
|
#[get("/api/pc/status")]
|
||||||
@ -60,8 +57,8 @@ async fn pc_status() -> Result<i32, HttpError> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn esp_boot_request(command: u8) -> Result<i32, tokio::io::Error> {
|
async fn esp_boot_request(command: u8) -> Result<i32, tokio::io::Error> {
|
||||||
let mut stream = None;
|
|
||||||
let mut retry = 3;
|
let mut retry = 3;
|
||||||
|
let mut stream;
|
||||||
|
|
||||||
println!("send request to esp");
|
println!("send request to esp");
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user