Skip to content
Snippets Groups Projects
Commit 5ff1090b authored by Federico Lolli's avatar Federico Lolli
Browse files

removed CTS control (unavailable on macos)

parent 9b812975
Branches
No related tags found
No related merge requests found
...@@ -73,27 +73,14 @@ fn main() { ...@@ -73,27 +73,14 @@ fn main() {
let mut start: Option<Instant> = None; let mut start: Option<Instant> = None;
let mut times = Vec::new(); let mut times = Vec::new();
loop {
// wait clear to send
port.write_request_to_send(true).expect("Unable to set RTS");
while !port.read_clear_to_send().expect("Unable to read CTS") {
std::thread::sleep(Duration::from_millis(100));
debug!("waiting for CTS");
}
// send packet if there is one // send packet if there is one
if let Some(packet) = packets.wait_next() { while let Some(packet) = packets.wait_next() {
if let Some(t) = start { if let Some(t) = start {
times.push(t.elapsed().as_millis()); times.push(t.elapsed().as_millis());
} }
start = Some(Instant::now()); start = Some(Instant::now());
write_port.write_packet(packet.to_owned()); write_port.write_packet(packet.to_owned());
debug!("sent packet ({}/{})", packets.index, packets.packets.len()); debug!("sent packet ({}/{})", packets.index, packets.packets.len());
port.write_request_to_send(false)
.expect("Unable to set RTS");
} else {
break;
}
// wait ACK // wait ACK
loop { loop {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment