minor changes

This commit is contained in:
2017-06-06 15:03:33 +02:00
parent 2255904385
commit ba9559e5df
3 changed files with 34 additions and 0 deletions

View File

@@ -18,6 +18,18 @@ public:
return (txPower - (10 * pathLoss * std::log10(distance_m)));
}
// static float distanceAndRssiToPathLoss(const float txPower, const float rssi, const float distance_m) {
// const float delta = txPower - rssi;
// const float log = std::log10(distance_m) * 10.0f;
// const float res = delta/log;
// // sanity check
// const float err = std::abs(rssi - distanceToRssi(txPower, res, distance_m));
// if (err > 0.01) {throw Exception("error too high!");}
// return res;
// }
};
#include <vector>

View File

@@ -55,6 +55,17 @@ public:
}
/** does the model know the given AP? */
bool knowsAP(const MACAddress& accessPoint) {
// try to get the corresponding parameters
const auto it = accessPoints.find(accessPoint);
// AP known?
return (it != accessPoints.end());
}
virtual float getRSSI(const MACAddress& accessPoint, const Point3 position_m) const override {
// try to get the corresponding parameters

View File

@@ -107,6 +107,17 @@ public:
accessPoints.clear();
}
/** does the model know the given AP? */
bool knowsAP(const MACAddress& accessPoint) {
// try to get the corresponding parameters
const auto it = accessPoints.find(accessPoint);
// AP known?
return (it != accessPoints.end());
}
float getRSSI(const MACAddress& accessPoint, const Point3 position_m) const override {
// try to get the corresponding parameters