Struct FeStatus

Source
pub struct FeStatus { /* private fields */ }
Expand description

Frontend status

Implementations§

Source§

impl FeStatus

Source

pub fn get_delivery_system(&self) -> &Option<fe_delivery_system>

Returns current delivery system

Source

pub fn get_modulation(&self) -> &Option<fe_modulation>

Returns current modulation

Source

pub fn get_signal_strength_decibel(&self) -> &Option<f64>

Returns Signal Strength in dBm

Source

pub fn get_signal_strength(&self) -> &Option<u8>

Returns Signal Strength in percentage

Source

pub fn get_snr_decibel(&self) -> &Option<f64>

Returns Signal to noise ratio in dB

Source

pub fn get_snr(&self) -> &Option<u8>

Returns Signal Strength in percentage

Source

pub fn get_ber(&self) -> &Option<u64>

Returns BER value if available

Source

pub fn get_unc(&self) -> &Option<u64>

Returns UNC value if available

Source

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
Hide additional 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 Debug for FeStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FeStatus

Source§

fn default() -> FeStatus

Returns the “default value” for a type. Read more
Source§

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
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.