void (* wifi_promiscuous_cb_t)(void *buf, wifi_promiscuous_pkt_type_t type);"buf" point "Statitx Rx buffer" or "dynamic?

jason2
Posts: 44
Joined: Thu Oct 26, 2017 11:02 am

void (* wifi_promiscuous_cb_t)(void *buf, wifi_promiscuous_pkt_type_t type);"buf" point "Statitx Rx buffer" or "dynamic?

Postby jason2 » Wed Apr 18, 2018 8:33 am

The callback function :void (* wifi_promiscuous_cb_t)(void *buf, wifi_promiscuous_pkt_type_t type).If this callback function is registered,when received packet,The function will be called and the contents of packets will be pointed by *buf.

And I have read wifi driver from API guide from esp32 programming guide: http://esp-idf.readthedocs.io/en/latest ... /wifi.html
It is described:
The following diagram shows how buffer is allocated/freed in the RX direction:

------------- ------------- ------------- -------------
| Application | | LwIP | | Wi-Fi | | Wi-Fi |
| Task | <--------- | task | <--------- | task | <--------- | Interrupt |
------------- ------------- ------------- -------------
4> User data 3> Pbuf 2> Dynamic RX Buffer 1> Static RX Buffer
Description:

The Wi-Fi hardware receives a packet over the air and puts the packet content to the “Static Rx Buffer”, which is also called “RX DMA Buffer”.
The Wi-Fi driver allocates a “Dynamic Rx Buffer”, makes a copy of the “Static Rx Buffer”, and returns the “Static Rx Buffer” to hardware.
The Wi-Fi driver delivers the packet to the upper-layer (LwIP), and allocates a PBUF for holding the “Dynamic Rx Buffer”.
The application receives data from LwIP.

So when wifi_promiscuous_cb_t is called,where is "*buf" point?"Static Rx buffer" or "Dynamic Rx buffer"

Thanks!
Best regards!

Who is online

Users browsing this forum: No registered users and 105 guests