improved wifi sniffing (use all frames not only mgmt)

This commit is contained in:
Klaus K Wilting 2018-09-30 15:54:17 +02:00
parent 43b4946252
commit afc464d3f7

View File

@ -30,7 +30,8 @@ void wifi_sniffer_init(void) {
cfg.nvs_enable = 0; // we don't need any wifi settings from NVRAM cfg.nvs_enable = 0; // we don't need any wifi settings from NVRAM
cfg.wifi_task_core_id = 0; // we want wifi task running on core 0 cfg.wifi_task_core_id = 0; // we want wifi task running on core 0
wifi_promiscuous_filter_t filter = { wifi_promiscuous_filter_t filter = {
.filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // we need only MGMT frames // .filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // only MGMT frames
.filter_mask = WIFI_PROMIS_FILTER_MASK_ALL}; // we use all frames
// esp_event_loop_init(NULL, NULL); // esp_event_loop_init(NULL, NULL);
// ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL)); // ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));
@ -58,7 +59,8 @@ void ChannelSwitchIRQ() {
// Wifi channel rotation task // Wifi channel rotation task
void switchWifiChannel(void *parameter) { void switchWifiChannel(void *parameter) {
while (1) { while (1) {
// task is remaining in block state waiting for channel switch timer interrupt event // task is remaining in block state waiting for channel switch timer
// interrupt event
xSemaphoreTake(xWifiChannelSwitchSemaphore, portMAX_DELAY); xSemaphoreTake(xWifiChannelSwitchSemaphore, portMAX_DELAY);
// rotates variable channel 1..WIFI_CHANNEL_MAX // rotates variable channel 1..WIFI_CHANNEL_MAX
channel = (channel % WIFI_CHANNEL_MAX) + 1; channel = (channel % WIFI_CHANNEL_MAX) + 1;