libdvb 0.4.0

Interface for DVB-API v5 devices in Linux
Documentation
use std::{
    thread,
    time::Duration,
};

use libdvb::{
    FeDevice,
    FeStatus,
};

fn main() {
    let mut args = std::env::args().skip(1);

    let adapter = match args.next() {
        Some(v) => v.parse().unwrap(),
        None => 0,
    };

    let device = match args.next() {
        Some(v) => v.parse().unwrap(),
        None => 0,
    };

    let fe = FeDevice::open_ro(adapter, device).unwrap();
    let mut status = FeStatus::default();

    let delay = Duration::from_secs(1);
    loop {
        status.read(&fe).unwrap();
        println!("{}", status.to_status_string());
        thread::sleep(delay);
    }
}