Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
dmweis committed Feb 25, 2024
1 parent cc94be6 commit 031b654
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/serial_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bytes::{BufMut, BytesMut};
use futures::{SinkExt, StreamExt};
use std::str;
use tokio::time::{timeout, Duration};
use tokio_serial::SerialPortBuilderExt;
use tokio_serial::{SerialPort, SerialPortBuilderExt};
use tokio_util::codec::{Decoder, Encoder};
use tracing::warn;

Expand Down Expand Up @@ -184,11 +184,9 @@ impl FramedDriver for FramedSerialDriver {
}

async fn clear_io_buffers(&mut self) -> Result<()> {
// do not touch the internal IO buffer because you might put it in a corrupt state
// self.framed_port
// .get_mut()
// .clear(tokio_serial::ClearBuffer::All)?;

self.framed_port
.get_mut()
.clear(tokio_serial::ClearBuffer::All)?;
self.framed_port.write_buffer_mut().clear();
self.framed_port.read_buffer_mut().clear();
Ok(())
Expand Down

0 comments on commit 031b654

Please sign in to comment.