Read all available bytes
This commit is contained in:
parent
bc5b0959b2
commit
b3b7a4ea27
@ -65,8 +65,9 @@ impl SerialInterface {
|
||||
}
|
||||
|
||||
pub fn recv_bytes(&mut self) -> Result<Vec<u8>> {
|
||||
let mut buffer: Vec<u8> = Vec::new();
|
||||
self.interface.read_to_end(&mut buffer);
|
||||
let available_bytes = self.interface.bytes_to_read()?.try_into()?;
|
||||
let mut buffer: Vec<u8> = vec![0; available_bytes];
|
||||
self.interface.read(&mut buffer)?;
|
||||
|
||||
let improv_packet_offset = find_begin_of_improv_packet(&buffer).unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user