diff --git a/owlps-positioning/src/stock.cc b/owlps-positioning/src/stock.cc index e14002a..ce4a12e 100644 --- a/owlps-positioning/src/stock.cc +++ b/owlps-positioning/src/stock.cc @@ -300,6 +300,21 @@ double Stock::ap_matrix_get_ss(const std::string &mac_transmitter, } +/** + * @returns \em true if \em coord are the coordinates of an existing + * AP, \em false if not. + */ +bool Stock::is_ap_coordinate(const Point3D &coord) +{ + for (unordered_map::const_iterator ap = + aps.begin() ; ap != aps.end() ; ++ap) + if (ap->second.get_coordinates() == coord) + return true ; + + return false ; +} + + /* *** ReferencePoint operations *** */ diff --git a/owlps-positioning/src/stock.hh b/owlps-positioning/src/stock.hh index dd8cb91..fb8a50a 100644 --- a/owlps-positioning/src/stock.hh +++ b/owlps-positioning/src/stock.hh @@ -108,8 +108,12 @@ public: static AccessPoint& getw_ap(const std::string &mac) ; /// Updates the friis indexes of all the APs static void update_all_friis_indexes(void) ; + /// \brief Returns the signal strenth received by an AP mac_receiver + /// from an AP mac_transmitter static double ap_matrix_get_ss(const std::string &mac_transmitter, const std::string &mac_receiver) ; + /// Checks if a Point3D is the coordinate of an existing AP + static bool is_ap_coordinate(const Point3D &coord) ; //@} /** @name ReferencePoint operations */