disable active scanning mode, disable minor id check
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user