esp32: add sniffer filter api

Add sniffer filter to filter specified packets
This commit is contained in:
Liu Zhi Fu
2017-05-26 14:11:16 +08:00
parent 1cbdb35e1e
commit f40be8eb77
2 changed files with 38 additions and 2 deletions

View File

@@ -610,6 +610,31 @@ esp_err_t esp_wifi_set_promiscuous(bool en);
*/
esp_err_t esp_wifi_get_promiscuous(bool *en);
/**
* @brief Enable the promiscuous filter.
*
* @attention 1. The default filter is to filter all packets except WIFI_PKT_MISC
*
* @param filter the packet type filtered by promisucous
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by eps_wifi_init
*/
esp_err_t esp_wifi_set_promiscuous_filter(const wifi_promiscuous_filter_t *filter);
/**
* @brief Get the promiscuous filter.
*
* @param[out] filter store the current status of promiscuous filter
*
* @return
* - ESP_OK: succeed
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by eps_wifi_init
* - ESP_ERR_WIFI_ARG: invalid argument
*/
esp_err_t esp_wifi_get_promiscuous_filter(wifi_promiscuous_filter_t *filter);
/**
* @brief Set the configuration of the ESP32 STA or AP
*