fixed some potential issues with MAC addresses

added corresponding test-cases
switched to newer version of tinyxml due to some issues
adjusted affected code-parts accordingly
for better re-use, moved ceiling-calculation to a new class
some minor fixes
new helper methods
worked on wifi-opt
This commit is contained in:
2017-03-20 11:19:57 +01:00
parent d065015f7d
commit 06e0e0a5aa
20 changed files with 1486 additions and 676 deletions

View File

@@ -7,11 +7,28 @@
#include "Floorplan.h"
#include "../../sensors/MACAddress.h"
/**
* helper methods for the floorplan
*/
class FloorplanHelper {
public:
/** get the AP for the given MAC [if available] */
static std::pair<Floorplan::AccessPoint*, Floorplan::Floor*> getAP(const Floorplan::IndoorMap* map, const MACAddress& mac) {
for (Floorplan::Floor* f : map->floors) {
for (Floorplan::AccessPoint* ap : f->accesspoints) {
if (MACAddress(ap->mac) == mac) {
return std::make_pair(ap, f);
}
}
}
return std::make_pair(nullptr, nullptr);
}
public:
/** align all floorplan values to the given grid size. needed for the grid factory */