scan performance optimizations
This commit is contained in:
parent
9bdc7291d8
commit
30178bbf43
@ -161,7 +161,7 @@ Note: all settings are stored in NVRAM and will be reloaded when device starts.
|
|||||||
0x0C set Bluetooth channel switch interval timer
|
0x0C set Bluetooth channel switch interval timer
|
||||||
|
|
||||||
0 ... 255 duration for scanning one bluetooth channel in seconds/100
|
0 ... 255 duration for scanning one bluetooth channel in seconds/100
|
||||||
e.g. 1 -> each channel is scanned for 10 milliseconds [default]
|
e.g. 3 -> each channel is scanned for 30 milliseconds [default]
|
||||||
|
|
||||||
0x0D (NOT YET IMPLEMENTED) set BLE and WIFI vendorfilter mode
|
0x0D (NOT YET IMPLEMENTED) set BLE and WIFI vendorfilter mode
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ build_flags =
|
|||||||
; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---
|
; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---
|
||||||
; otherwise device may crash in dense environments due to serial buffer overflow
|
; otherwise device may crash in dense environments due to serial buffer overflow
|
||||||
;
|
;
|
||||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
|
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE
|
||||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
|
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
|
||||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
|
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
|
||||||
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
||||||
;
|
;
|
||||||
|
@ -88,8 +88,8 @@ static const char *btsig_gap_type(uint32_t gap_type) {
|
|||||||
}
|
}
|
||||||
} // btsig_gap_type
|
} // btsig_gap_type
|
||||||
|
|
||||||
|
// using IRAM_:ATTR here to speed up callback function
|
||||||
static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
IRAM_ATTR static void gap_callback_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
||||||
{
|
{
|
||||||
esp_ble_gap_cb_param_t *p = (esp_ble_gap_cb_param_t *)param;
|
esp_ble_gap_cb_param_t *p = (esp_ble_gap_cb_param_t *)param;
|
||||||
esp_err_t status;
|
esp_err_t status;
|
||||||
@ -188,7 +188,7 @@ esp_err_t register_ble_functionality(void)
|
|||||||
|
|
||||||
// This function is called to occur gap event, such as scan result.
|
// This function is called to occur gap event, such as scan result.
|
||||||
//register the scan callback function to the gap module
|
//register the scan callback function to the gap module
|
||||||
status = esp_ble_gap_register_callback(gap_callback_handler);
|
status = esp_ble_gap_register_callback(&gap_callback_handler);
|
||||||
if (status != ESP_OK)
|
if (status != ESP_OK)
|
||||||
{
|
{
|
||||||
ESP_LOGE(TAG, "esp_ble_gap_register_callback: rc=%d", status);
|
ESP_LOGE(TAG, "esp_ble_gap_register_callback: rc=%d", status);
|
||||||
@ -226,11 +226,11 @@ esp_err_t register_ble_functionality(void)
|
|||||||
|
|
||||||
void stop_BLEscan(void){
|
void stop_BLEscan(void){
|
||||||
ESP_LOGI(TAG, "Shutting BT Down ...");
|
ESP_LOGI(TAG, "Shutting BT Down ...");
|
||||||
esp_ble_gap_register_callback(NULL);
|
ESP_ERROR_CHECK(esp_ble_gap_register_callback(NULL));
|
||||||
esp_bluedroid_disable();
|
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
||||||
esp_bluedroid_deinit();
|
ESP_ERROR_CHECK(esp_bluedroid_deinit());
|
||||||
esp_bt_controller_disable();
|
ESP_ERROR_CHECK(esp_bt_controller_disable());
|
||||||
esp_bt_controller_deinit();
|
ESP_ERROR_CHECK(esp_bt_controller_deinit());
|
||||||
}
|
}
|
||||||
|
|
||||||
void start_BLEscan(void){
|
void start_BLEscan(void){
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
*
|
*
|
||||||
* Read the values from TTN console (or whatever applies), insert them here,
|
* Read the values from TTN console (or whatever applies), insert them here,
|
||||||
* and rename this file to src/loraconf.h
|
* and rename this file to src/loraconf.h
|
||||||
|
*
|
||||||
|
* Note that DEVEUI, APPEUI and APPKEY should all be specified in MSB format.
|
||||||
|
* (This is different from standard LMIC-Arduino which expects DEVEUI and APPEUI in LSB format.)
|
||||||
|
|
||||||
* Set your DEVEUI here, if you have one. You can leave this untouched,
|
* Set your DEVEUI here, if you have one. You can leave this untouched,
|
||||||
* then the DEVEUI will be generated during runtime from device's MAC adress
|
* then the DEVEUI will be generated during runtime from device's MAC adress
|
||||||
|
@ -102,7 +102,8 @@ void wifi_sniffer_set_channel(uint8_t channel) {
|
|||||||
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
|
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wifi_sniffer_packet_handler(void* buff, wifi_promiscuous_pkt_type_t type) {
|
// using IRAM_:ATTR here to speed up callback function
|
||||||
|
IRAM_ATTR void wifi_sniffer_packet_handler(void* buff, wifi_promiscuous_pkt_type_t type) {
|
||||||
const wifi_promiscuous_pkt_t *ppkt = (wifi_promiscuous_pkt_t *)buff;
|
const wifi_promiscuous_pkt_t *ppkt = (wifi_promiscuous_pkt_t *)buff;
|
||||||
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)ppkt->payload;
|
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)ppkt->payload;
|
||||||
const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr;
|
const wifi_ieee80211_mac_hdr_t *hdr = &ipkt->hdr;
|
||||||
|
@ -327,7 +327,7 @@ uint64_t uptime() {
|
|||||||
if (cfg.blescan)
|
if (cfg.blescan)
|
||||||
u8x8.printf("BLTH:%-4d", macs_ble);
|
u8x8.printf("BLTH:%-4d", macs_ble);
|
||||||
else
|
else
|
||||||
u8x8.printf("%-16s", "BLTH:off");
|
u8x8.printf("%s", "BLTH:off");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// update LoRa SF display (line 3)
|
// update LoRa SF display (line 3)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
// 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.5" // use max 10 chars here!
|
#define PROGVERSION "1.3.51" // use max 10 chars here!
|
||||||
#define PROGNAME "PAXCNT"
|
#define PROGNAME "PAXCNT"
|
||||||
|
|
||||||
//--- Declarations ---
|
//--- Declarations ---
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
// BLE scan parameters
|
// BLE scan parameters
|
||||||
#define BLESTACKSIZE 8192 // stack size for esp_bt_controller
|
#define BLESTACKSIZE 8192 // stack size for esp_bt_controller
|
||||||
#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
|
||||||
#define BLESCANWINDOW 10 // [milliseconds] scan window, see below, 3 .. 10240, default 10
|
#define BLESCANWINDOW 0x50 // [milliseconds] scan window, see below, 3 .. 10240, default 80ms
|
||||||
#define BLESCANINTERVAL 10 // [milliseconds] scan interval, see below, 3 .. 10240, default 10
|
#define BLESCANINTERVAL 0x50 // [milliseconds] scan interval, see below, 3 .. 10240, default 80ms = 100% duty cycle
|
||||||
|
|
||||||
/* Note: guide for setting bluetooth parameters
|
/* Note: guide for setting bluetooth parameters
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user