diff --git a/README.md b/README.md index 2a2e7e4..e8ddc2a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ TODO: Example DVB-S2 tune: -``` +```rust let cmdseq = vec![ DtvProperty::new(DTV_DELIVERY_SYSTEM, SYS_DVBS2), DtvProperty::new(DTV_FREQUENCY, (11044 - 9750) * 1000), @@ -39,3 +39,20 @@ let cmdseq = vec![ let fe = FeDevice::open("/dev/dvb/adapter0/frontend0", true)?; fe.ioctl_set_property(&mut cmdseq)?; ``` + +Frontend information: + +```rust +let fe = FeDevice::open("/dev/dvb/adapter0/frontend0", false)?; +println!("{}", &fe); +``` + +Frontend status: + +```rust +let fe = FeDevice::open("/dev/dvb/adapter0/frontend0", false)?; +let mut status = FeStatus::default(); +status.read(&fe)?; +println!("{}", &status.display(1)); +``` + diff --git a/src/fe/status.rs b/src/fe/status.rs index 772e156..54c2951 100644 --- a/src/fe/status.rs +++ b/src/fe/status.rs @@ -177,7 +177,18 @@ impl FeStatus { /// Returns an object that implements `Display` for different verbosity levels /// Verbosity levels: /// 0 - single line status + /// ```text + /// Status:SCVYL S:-38.56dBm (59%) Q:14.57dB (70%) BER:0 UNC:0 + /// ``` + /// /// 1 - full report + /// ```text + /// Status: SIGNAL CARRIER FEC SYNC LOCK + /// Signal: -38.20dBm (59%) + /// SNR: 14.65dB (70%) + /// BER: 0 + /// UNC: 0 + /// ``` pub fn display(&self, verbose: u32) -> FeStatusDisplay { FeStatusDisplay { inner: self,