2021-03-03 14:13:40 +01:00
|
|
|
#include "libpax_helpers.h"
|
|
|
|
|
2021-03-25 14:24:25 +01:00
|
|
|
// Local logging tag
|
|
|
|
static const char TAG[] = __FILE__;
|
|
|
|
|
2021-03-03 14:13:40 +01:00
|
|
|
// libpax payload
|
|
|
|
struct count_payload_t count_from_libpax;
|
|
|
|
uint16_t volatile libpax_macs_ble, libpax_macs_wifi;
|
|
|
|
|
|
|
|
void process_count(void) {
|
2021-03-25 14:24:25 +01:00
|
|
|
ESP_LOGD(TAG, "pax: %d / %d / %d", count_from_libpax.pax,
|
|
|
|
count_from_libpax.wifi_count, count_from_libpax.ble_count);
|
2021-03-03 14:13:40 +01:00
|
|
|
libpax_macs_ble = count_from_libpax.ble_count;
|
|
|
|
libpax_macs_wifi = count_from_libpax.wifi_count;
|
2021-04-01 12:17:46 +02:00
|
|
|
setSendIRQ();
|
2021-03-03 14:13:40 +01:00
|
|
|
}
|
|
|
|
|
2021-04-01 12:17:46 +02:00
|
|
|
void init_libpax(void) {
|
2021-04-13 01:57:02 +02:00
|
|
|
libpax_counter_init(process_count, &count_from_libpax,
|
|
|
|
cfg.sendcycle * 2 * 1000, cfg.countermode);
|
2021-03-25 10:30:38 +01:00
|
|
|
libpax_counter_start();
|
|
|
|
}
|