Skip to main content

spawn_reader

Function spawn_reader 

Source
pub fn spawn_reader(
    running: Arc<AtomicBool>,
    device: impl Device + Send + 'static,
) -> (JoinHandle<()>, Receiver<DSUFrame>)
Expand description

Spawn a thread that reads from device and sends parsed frames over the returned channel.

The reader thread will exit when running is set to false. Returns a JoinHandle and a mpsc Receiver for receiving frame data.