diff --git a/platformio.ini b/platformio.ini index 40445272..fff50de0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,10 +11,10 @@ ; ---> SELECT TARGET PLATFORM HERE! <--- [platformio] -;env_default = heltec_wifi_lora_32 +env_default = heltec_wifi_lora_32 ;env_default = ttgov1 ;env_default = ttgov2 -env_default = lopy +;env_default = lopy ;env_default = lopy4 ;env_default = lolin32lite_lora ;env_default = lolin32_lora diff --git a/src/blecsan.cpp b/src/blecsan.cpp index 415ec045..4e028aaf 100644 --- a/src/blecsan.cpp +++ b/src/blecsan.cpp @@ -139,7 +139,8 @@ static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_pa #endif // add this device and show new count total if it was not previously added - mac_add((uint8_t *) p->scan_rst.bda, p->scan_rst.rssi, MAC_SNIFF_BLE); + if (cfg.blescan) // count only if BLE scan is enabled + mac_add((uint8_t *) p->scan_rst.bda, p->scan_rst.rssi, MAC_SNIFF_BLE); break; skip: diff --git a/src/main.cpp b/src/main.cpp index 31ac22aa..2bfadabd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -536,10 +536,11 @@ void loop() { u8x8.setCursor(0,4); u8x8.printf("WIFI: %-4d", (int) wifis.size()); #ifdef BLECOUNTER - if (cfg.blescan) { u8x8.setCursor(0,3); - u8x8.printf("BLTH: %-4d", (int) bles.size()); - } + if (cfg.blescan) + u8x8.printf("BLTH: %-4d", (int) bles.size()); + else + u8x8.printf("%-16s", "BLTH: off"); #endif // update wifi channel display (line 4) diff --git a/src/main.h b/src/main.h index 43a2b08c..490fea31 100644 --- a/src/main.h +++ b/src/main.h @@ -1,7 +1,7 @@ #pragma once // program version - note: increment version after modifications to configData_t struct!! -#define PROGVERSION "1.3.0" // use max 10 chars here! +#define PROGVERSION "1.3.01" // use max 10 chars here! #define PROGNAME "PAXCNT" // Verbose enables serial output diff --git a/src/rcommand.cpp b/src/rcommand.cpp index ac2ac1b5..29ed2f1c 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -150,11 +150,15 @@ void set_loraadr(int val) { void set_blescan(int val) { ESP_LOGI(TAG, "Remote command: set BLE scan mode to %s", val ? "on" : "off"); switch (val) { - case 1: cfg.blescan = val; break; - default: - cfg.blescan = 0; - btStop(); - break; + case 0: + cfg.blescan = 0; + #ifdef BLECOUNTER + bles.clear(); // clear BLE macs container + #endif + break; + default: + cfg.blescan = 1; + break; } };