Go back to active scanning

This commit is contained in:
DTTerastar 2021-08-23 23:59:48 -04:00
parent 652dd888a2
commit 22da7f1e7f
2 changed files with 4 additions and 6 deletions

View File

@ -174,7 +174,7 @@ void BleFingerprint::setInitial(int initalRssi, float initalDistance)
bool BleFingerprint::report(JsonDocument *doc, int maxDistance)
{
if (id == nullptr && name == nullptr)
if (id.isEmpty() && name.isEmpty())
return false;
if (!hasValue)
@ -210,10 +210,8 @@ bool BleFingerprint::report(JsonDocument *doc, int maxDistance)
close = false;
}
if (id != nullptr)
(*doc)[F("id")] = id;
if (name != nullptr)
(*doc)[F("name")] = name;
if (!id.isEmpty()) (*doc)[F("id")] = id;
if (!name.isEmpty()) (*doc)[F("name")] = name;
(*doc)[F("rssi@1m")] = calRssi;
(*doc)[F("rssi")] = rssi;

View File

@ -61,7 +61,7 @@
#define CHANNEL String("presense")
// 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_WINDOW 30 // Used to determine antenna sharing between Bluetooth and WiFi. Do not modify unless you are confident you know what you're doing