diff --git a/src/libpax_helpers.cpp b/src/libpax_helpers.cpp index b637d226..b1f88336 100644 --- a/src/libpax_helpers.cpp +++ b/src/libpax_helpers.cpp @@ -1,12 +1,15 @@ #include "libpax_helpers.h" +// Local logging tag +static const char TAG[] = __FILE__; + // libpax payload struct count_payload_t count_from_libpax; uint16_t volatile libpax_macs_ble, libpax_macs_wifi; void process_count(void) { - printf("pax: %d; %d; %d;\n", count_from_libpax.pax, - count_from_libpax.wifi_count, count_from_libpax.ble_count); + ESP_LOGD(TAG, "pax: %d / %d / %d", count_from_libpax.pax, + count_from_libpax.wifi_count, count_from_libpax.ble_count); libpax_macs_ble = count_from_libpax.ble_count; libpax_macs_wifi = count_from_libpax.wifi_count; } diff --git a/src/main.cpp b/src/main.cpp index 79ebb1c1..62a27cc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -305,16 +305,18 @@ void setup() { #if (defined WIFICOUNTER || defined BLECOUNTER) struct libpax_config_t configuration; libpax_default_config(&configuration); - ESP_LOGI(TAG, "BLESCAN: %d", cfg.blescan); - ESP_LOGI(TAG, "WIFISCAN: %d", cfg.wifiscan); - configuration.wificounter = cfg.wifiscan; - configuration.blecounter = cfg.blescan; + // configure WIFI sniffing + configuration.wificounter = cfg.wifiscan; configuration.wifi_channel_map = WIFI_CHANNEL_ALL; configuration.wifi_channel_switch_interval = cfg.wifichancycle; configuration.wifi_rssi_threshold = cfg.rssilimit; + ESP_LOGI(TAG, "WIFISCAN: %s", cfg.wifiscan ? "on" : "off"); + // configure BLE sniffing + configuration.blecounter = cfg.blescan; configuration.blescantime = cfg.blescantime; + ESP_LOGI(TAG, "BLESCAN: %s", cfg.blescan ? "on" : "off"); int config_update = libpax_update_config(&configuration); if (config_update != 0) {