From 8e2cae05d5f03841fcc2b863eede4d5db00b3100 Mon Sep 17 00:00:00 2001 From: technyon Date: Sun, 16 Jun 2024 04:38:47 +0200 Subject: [PATCH] disable active scanning mode, disable minor id check --- lib/BleScanner/src/BleScanner.cpp | 2 +- src/PresenceDetection.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/BleScanner/src/BleScanner.cpp b/lib/BleScanner/src/BleScanner.cpp index ba190c6..4509bd7 100644 --- a/lib/BleScanner/src/BleScanner.cpp +++ b/lib/BleScanner/src/BleScanner.cpp @@ -32,7 +32,7 @@ void Scanner::initialize(const std::string& deviceName, const bool wantDuplicate bleScan->setAdvertisedDeviceCallbacks(this, wantDuplicates); bleScan->setInterval(interval); bleScan->setWindow(window); - bleScan->setActiveScan(true); + bleScan->setActiveScan(false); } void Scanner::update() { diff --git a/src/PresenceDetection.cpp b/src/PresenceDetection.cpp index cab5d59..64cac63 100644 --- a/src/PresenceDetection.cpp +++ b/src/PresenceDetection.cpp @@ -154,7 +154,6 @@ void PresenceDetection::onResult(NimBLEAdvertisedDevice *device) if(!found) { - std::shared_ptr pdDevice = std::make_shared(); int i=0; @@ -203,15 +202,15 @@ void PresenceDetection::onResult(NimBLEAdvertisedDevice *device) BLEBeacon oBeacon = BLEBeacon(); oBeacon.setData(strManufacturerData); - if(ENDIAN_CHANGE_U16(oBeacon.getMinor()) == 40004) - { +// if(ENDIAN_CHANGE_U16(oBeacon.getMinor()) == 40004) +// { pdDevice->timestamp = millis(); strcpy(pdDevice->name, oBeacon.getProximityUUID().toString().c_str()); { std::lock_guard lock(mtx); _devices[addr] = pdDevice; } - } +// } } } }