/// Initializes a new Metriful instance and fetches the current device status.
/// Returns an error if the device does not become ready within the configured
/// timeout or if current status cannot be read.
///
/// Note that this does not reset the device. The manual recommends doing so
/// before use; call [`Metriful::reset()`] to do so.
Initializes a new Metriful instance and fetches the current device status.
Returns an error if the device does not become ready within the configured
timeout or if current status cannot be read.

Note that this does not reset the device. The manual recommends doing so
before use; call [`Metriful::reset()`] to do so.
Initializes a new Metriful instance and fetches the current device status . Returns an error if the device does not become ready within the configured timeout or if current status cannot be read . Note that this does not reset the device . The manual recommends doing so before use ; call [ ` Metriful :: reset () ` ] to do so .
pub fn try_new_timeout(
    gpio_ready: u64,
    i2c_device: impl AsRef<Path>,
    i2c_address: u16,
    timeout: Option<Duration>
  ) -> Result<Metriful> {
    trace!(
      "Metriful::try_new_timeout({}, {}, {:x}, {:?})",
      gpio_ready, i2c_device.as_ref().display(), i2c_address, timeout
    );
    let ready_pin = Pin::new(gpio_ready);
    ready_pin.export()?;
    ready_pin.set_active_low(false)?;
    ready_pin.set_direction(Direction::In)?;
    let device = LinuxI2CDevice::new(i2c_device, i2c_address)?;
    let mut ret = Metriful {
      ready_pin,
      device,
      status: None
    };
    ret.wait_for_ready_timeout(timeout)?;
    ret.read_status()?;
    Ok(ret)
  }
pub fn try_new_timeout ( gpio_ready : u64 , i2c_device : impl AsRef < Path > , i2c_address : u16 , timeout : Option < Duration > ) -> Result < Metriful > { trace ! ( " " gpio_ready i2c_device as_ref ( ) display ( ) i2c_address timeout ) ; let ready_pin = Pin :: new ( gpio_ready ) ; ready_pin . export ( ) ? ; ready_pin . set_active_low ( false ) ? ; ready_pin . set_direction ( Direction :: In ) ? ; let device = LinuxI2CDevice :: new ( i2c_device , i2c_address ) ? ; let mut ret = Metriful { ready_pin , device , status : None } ; ret . wait_for_ready_timeout ( timeout ) ? ; ret . read_status ( ) ? ; Ok ( ret ) }
Initializes a new Metriful instance and fetches the current device status.
Initializes a new Metriful instance and fetches the current device status .
gpio_ready
u64
i2c_device
impl AsRef<Path>
i2c_address
u16
timeout
Option<Duration>