![Mediatek Labs LinkIt Developer'S Manual Download Page 25](http://html1.mh-extra.com/html/mediatek-labs/linkit/linkit_developers-manual_1760805025.webp)
MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 21 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.
config.ap_config.channel = 6;
config.ap_config.bandwidth = WIFI_IOT_COMMAND_CONFIG_BANDWIDTH_20MHZ;
3)
Apply the settings by calling the
wifi_init()
function.
wifi_init(&config, NULL);
2.3.3.
Using the dynamic method
Before applying this method, few assumptions to make:
•
The repeater operates on channel 6 with allocated bandwidth of 20MHz.
•
The AP port is configured with an SSID of "
SSID_2
", the authorization mode is WPA-PSK and the
encryption type is AES, the password is "
87654321
".
•
The AP Client port is configured with an SSID of "SSID_1", the authorization mode is WPA/WPA2-PSK and
the encrypt type is TKIP+AES, the password is "12345678".
1)
Call the function
wifi_config_set_opmode(opmode)
to set the opmode.
wifi_config_set_opmode(WIFI_MODE_REPEATER);
2)
To configure the APCLI port in repeater mode:
a)
Call the function
wifi_config_set_ssid(port_apcli, ssid_apcli,
strlen(ssid_apcli))
to set the SSID of the AP Client port, as shown below.
wifi_config_set_ssid(WIFI_PORT_APCLI, "SSID_1", strlen("SSID_1"));
b)
Call the function
wifi_config_set_wpa_psk_key(port_apcli,
password_apcli,strlen(password_apcli))
to set the APCLI port password.
wifi_config_set_wpa_psk_key(WIFI_PORT_APCLI, "12345678",
strlen("12345678"));
3)
To configure the AP port in repeater mode:
a)
Call the function
wifi_config_set_ssid(port_ap, ssid_ap, strlen(ssid_ap))
to set the
SSID ("SSID_2") of a given port (
WIFI_PORT_AP
), as shown below.
wifi_config_set_ssid(WIFI_PORT_AP, "SSID_2", strlen("SSID_2"));
b)
Call the function
wifi_config_set_security_mode(port_ap, auth_mode,
encrypt_mode) to s
et authentication mode and encryption type of the AP port, as shown below.
wifi_config_set_security_mode(WIFI_PORT_AP, WIFI_AUTH_MODE_WPA_PSK,
WIFI_ENCRYPT_TYPE_AES_ENABLED);
4)
Call the function
wifi_config_set_wpa_psk_key(port_ap, password_ap,
strlen(password_ap))
to set the WPA2/PSK key, as shown below.
wifi_config_set_wpa_psk_key(WIFI_PORT_AP, "87654321", strlen("87654321"));
5)
Call the function
wifi_config_set_channel(port_ap, channel)
to set the AP channel, as shown
below.
wifi_config_set_channel(WIFI_PORT_AP, 6);
6)
Apply the settings by calling the
wifi_config_reload_setting()
function.
wifi_config_reload_setting();