pub struct FeStatus { /* private fields */ }
Expand description
Frontend status
Implementations§
Source§impl FeStatus
impl FeStatus
Sourcepub fn get_delivery_system(&self) -> &Option<fe_delivery_system>
pub fn get_delivery_system(&self) -> &Option<fe_delivery_system>
Returns current delivery system
Sourcepub fn get_modulation(&self) -> &Option<fe_modulation>
pub fn get_modulation(&self) -> &Option<fe_modulation>
Returns current modulation
Sourcepub fn get_signal_strength_decibel(&self) -> &Option<f64>
pub fn get_signal_strength_decibel(&self) -> &Option<f64>
Returns Signal Strength in dBm
Sourcepub fn get_signal_strength(&self) -> &Option<u8>
pub fn get_signal_strength(&self) -> &Option<u8>
Returns Signal Strength in percentage
Sourcepub fn get_snr_decibel(&self) -> &Option<f64>
pub fn get_snr_decibel(&self) -> &Option<f64>
Returns Signal to noise ratio in dB
Sourcepub fn read(&mut self, fe: &FeDevice) -> Result<()>
pub fn read(&mut self, fe: &FeDevice) -> Result<()>
Reads frontend status with fallback to DVBv3 API
Examples found in repository?
examples/feinfo.rs (line 23)
6fn main() -> Result<()> {
7 let mut args = std::env::args().skip(1);
8
9 let adapter = match args.next() {
10 Some(v) => v.parse::<u32>().context("adapter number")?,
11 None => bail!("adapter number not defined"),
12 };
13
14 let device = match args.next() {
15 Some(v) => v.parse::<u32>().context("device number")?,
16 None => 0,
17 };
18
19 let fe = FeDevice::open_ro(adapter, device)?;
20 println!("{}", &fe);
21
22 let mut status = FeStatus::default();
23 status.read(&fe)?;
24 println!("Status: {}", &status);
25
26 Ok(())
27}
More examples
examples/femon.rs (line 25)
7fn main() -> Result<()> {
8 let mut args = std::env::args().skip(1);
9
10 let adapter = match args.next() {
11 Some(v) => v.parse::<u32>().context("adapter number")?,
12 None => bail!("adapter number not defined"),
13 };
14
15 let device = match args.next() {
16 Some(v) => v.parse::<u32>().context("device number")?,
17 None => 0,
18 };
19
20 let fe = FeDevice::open_ro(adapter, device)?;
21 let mut status = FeStatus::default();
22
23 let delay = Duration::from_secs(1);
24 loop {
25 status.read(&fe)?;
26 println!("{}", &status);
27 thread::sleep(delay);
28 }
29}
Trait Implementations§
Source§impl Display for FeStatus
Returns an object that implements Display
for different verbosity levels
impl Display for FeStatus
Returns an object that implements Display
for different verbosity levels
Tuner is turned off:
OFF
Tuner acquiring signal but has no lock:
NO-LOCK 0x01 | Signal -38.56dBm (59%)
NO-LOCK 0x03 | Signal -38.56dBm (59%) | Quality 5.32dB (25%)
Hex number after NO-LOCK
this is tuner status bit flags:
- 0x01 - has signal
- 0x02 - has carrier
- 0x04 - has viterbi
- 0x08 - has sync
- 0x10 - has lock
- 0x20 - timed-out
- 0x40 - re-init
Tuner has lock
LOCK dvb-s2 | Signal -38.56dBm (59%) | Quality 14.57dB (70%) | BER:0 | UNC:0
Auto Trait Implementations§
impl Freeze for FeStatus
impl RefUnwindSafe for FeStatus
impl Send for FeStatus
impl Sync for FeStatus
impl Unpin for FeStatus
impl UnwindSafe for FeStatus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more