fix: etherdream: use sleep instead of ping

This commit is contained in:
alban 2024-08-14 13:16:18 +02:00
parent 650a3ed521
commit 89d38f51ec

View File

@ -169,18 +169,19 @@ impl Device for EtherdreamDevice {
line: Vec<Point>,
_speed: u32,
) -> LJResult<()> {
let chunk_size = 111;
let chunk_size = 512;
let points_iter = line.into_iter();
for chunk in points_iter.as_slice().chunks(chunk_size) {
debug!("New chunk length: {:?}", chunk.len());
loop {
let capacity = self.points_capacity();
debug!("capacity : {:?}", capacity);
loop {
if chunk.len() > capacity as usize {
debug!("Sleep");
// Sleep for 1/100th of a sec
sleep(Duration::new(0, 10_000_000));
self.ping();
sleep(Duration::new(0, 100_000_000));
break;
// self.ping();
} else {
break;
}