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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user