pub fn execute_measurement(&mut self) -> Result<()> {
    let status = match &self.status {
      Some(status) => status,
      None => return Err(MetrifulError::StatusMissing)
    };

    if !matches!(status.mode, OperationalMode::Standby) {
      return Err(MetrifulError::InvalidMode {
        current: status.mode,
        required: OperationalMode::Standby
      });
    }

    self.ensure_ready()?;

    self.device.smbus_write_byte(0xE1)?;
    self.sleep_write();

    trace!("Metriful::execute_measurement(): done");

    Ok(())
  }
/// Executes an on-demand measurement.
///
/// Notes:
///  * Device must currently be in READY state
///  * Device must be in standby mode
Executes an on-demand measurement.
Notes:
Device must currently be in READY state
Device must be in standby mode
Executes an on - demand measurement . Notes : Device must currently be in READY state Device must be in standby mode
pub fn execute_measurement(&mut self) -> Result<()> {
    let status = match &self.status {
      Some(status) => status,
      None => return Err(MetrifulError::StatusMissing)
    };
    if !matches!(status.mode, OperationalMode::Standby) {
      return Err(MetrifulError::InvalidMode {
        current: status.mode,
        required: OperationalMode::Standby
      });
    }
    self.ensure_ready()?;
    self.device.smbus_write_byte(0xE1)?;
    self.sleep_write();
    trace!("Metriful::execute_measurement(): done");
    Ok(())
  }
pub fn execute_measurement ( & mut self ) -> Result < ( ) > { let status = match & self . status { Some ( status ) => status , None => return Err ( MetrifulError :: StatusMissing ) } ; if ! matches ! ( status mode OperationalMode Standby ) { return Err ( MetrifulError :: InvalidMode { current : status . mode , required : OperationalMode :: Standby } ) ; } self . ensure_ready ( ) ? ; self . device . smbus_write_byte ( 0xE1 ) ? ; self . sleep_write ( ) ; trace ! ( " " ) ; Ok ( ( ) ) }
Executes an on-demand measurement.
Executes an on - demand measurement .
&mut self
&mut self