Change-Id: I0fd849c7e6533edbd90142d3eff17196cab51716
Signed-off-by: Marcin Masternak <m.masternak@samsung.com>
#define _CONTEXT_MYPLACE_TYPES_H_
#include <string>
+#include <map>
#include <ctime>
#define PLACE_DETECTION_SUBJECT "place/pattern/personal_poi"
std::string name; // for now: "work"/"home"/"other"
bool locationValid;
Location location; // makes sense if locationValid == true;
- std::string wifiAps; // WiFi APs MAC addresses separated by ","
+ std::map<std::string, std::string> wifiAps; // WiFi APs MAC addresses to corresponding network name map
time_t createDate; // The last update time of this place
}; /* class Place */
SO_EXPORT bool ctx::operator==(const ctx::Place &p1, const ctx::Place &p2)
{
- return p1.categId == p2.categId
+ bool ret = p1.categId == p2.categId
&& p1.categConfidence == p2.categConfidence
&& p1.name == p2.name
&& p1.locationValid == p2.locationValid
&& p1.location.accuracy == p2.location.accuracy
&& p1.wifiAps == p2.wifiAps
&& p1.createDate == p2.createDate;
+ if (ret) {
+ for (std::pair<std::string, std::string> ap : p1.wifiAps) {
+ if (p2.wifiAps.find(ap.first) == p2.wifiAps.end()) {
+ ret = false;
+ break;
+ }
+ }
+ }
+ return ret;
+
}