bugfixes in bluetooth on/off (still not fixed)

This commit is contained in:
Klaus K Wilting 2018-04-16 22:48:00 +02:00
parent 791f4e4555
commit e69c911586
5 changed files with 18 additions and 12 deletions

View File

@ -11,10 +11,10 @@
; ---> SELECT TARGET PLATFORM HERE! <--- ; ---> SELECT TARGET PLATFORM HERE! <---
[platformio] [platformio]
;env_default = heltec_wifi_lora_32 env_default = heltec_wifi_lora_32
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
env_default = lopy ;env_default = lopy
;env_default = lopy4 ;env_default = lopy4
;env_default = lolin32lite_lora ;env_default = lolin32lite_lora
;env_default = lolin32_lora ;env_default = lolin32_lora

View File

@ -139,7 +139,8 @@ static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_pa
#endif #endif
// add this device and show new count total if it was not previously added // 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; break;
skip: skip:

View File

@ -536,10 +536,11 @@ void loop() {
u8x8.setCursor(0,4); u8x8.setCursor(0,4);
u8x8.printf("WIFI: %-4d", (int) wifis.size()); u8x8.printf("WIFI: %-4d", (int) wifis.size());
#ifdef BLECOUNTER #ifdef BLECOUNTER
if (cfg.blescan) {
u8x8.setCursor(0,3); 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 #endif
// update wifi channel display (line 4) // update wifi channel display (line 4)

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
// program version - note: increment version after modifications to configData_t struct!! // 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" #define PROGNAME "PAXCNT"
// Verbose enables serial output // Verbose enables serial output

View File

@ -150,10 +150,14 @@ void set_loraadr(int val) {
void set_blescan(int val) { void set_blescan(int val) {
ESP_LOGI(TAG, "Remote command: set BLE scan mode to %s", val ? "on" : "off"); ESP_LOGI(TAG, "Remote command: set BLE scan mode to %s", val ? "on" : "off");
switch (val) { switch (val) {
case 1: cfg.blescan = val; break; case 0:
default:
cfg.blescan = 0; cfg.blescan = 0;
btStop(); #ifdef BLECOUNTER
bles.clear(); // clear BLE macs container
#endif
break;
default:
cfg.blescan = 1;
break; break;
} }
}; };