Skip to main content

pamoja_ds18b20_thermometer_new

Function pamoja_ds18b20_thermometer_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ds18b20_thermometer_new( serial: *const c_char, out_thermometer: *mut *mut PamojaDs18b20Thermometer, ) -> PamojaStatus
Expand description

Names a DS18B20 the kernel serves by the serial in its directory name, reading /sys/bus/w1/devices/28-<serial>/w1_slave.

§Arguments

  • serial - the twelve hex digits after 28-.
  • out_thermometer - receives the thermometer.

§Returns

PamojaStatus::Ok, or PamojaStatus::InvalidArgument for a null or non-UTF-8 argument. Nothing is read until pamoja_ds18b20_thermometer_read.

§Safety

serial must be a null-terminated string or null, and out_thermometer a writable pointer or null.