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
74 lines
1.8 KiB
C++
74 lines
1.8 KiB
C++
#ifndef WIFIMEASUREMENT_H
|
|
#define WIFIMEASUREMENT_H
|
|
|
|
#include "AccessPoint.h"
|
|
#include "../../data/Timestamp.h"
|
|
|
|
/**
|
|
* describes a measurement received for one access-point at a given time
|
|
*/
|
|
class WiFiMeasurement {
|
|
|
|
private:
|
|
|
|
friend class VAPGrouper;
|
|
|
|
/** the access-point we got a measurement for */
|
|
AccessPoint ap;
|
|
|
|
/** the measured signal strength */
|
|
float rssi;
|
|
|
|
/** OPTIONAL. frequence the signal was received */
|
|
float freq = NAN;
|
|
|
|
/** OPTIONAL. timestamp the measurement was recorded at */
|
|
Timestamp ts;
|
|
|
|
public:
|
|
|
|
/** ctor */
|
|
WiFiMeasurement(const AccessPoint& ap, const float rssi) : ap(ap), rssi(rssi), freq(NAN) {
|
|
;
|
|
}
|
|
|
|
/** ctor with freq*/
|
|
WiFiMeasurement(const AccessPoint& ap, const float rssi, const float freq) : ap(ap), rssi(rssi), freq(freq) {
|
|
;
|
|
}
|
|
|
|
/** ctor with timestamp */
|
|
WiFiMeasurement(const AccessPoint& ap, const float rssi, const Timestamp ts) : ap(ap), rssi(rssi), ts(ts) {
|
|
;
|
|
}
|
|
|
|
/** ctor with timestamp and freq*/
|
|
WiFiMeasurement(const AccessPoint& ap, const float rssi, const float freq, const Timestamp ts) : ap(ap), rssi(rssi), freq(freq), ts(ts) {
|
|
;
|
|
}
|
|
|
|
public:
|
|
|
|
/** get the AP we got the measurement for */
|
|
const AccessPoint& getAP() const {return ap;}
|
|
|
|
/** get the measurement's signal strength */
|
|
float getRSSI() const {return rssi;}
|
|
|
|
/** OPTIONAL: get the measurement's timestamp (if known!) */
|
|
const Timestamp& getTimestamp() const {return ts;}
|
|
|
|
/** OPTIONAL: get the measurement's frequence (if known!) */
|
|
float getFrequency() const {return freq;}
|
|
|
|
/** set another signal strength */
|
|
void setRssi(float value){rssi = value;}
|
|
|
|
/** set the timestamp */
|
|
void setTimestamp(const Timestamp& val){ts = val;}
|
|
};
|
|
|
|
|
|
|
|
#endif // WIFIMEASUREMENT_H
|