2021-01-20 04:20:18 +01:00
|
|
|
use {
|
|
|
|
anyhow::{
|
2021-03-07 23:04:58 +01:00
|
|
|
bail,
|
2021-01-20 04:20:18 +01:00
|
|
|
Context,
|
|
|
|
Result,
|
|
|
|
},
|
|
|
|
|
|
|
|
libdvb::{
|
|
|
|
FeDevice,
|
|
|
|
FeStatus,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-03-07 23:04:58 +01:00
|
|
|
fn main() -> Result<()> {
|
|
|
|
let mut args = std::env::args().skip(1);
|
|
|
|
|
|
|
|
let adapter = match args.next() {
|
|
|
|
Some(v) => v.parse::<u32>().context("adapter number")?,
|
|
|
|
None => bail!("adapter number not defined"),
|
|
|
|
};
|
|
|
|
|
|
|
|
let device = match args.next() {
|
|
|
|
Some(v) => v.parse::<u32>().context("device number")?,
|
|
|
|
None => 0,
|
|
|
|
};
|
2021-01-20 04:20:18 +01:00
|
|
|
|
2021-03-07 23:04:58 +01:00
|
|
|
let fe = FeDevice::open(adapter, device, true)?;
|
2021-01-20 04:20:18 +01:00
|
|
|
println!("{}", &fe);
|
|
|
|
|
|
|
|
let mut status = FeStatus::default();
|
|
|
|
status.read(&fe)?;
|
2021-02-04 11:23:21 +01:00
|
|
|
println!("Status: {}", &status);
|
2021-01-29 18:45:49 +01:00
|
|
|
|
2021-01-20 04:20:18 +01:00
|
|
|
Ok(())
|
|
|
|
}
|