Crates.io | serialport_low_latency |
lib.rs | serialport_low_latency |
version | 0.1.1 |
source | src |
created_at | 2023-06-27 18:14:05.924688 |
updated_at | 2024-07-12 19:57:13.182256 |
description | Enable or disable low latency mode for serial ports on Linux. |
homepage | https://github.com/michaellass/serialport_low_latency/ |
repository | https://github.com/michaellass/serialport_low_latency.git |
max_upload_size | |
id | 901509 |
size | 11,536 |
FTDI serial communication chips support a low latency mode where the latency timer is reduced to 1 ms. This package allows enabling and disabling this low latency mode on Linux via the TIOCSSERIAL ioctl.
use std::time::Duration;
use serialport_low_latency::enable_low_latency;
let mut port = serialport::new("/dev/ttyUSB0", 115_200)
.timeout(Duration::from_millis(10))
.open_native().expect("Failed to open port");
enable_low_latency(&mut port).unwrap();
use std::time::Duration;
use serialport_low_latency::disable_low_latency;
let mut port = serialport::new("/dev/ttyUSB0", 115_200)
.timeout(Duration::from_millis(10))
.open_native().expect("Failed to open port");
disable_low_latency(&mut port).unwrap();