fix for read line
This commit is contained in:
parent
66e276f15e
commit
ca26f090fa
@ -330,26 +330,16 @@ pub fn shared() -> Box<EspHttpServer<'static>> {
|
|||||||
println!("Updated btn");
|
println!("Updated btn");
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut line = std::string::String::new();
|
|
||||||
println!("Check for line");
|
println!("Check for line");
|
||||||
let has_line = line_buffer.read_line(&mut line);
|
let has_line = line_buffer.contains(&b'\n');
|
||||||
let mut line_size = 0;
|
if has_line {
|
||||||
match has_line {
|
println!("Was no line no string read");
|
||||||
Ok(size) => {
|
break;
|
||||||
line_size = size;
|
|
||||||
if size == 0 {
|
|
||||||
println!("Was no line no string read");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(err) => {
|
|
||||||
println!("Was no line and error {}", err);
|
|
||||||
break;
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
let mut line = std::string::String::new();
|
||||||
|
let line_size = line_buffer.read_line(&mut line)?;
|
||||||
println!("Processing line with size {} {}", line_size, line);
|
println!("Processing line with size {} {}", line_size, line);
|
||||||
//let validate = board.flash_bq34_z100(&line, is_dry_run);
|
let validate = board.flash_bq34_z100(&line, is_dry_run);
|
||||||
let validate = anyhow::Ok(());
|
|
||||||
delay.delay_us(2);
|
delay.delay_us(2);
|
||||||
if validate.is_err() {
|
if validate.is_err() {
|
||||||
let mut response = request.into_status_response(400_u16).unwrap();
|
let mut response = request.into_status_response(400_u16).unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user