Skip to main content

pamoja_ds18b20_thermometer_read

Function pamoja_ds18b20_thermometer_read 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ds18b20_thermometer_read( thermometer: *const PamojaDs18b20Thermometer, out_reading: *mut PamojaDs18b20Reading, ) -> PamojaStatus
Expand description

Reads a thermometer’s file, which makes the kernel run a conversion, and decodes it.

§Arguments

  • thermometer - the thermometer.
  • out_reading - receives the CRC-checked reading.

§Returns

PamojaStatus::Ok; PamojaStatus::InvalidArgument for a null argument; PamojaStatus::Io when the file cannot be read, because the 1-Wire overlay is off, the probe is gone, or the process may not read it; or PamojaStatus::Codec when the kernel or this decoder rejects the CRC.

§Safety

thermometer must be a live handle or null, and out_reading a writable pointer or null.