Commit a6b24548 authored by Lily Tsai's avatar Lily Tsai
Browse files

change start time of encounters to come from scan result time. need to doulbe check

parent 3ab31510
......@@ -16,7 +16,7 @@ public class SDDR_Native {
static public native void c_freeRadio();
static public native byte[] c_getMyAdvert();
static public native void c_changeEpoch();
static public native long c_processScanResult(int rssi, byte[] advert);
static public native long c_processScanResult(int rssi, byte[] advert, long time);
static public native void c_preDiscovery();
static public native void c_postDiscovery();
static public native byte[] c_getAdvertDHKey();
......@@ -241,7 +241,7 @@ public class ScannerProcessor {
final SDDR_Proto.Event.EncounterEvent subEvent = event.getEncounterEvent();
final SDDR_Proto.Event.EncounterEvent.EventType type = subEvent.getType();
final long time = System.currentTimeMillis();
final long time = subEvent.getTime();
final long pkid = subEvent.getPkid();
final String address = subEvent.getAddress();
......@@ -18,7 +18,6 @@ EbNHystPolicy::EbNHystPolicy(Scheme scheme, uint64_t minStartTime, uint64_t maxS
set<DeviceID> EbNHystPolicy::discovered(const list<DiscoverEvent> &events, list<pair<DeviceID, uint64_t>>& newlyDiscovered)
uint64_t time = getTimeMS();
set<DeviceID> toHandshake;
for(auto discIt = events.cbegin(); discIt != events.cend(); discIt++)
......@@ -31,12 +30,12 @@ set<DeviceID> EbNHystPolicy::discovered(const list<DiscoverEvent> &events, list<
// we haven't seen this device before! add it to newly discovered devices
if(infoIt == deviceInfo_.end())
infoIt = deviceInfo_.insert(make_pair(, DeviceInfo(time))).first;
infoIt = deviceInfo_.insert(make_pair(, DeviceInfo(discovery.time))).first;
LOG_P("EbNHystPolicy", "Inserting device info with id %d",;
newlyDiscovered.push_back(make_pair(, time));
newlyDiscovered.push_back(make_pair(, discovery.time));
DeviceInfo &info = infoIt->second;
info.lastTime = time;
info.lastTime = discovery.time;
if(discovery.rssi > rssiThreshold_)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment