ESP32_RTOS_SDK V1.1.0

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Functions
Sniffer APIs
WiFi Related APIs

WiFi sniffer APIs. More...

## Typedefs

typedef void(* | wifi_promiscuous_cb_t) (uint8 *buf, uint16 len)
| The RX callback function in the promiscuous mode. More...

## Functions

void | wifi_set_promiscuous_rx_cb (wifi_promiscuous_cb_t cb)
| Register the RX callback function in the promiscuous mode. More...
uint8 | wifi_get_channel (void)
| Get the channel number for sniffer functions. More...
bool | wifi_set_channel (uint8 channel)
| Set the channel number for sniffer functions. More...
void | wifi_promiscuous_enable (uint8 promiscuous)
| Enable the promiscuous mode. More...

## Detailed Description

WiFi sniffer APIs.

## Typedef Documentation

typedef void(* wifi_promiscuous_cb_t) (uint8 *buf, uint16 len)

The RX callback function in the promiscuous mode.

Each time a packet is received, the callback function will be called.

Parameters

  uint8 | *buf : the data received
  uint16 | len : data length

Returns
  null

## Function Documentation

uint8 wifi_get_channel | ( | void |  | ) |

Get the channel number for sniffer functions.

Parameters

  null |

Returns
  channel number

void wifi_promiscuous_enable | ( | uint8 | promiscuous | ) |

Enable the promiscuous mode.

Attention
  1. The promiscuous mode can only be enabled in the ESP32 station mode.
  2. When in the promiscuous mode, the ESP32 station and soft-AP are disabled.
  3. Call wifi_station_disconnect to disconnect before enabling the promiscuous mode.
  4. Don't call any other APIs when in the promiscuous mode. Call wifi_promiscuous_enable(0) to quit sniffer before calling other APIs.

Parameters

  uint8 | promiscuous :
  - 0: to disable the promiscuous mode
  - 1: to enable the promiscuous mode

Returns
  null

bool wifi_set_channel | ( | uint8 | channel | ) |

Set the channel number for sniffer functions.

Parameters

  uint8 | channel : channel number

Returns
  true : succeed
  false : fail

void wifi_set_promiscuous_rx_cb | ( | wifi_promiscuous_cb_t | cb | ) |

Register the RX callback function in the promiscuous mode.

Each time a packet is received, the registered callback function will be called.

Parameters

  wifi_promiscuous_cb_t | cb : callback

Returns
  null