improved wifi sniffing (use all frames not only mgmt)
This commit is contained in:
parent
43b4946252
commit
afc464d3f7
@ -27,10 +27,11 @@ IRAM_ATTR void wifi_sniffer_packet_handler(void *buff,
|
|||||||
|
|
||||||
void wifi_sniffer_init(void) {
|
void wifi_sniffer_init(void) {
|
||||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||||
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));
|
||||||
@ -56,9 +57,10 @@ 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user