Synopsis
CTL_STATUS_t ctl_pressure_sensor_measure(CTL_PRESSURE_SENSOR_t *self,
                                         float *pressure,
                                         float *temperature);
Description

ctl_pressure_sensor_measure samples the pressure sensor self and reports the barometric pressure in pascals to pressure and the temperature in degrees Celsius to temperature. If the pressure sensor is not capable of sampling temperature, the temperature is substituted with NaN to indicate to the client that temperature measurement is not possible.

Both pressure and temperature can be null pointers indicating that the particular measurement is not required.

Return Value

ctl_pressure_sensor_measure returns a standard status code. If the status indicates an error, the returned sample data is undefined.

Thread Safety

ctl_pressure_sensor_measure is thread-safe if the method measure is thread-safe. Typically, for SPI and I2C transports, you ensure thread safety by associating a mutex with the bus used by the transport.