This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/sensors/pressure/BarometerData.h
kazu bb43e7f0fe fixed some compiler warnings
added equality checks to sensor-data classes
more robust sensor reader [fixed some issues]
added support for gps
added support for compass
added sensor-data-writer
added test-cases
minor changes
2017-03-21 16:25:36 +01:00

32 lines
546 B
C++

#ifndef BAROMETERDATA_H
#define BAROMETERDATA_H
#include <cmath>
/** data received from a barometer sensor */
struct BarometerData {
float hPa;
explicit BarometerData() : hPa(0) {;}
explicit BarometerData(const float hPa) : hPa(hPa) {;}
/** valid data? */
bool isValid() const {
return hPa == hPa;
}
bool operator == (const BarometerData& o ) const {
return EQ_OR_NAN(hPa, o.hPa);
}
private:
static inline bool EQ_OR_NAN(const float a, const float b) {return (a==b) || ( (a!=a) && (b!=b) );}
};
#endif // BAROMETERDATA_H