- some should be the same as previous commit (sorry!) - some should be new: LINT checks, ...?
38 lines
783 B
C++
38 lines
783 B
C++
#ifndef WIFIMEASUREMENTS_H
|
|
#define WIFIMEASUREMENTS_H
|
|
|
|
#include <vector>
|
|
|
|
#include "WiFiMeasurement.h"
|
|
|
|
/**
|
|
* group of several wifi measurements
|
|
*/
|
|
struct WiFiMeasurements {
|
|
|
|
/** all contained measurements */
|
|
std::vector<WiFiMeasurement> entries;
|
|
|
|
/** convert to string */
|
|
std::string asString() const {
|
|
std::string res;
|
|
for (const WiFiMeasurement& m : entries) {
|
|
res += m.getAP().getMAC().asString() + ": " + std::to_string(m.getRSSI()) + "\n";
|
|
}
|
|
return res;
|
|
}
|
|
|
|
/** get the measurements for the given MAC [if available] otherwise null */
|
|
const WiFiMeasurement* getForMac(const MACAddress& mac) const {
|
|
for (const WiFiMeasurement& m : entries) {
|
|
if (m.getAP().getMAC() == mac) {
|
|
return &m;
|
|
}
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
};
|
|
|
|
#endif // WIFIMEASUREMENTS_H
|