MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 28 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.
3)
Call the function
wifi_smart_connection_stop()
to stop the Smart Connection:
2.6.
Monitor mode and RX filter
Monitor mode is the mode in which platform can receive all the packets transmitted over the air, call
wifi_config_set_opmode()
to configure the platform in the monitor mode.
The RX filter, which only works in station mode, is able to filter out user-defined packet types. Set the Rx filter, as
shown in section 2.6.1, “How to use the RX filter API”.
2.6.1.
How to use the RX filter API
Set the RX filter control register (RFCR) to configure the behavior of receiving Wi-Fi packets by calling the
wifi_config_set_rx_filter()
API. The RX filter settings indicate the desired packet format to receive, such
as broadcast, multicast and unicast frames, as shown in Table 14.
Table 14. RX filter definitions
Input Parameter
Description
WIFI_RX_FILTER_DROP_STBC_BCN_BC_MC
bit 0, drops STBC beacon/BC/MC frames.
WIFI_RX_FILTER_DROP_FCS_ERR
bit 1, drops FCS error frames.
WIFI_RX_FILTER_RESERVED
bit 2, a reserved bit, not used.
WIFI_RX_FILTER_DROP_VER_NOT_0
bit 3, drops version field of Frame Control field. It
uint8_t ssid[WIFI_MAX_LENGTH_O 1] = {0};
uint8_t ssid_len = 0;
uint8_t password_len = 0;
switch (event)
{
case WIFI_SMART_CONNECTION_EVENT_CHANNEL_LOCKED:
case WIFI_SMART_CONNECTION_EVENT_TIMEOUT:
break;
case WIFI_SMART_CONNECTION_EVENT_INFO_COLLECTED:
wifi_smart_connection_get_result(ssid, &ssid_len, password,
&password_len, NULL, NULL);
/* Configure the STA with the received SSID & passward. */
wifi_config_set_ssid(WIFI_PORT_STA, ssid, ssid_len);
if(password_len > 0) {
/* If the target AP is WPA-PSK or WPA2-PSK. */
wifi_config_set_wpa_psk_key(WIFI_PORT_STA, password,
password_len);
}
wifi_config_reload_setting();
wifi_smart_connection_deinit();
break;
}
}
int32_t user_smart_exit(void)
{
wifi_smart_connection_stop();
return 0;
}