Skip to main content

pamoja_scd4x_sim_reporting

Function pamoja_scd4x_sim_reporting 

Source
#[unsafe(no_mangle)]
pub extern "C" fn pamoja_scd4x_sim_reporting( co2_ppm: u16, celsius: f32, relative_humidity: f32, ) -> *mut PamojaI2cPart
Expand description

Creates a simulated SCD4x that reads what it is asked to. It answers the serial number, data-ready, and measurement commands, and always has a result waiting.

§Arguments

  • co2_ppm - the carbon dioxide it reports, in parts per million.
  • celsius - the temperature it reports.
  • relative_humidity - the humidity it reports, as a percentage.

§Returns

The part, which the caller releases with crate::hal::pamoja_i2c_part_free.