mirror of https://github.com/jgoerzen/xbnet.git
fix
This commit is contained in:
parent
8e73c21fd9
commit
6aca018421
|
@ -85,6 +85,15 @@ impl XB {
|
|||
ser.swrite.lock().unwrap().flush().unwrap();
|
||||
|
||||
trace!("Waiting for OK");
|
||||
loop {
|
||||
// There might be other packets flowing in while we wait for the OK. FIXME: this could still find
|
||||
// it prematurely if OK\r occurs in a packet.
|
||||
let line = ser.readln().unwrap().unwrap();
|
||||
trace!("Received: {}", line);
|
||||
if line.ends_with("OK") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(ser.readln().unwrap().unwrap(), String::from("OK"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue