Go back to active scanning
This commit is contained in:
parent
652dd888a2
commit
22da7f1e7f
|
@ -174,7 +174,7 @@ void BleFingerprint::setInitial(int initalRssi, float initalDistance)
|
||||||
|
|
||||||
bool BleFingerprint::report(JsonDocument *doc, int maxDistance)
|
bool BleFingerprint::report(JsonDocument *doc, int maxDistance)
|
||||||
{
|
{
|
||||||
if (id == nullptr && name == nullptr)
|
if (id.isEmpty() && name.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!hasValue)
|
if (!hasValue)
|
||||||
|
@ -210,10 +210,8 @@ bool BleFingerprint::report(JsonDocument *doc, int maxDistance)
|
||||||
close = false;
|
close = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id != nullptr)
|
if (!id.isEmpty()) (*doc)[F("id")] = id;
|
||||||
(*doc)[F("id")] = id;
|
if (!name.isEmpty()) (*doc)[F("name")] = name;
|
||||||
if (name != nullptr)
|
|
||||||
(*doc)[F("name")] = name;
|
|
||||||
|
|
||||||
(*doc)[F("rssi@1m")] = calRssi;
|
(*doc)[F("rssi@1m")] = calRssi;
|
||||||
(*doc)[F("rssi")] = rssi;
|
(*doc)[F("rssi")] = rssi;
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
#define CHANNEL String("presense")
|
#define CHANNEL String("presense")
|
||||||
|
|
||||||
// Define bluetooth scan parameters
|
// Define bluetooth scan parameters
|
||||||
#define BLE_ACTIVE_SCAN false // Active scan uses more power, but get results faster
|
#define BLE_ACTIVE_SCAN true // Active scan uses more power, but get results faster
|
||||||
|
|
||||||
#define BLE_SCAN_INTERVAL 40 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
|
#define BLE_SCAN_INTERVAL 40 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
|
||||||
#define BLE_SCAN_WINDOW 30 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
|
#define BLE_SCAN_WINDOW 30 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing
|
||||||
|
|
Loading…
Reference in New Issue