disable active scanning mode, disable minor id check

This commit is contained in:
technyon
2024-06-16 04:38:47 +02:00
parent 386b8fa9e3
commit 8e2cae05d5
2 changed files with 4 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ void Scanner::initialize(const std::string& deviceName, const bool wantDuplicate
bleScan->setAdvertisedDeviceCallbacks(this, wantDuplicates); bleScan->setAdvertisedDeviceCallbacks(this, wantDuplicates);
bleScan->setInterval(interval); bleScan->setInterval(interval);
bleScan->setWindow(window); bleScan->setWindow(window);
bleScan->setActiveScan(true); bleScan->setActiveScan(false);
} }
void Scanner::update() { void Scanner::update() {

View File

@@ -154,7 +154,6 @@ void PresenceDetection::onResult(NimBLEAdvertisedDevice *device)
if(!found) if(!found)
{ {
std::shared_ptr<PdDevice> pdDevice = std::make_shared<PdDevice>(); std::shared_ptr<PdDevice> pdDevice = std::make_shared<PdDevice>();
int i=0; int i=0;
@@ -203,15 +202,15 @@ void PresenceDetection::onResult(NimBLEAdvertisedDevice *device)
BLEBeacon oBeacon = BLEBeacon(); BLEBeacon oBeacon = BLEBeacon();
oBeacon.setData(strManufacturerData); oBeacon.setData(strManufacturerData);
if(ENDIAN_CHANGE_U16(oBeacon.getMinor()) == 40004) // if(ENDIAN_CHANGE_U16(oBeacon.getMinor()) == 40004)
{ // {
pdDevice->timestamp = millis(); pdDevice->timestamp = millis();
strcpy(pdDevice->name, oBeacon.getProximityUUID().toString().c_str()); strcpy(pdDevice->name, oBeacon.getProximityUUID().toString().c_str());
{ {
std::lock_guard<std::mutex> lock(mtx); std::lock_guard<std::mutex> lock(mtx);
_devices[addr] = pdDevice; _devices[addr] = pdDevice;
} }
} // }
} }
} }
} }