i'd like to write to a tcp socket, would i need to use some sort of locks on the handler to prevent it from being called concurrently?
Code: Select all
void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type)
{
wifi_promiscuous_pkt_t *pkt = (wifi_promiscuous_pkt_t *)buff;
wifi_mgmt_hdr *mgmt = (wifi_mgmt_hdr *)pkt->payload;
const bool filter = filter_packet(mgmt);
if (filter)
{
ESP_LOGD(TAG, "ADDR2=" MACSTR " , RSSI=%d ,Channel=%d ,seq=%d", MAC2STR(mgmt->sa), pkt->rx_ctrl.rssi, pkt->rx_ctrl.channel, mgmt->seqctl & 0xFF);
if (_wifiPacketHandler)
{
_wifiPacketHandler(type, pkt, mgmt);
}
}
}