Add files via upload
This commit is contained in:
parent
3f45832864
commit
16eb8faaa8
@ -146,7 +146,7 @@ IRAM_ATTR void gap_callback_handler(esp_gap_ble_cb_event_t event,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
|
|
||||||
if ((p->scan_rst.ble_addr_type == BLE_ADDR_TYPE_RANDOM) ||
|
if ((p->scan_rst.ble_addr_type == BLE_ADDR_TYPE_RANDOM) ||
|
||||||
(p->scan_rst.ble_addr_type == BLE_ADDR_TYPE_RPA_RANDOM)) {
|
(p->scan_rst.ble_addr_type == BLE_ADDR_TYPE_RPA_RANDOM)) {
|
||||||
@ -210,7 +210,7 @@ esp_err_t register_ble_callback(void) {
|
|||||||
.scan_type = BLE_SCAN_TYPE_PASSIVE,
|
.scan_type = BLE_SCAN_TYPE_PASSIVE,
|
||||||
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
|
.own_addr_type = BLE_ADDR_TYPE_RANDOM,
|
||||||
|
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_WLIST_PRA_DIR,
|
.scan_filter_policy = BLE_SCAN_FILTER_ALLOW_WLIST_PRA_DIR,
|
||||||
// ADV_IND, ADV_NONCONN_IND, ADV_SCAN_IND packets are used for broadcasting
|
// ADV_IND, ADV_NONCONN_IND, ADV_SCAN_IND packets are used for broadcasting
|
||||||
// data in broadcast applications (e.g., Beacons), so we don't want them in
|
// data in broadcast applications (e.g., Beacons), so we don't want them in
|
||||||
@ -234,7 +234,7 @@ esp_err_t register_ble_callback(void) {
|
|||||||
} // register_ble_callback
|
} // register_ble_callback
|
||||||
|
|
||||||
void start_BLEscan(void) {
|
void start_BLEscan(void) {
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
ESP_LOGI(TAG, "Initializing bluetooth scanner ...");
|
ESP_LOGI(TAG, "Initializing bluetooth scanner ...");
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_coex_preference_set(
|
ESP_ERROR_CHECK(esp_coex_preference_set(
|
||||||
@ -254,7 +254,7 @@ void start_BLEscan(void) {
|
|||||||
} // start_BLEscan
|
} // start_BLEscan
|
||||||
|
|
||||||
void stop_BLEscan(void) {
|
void stop_BLEscan(void) {
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
ESP_LOGI(TAG, "Shutting down bluetooth scanner ...");
|
ESP_LOGI(TAG, "Shutting down bluetooth scanner ...");
|
||||||
ESP_ERROR_CHECK(esp_ble_gap_register_callback(NULL));
|
ESP_ERROR_CHECK(esp_ble_gap_register_callback(NULL));
|
||||||
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
||||||
|
@ -114,7 +114,7 @@ void init_display(const char *Productname, const char *Version) {
|
|||||||
u8x8.clear();
|
u8x8.clear();
|
||||||
u8x8.setPowerSave(!cfg.screenon); // set display off if disabled
|
u8x8.setPowerSave(!cfg.screenon); // set display off if disabled
|
||||||
u8x8.draw2x2String(0, 0, "PAX:0");
|
u8x8.draw2x2String(0, 0, "PAX:0");
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
u8x8.setCursor(0, 3);
|
u8x8.setCursor(0, 3);
|
||||||
u8x8.printf("BLTH:0");
|
u8x8.printf("BLTH:0");
|
||||||
#endif
|
#endif
|
||||||
@ -178,7 +178,7 @@ void refreshtheDisplay() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// update bluetooth counter + LoRa SF (line 3)
|
// update bluetooth counter + LoRa SF (line 3)
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
u8x8.setCursor(0, 3);
|
u8x8.setCursor(0, 3);
|
||||||
if (cfg.blescan)
|
if (cfg.blescan)
|
||||||
u8x8.printf("BLTH:%-5d", macs_ble);
|
u8x8.printf("BLTH:%-5d", macs_ble);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Basic Config
|
// Basic Config
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
#include "vendor_array.h"
|
#include "vendor_array.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
|
|||||||
int8_t beaconID; // beacon number in test monitor mode
|
int8_t beaconID; // beacon number in test monitor mode
|
||||||
uint16_t hashedmac; // temporary buffer for generated hash value
|
uint16_t hashedmac; // temporary buffer for generated hash value
|
||||||
uint32_t addr2int; // temporary buffer for shortened MAC
|
uint32_t addr2int; // temporary buffer for shortened MAC
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
uint32_t vendor2int; // temporary buffer for Vendor OUI
|
uint32_t vendor2int; // temporary buffer for Vendor OUI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
|
|||||||
addr2int = ((uint32_t)paddr[2]) | ((uint32_t)paddr[3] << 8) |
|
addr2int = ((uint32_t)paddr[2]) | ((uint32_t)paddr[3] << 8) |
|
||||||
((uint32_t)paddr[4] << 16) | ((uint32_t)paddr[5] << 24);
|
((uint32_t)paddr[4] << 16) | ((uint32_t)paddr[5] << 24);
|
||||||
|
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
vendor2int = ((uint32_t)paddr[2]) | ((uint32_t)paddr[1] << 8) |
|
vendor2int = ((uint32_t)paddr[2]) | ((uint32_t)paddr[1] << 8) |
|
||||||
((uint32_t)paddr[0] << 16);
|
((uint32_t)paddr[0] << 16);
|
||||||
// use OUI vendor filter list only on Wifi, not on BLE
|
// use OUI vendor filter list only on Wifi, not on BLE
|
||||||
@ -88,7 +88,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
|
|||||||
blink_LED(COLOR_GREEN, 50);
|
blink_LED(COLOR_GREEN, 50);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
else if (sniff_type == MAC_SNIFF_BLE) {
|
else if (sniff_type == MAC_SNIFF_BLE) {
|
||||||
macs_ble++; // increment BLE Macs counter
|
macs_ble++; // increment BLE Macs counter
|
||||||
#if (HAS_LED != NOT_A_PIN) || defined(HAS_RGB_LED)
|
#if (HAS_LED != NOT_A_PIN) || defined(HAS_RGB_LED)
|
||||||
@ -121,7 +121,7 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) {
|
|||||||
sniff_type == MAC_SNIFF_WIFI ? "WiFi" : "BLTH", rssi, buff,
|
sniff_type == MAC_SNIFF_WIFI ? "WiFi" : "BLTH", rssi, buff,
|
||||||
hashedmac, macs_wifi, macs_ble, getFreeRAM());
|
hashedmac, macs_wifi, macs_ble, getFreeRAM());
|
||||||
|
|
||||||
#ifdef VENDORFILTER
|
#if(VENDORFILTER)
|
||||||
} else {
|
} else {
|
||||||
// Very noisy
|
// Very noisy
|
||||||
// ESP_LOGD(TAG, "Filtered MAC %02X:%02X:%02X:%02X:%02X:%02X",
|
// ESP_LOGD(TAG, "Filtered MAC %02X:%02X:%02X:%02X:%02X:%02X",
|
||||||
|
@ -242,7 +242,7 @@ void setup() {
|
|||||||
|
|
||||||
// start BLE scan callback if BLE function is enabled in NVRAM configuration
|
// start BLE scan callback if BLE function is enabled in NVRAM configuration
|
||||||
// or switch off bluetooth, if not compiled
|
// or switch off bluetooth, if not compiled
|
||||||
#ifdef BLECOUNTER
|
#if(BLECOUNTER)
|
||||||
strcat_P(features, " BLE");
|
strcat_P(features, " BLE");
|
||||||
if (cfg.blescan) {
|
if (cfg.blescan) {
|
||||||
ESP_LOGI(TAG, "Starting Bluetooth...");
|
ESP_LOGI(TAG, "Starting Bluetooth...");
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
// Set this to include BLE counting and vendor filter functions
|
// Set this to include BLE counting and vendor filter functions
|
||||||
#define VENDORFILTER 1 // set to 0 if you want to count things, not people
|
#define VENDORFILTER 1 // set to 0 if you want to count things, not people
|
||||||
#define BLECOUNTER 1 // activate if you want to use BLE count, at expense of memory
|
#define BLECOUNTER 1 // set it to 1 if you want to use BLE count, at expense of memory
|
||||||
|
|
||||||
// BLE scan parameters
|
// BLE scan parameters
|
||||||
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below
|
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below
|
||||||
|
@ -38,7 +38,7 @@ void set_reset(uint8_t val[]) {
|
|||||||
break;
|
break;
|
||||||
case 9: // reset and ask for software update via Wifi OTA
|
case 9: // reset and ask for software update via Wifi OTA
|
||||||
ESP_LOGI(TAG, "Remote command: software update via Wifi");
|
ESP_LOGI(TAG, "Remote command: software update via Wifi");
|
||||||
#ifdef USE_OTA
|
#if(USE_OTA)
|
||||||
sprintf(display_line6, "Software update");
|
sprintf(display_line6, "Software update");
|
||||||
cfg.runmode = 1;
|
cfg.runmode = 1;
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user