Virtual Barometric Pressure Sensor Interface.  
 More...
#include <barometric_pressure_sensor.h>
|  | 
| bool(* | readPressure )(uint32_t *const pressure) | 
|  | Read the current pressure from the device.  More... 
 | 
|  | 
Virtual Barometric Pressure Sensor Interface. 
A standard interface for a device which can measure barometric pressure.
This is a simple interface, which only provides the ability to read the current sample.
Fundamental Assumptions
- The device produces barometric pressure readings
- This device reports barometric pressure in hectopascal (hPa)
- The reported barometric pressure reading will be compensated for ambient temperature by the implementation if it is required.
- Pressure will be formatted as a 32-bit fixed-point integer with format UQ22.10, giving a resolution of 0.001 hPa.
- The device will indicate whether the current sample is valid or invalid
Implementation Notes
- This interface, at its core, appears to be blocking. However, you can still implement this interface in a non-blocking way. For example, you could always return the most recent altitude measurement, while there is another thread (or a timer) that handles updates to that measurement asynchronously. 
Definition at line 52 of file barometric_pressure_sensor.h.
◆ readPressure
      
        
          | bool(* BarometricPressureSensor::readPressure) (uint32_t *const pressure) | 
      
 
Read the current pressure from the device. 
- Precondition
- The pressure sensor has been properly initialized by the system. 
- 
The pressure parameter is not NULL. 
- Postcondition
- If the measurement is valid, the data pointed to by the pressure parameter will be updated with the latest reading. 
- 
If the measurement is invalid, the data pointed to by the pressure parameter will remain unchanged.
- Parameters
- 
  
    | [in,out] | pressure | Pointer which will be used for storing the latest pressure reading. This pointer must not be null. |  
 
Pressure will be formatted as a 32-bit fixed-point integer with format UQ22.10, giving a resolution of 0.001 hPa.
- Returns
- True if the sample is valid, false if invalid (e.g., an error occured) 
Definition at line 72 of file barometric_pressure_sensor.h.
 
 
The documentation for this struct was generated from the following file: