![Mediatek Labs LinkIt Developer'S Manual Download Page 33](http://html1.mh-extra.com/html/mediatek-labs/linkit/linkit_developers-manual_1760805033.webp)
MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 29 of 36
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Input Parameter
Description
cannot be 0.
WIFI_RX_FILTER_DROP_PROBE_REQ
bit 4, drops probe request frame.
WIFI_RX_FILTER_DROP_MC_FRAME
bit 5, drops multicast frame.
WIFI_RX_FILTER_DROP_BC_FRAME
bit 6, drops broadcast frame.
WIFI_RX_FILTER_RM_FRAME_REPORT_EN
bit 12, enables report frames.
WIFI_RX_FILTER_DROP_NOT_MY_BSSID
bit 17, drops not my BSSID frames.
WIFI_RX_FILTER_DROP_NOT_UC2ME
bit 18, drops not unicast to me frames.
WIFI_RX_FILTER_DROP_DIFF_BSSID_BTIM
bit 19, drops different BSSID TIM Broadcast frame.
WIFI_RX_FILTER_DROP_NDPA
bit 20, drops the Null Data Packet Announcement
(NDPA) or not.
The input parameter of
wifi_config_set_rx_filter()
API indicates the bits to configure the RX filter
options. The details for each bit can be found in the Wi-Fi API Reference Manual.
2.6.2.
How to receive raw packets
In order to process the raw packets, register a raw packet handler to process the packets with
wifi_config_register_rx_handler()
.
Note that besides the
wifi_config_set_rx_filter()
API, you can also use
wifi_config_set_opmode()
to configure the runtime settings in a monitor mode to receive all the packets transmitted over the air.
To filter the specified packets, configure the runtime settings in the station mode and use the RX filter.
An example to set the RX filter is shown below.
int smtcn_start(void)
{
……
wifi_config_register_rx_handler(
(wifi_rx_handler_t) wlan_raw_pkt_rx_filter_sample);
……
}
int smtcn_start(void)
{
……
wifi_config_set_opmode(WIFI_MODE_STA_ONLY);
……
uint32_t rx_filter;
wifi_config_get_rx_filter(&origin_rxfilter);
rx_filter = origin_rxfilter | BIT(WIFI_RX_FILTER_RM_FRAME_REPORT_EN);
rx_filter &= ~BIT(WIFI_RX_FILTER_DROP_NOT_MY_BSSID);
rx_filter &= ~BIT(WIFI_RX_FILTER_DROP_NOT_UC2ME);
rx_filter &= ~BIT(WIFI_RX_FILTER_DROP_MC_FRAME);
wifi_config_set_rx_filter(rx_filter);
……
}