libpax integration code sanitizations

This commit is contained in:
cyberman54 2021-03-25 14:24:25 +01:00
parent 5777df2c48
commit d08914a219
2 changed files with 11 additions and 6 deletions

View File

@ -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;
}

View File

@ -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) {