fin 2
This commit is contained in:
@@ -23,11 +23,15 @@ pub fn read_messages(mut request: curl::easy::Easy, data: &str) {
|
||||
loop {
|
||||
match connection.read(serial_buf.as_mut_slice()) {
|
||||
Ok(t) => {
|
||||
if t < 1 { continue; }
|
||||
let output = String::from_utf8_lossy(&serial_buf[..t]);
|
||||
if output.contains("1") {
|
||||
// send curl request
|
||||
let res = crate::curl::request(&mut request, &data);
|
||||
println!("Response code: {}", res.unwrap());
|
||||
match res {
|
||||
Some(t) => println!("Response code: {t}"),
|
||||
None => eprintln!("[ERROR] Something went wrong with the CURL request"),
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(_) => {}
|
||||
|
Reference in New Issue
Block a user