MediaTek LinkIt™ Development
Platform for RTOS Wi-Fi Developer's
Guide
© 2015 - 2017 MediaTek Inc.
Page 18 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.
c)
Call the function
wifi_config_set_ssid(port, ssid_name, strlen(ssid_name))
to set
the SSID ("
MTK_SOFT_AP
") of a given port (
WIFI_PORT_AP
), as shown below.
wifi_config_set_ssid(WIFI_PORT_AP, "MTK_SOFT_AP", strlen("MTK_SOFT_AP"));
d)
Call the function
wifi_config_set_security_mode(port, auth, encrypt)
to set the
security mode of the AP router, as shown below.
wifi_config_set_security_mode(WIFI_PORT_AP, WIFI_AUTH_MODE_OPEN,
WIFI_ENCRYPT_TYPE_WEP_ENABLED);
e)
Call the function
wifi_config_set_wep_key(
port, &keys) to set the WEP keys.
wifi_config_set_wep_key(WIFI_PORT_AP, &keys);
f)
Call the function
wifi_config_set_channel(port, channel)
to setup the channel on a given
port, as shown below.
wifi_config_set_channel(WIFI_PORT_AP, 4);
g)
Apply the configuration by calling the function
wifi_config_reload_setting()
, as shown
below.
wifi_config_reload_setting();
2.2.4.
Wi-Fi connection support
The APIs for connection support in AP mode:
1)
Get the station list associated with the device in AP mode.
Call the function
wifi_connection_get_sta_list()
to get the station’s associated AP information
.
An
example implementation is shown below.
uint8_t i;
uint8_t status = 0;
wifi_sta_list_t list[WIFI_MAX_NUMBER_OF_STA];
uint8_t size = 0;
status = wifi_connection_get_sta_list(&size, list);
printf("stalist size=%d\n", size);
for (i = 0; i < size; i++)
{
printf("%d\n", i);
printf("last_tx_rate: MCS=%d, LDPC=%d, MODE=%d\n",
(list[i].last_tx_rate.field.mcs),
(list[i].last_tx_rate.field.ldpc),
(list[i].last_tx_rate.field.mode));
printf("last_rx_rate: MCS=%d, LDPC=%d, MODE=%d\n",
(list[i].last_rx_rate.field.mcs),
(list[i].last_rx_rate.field.ldpc),
(list[i].last_rx_rate.field.mode));
printf("rssi_sample.LastRssi0)=%d\n",
(int)(list[i].rssi_sample.last_rssi));
printf("rssi_sample.AvgRssi0X8=%d\n",
(int)(list[i].rssi_sample.average_rssi));
printf("addr=%02x:%02x:%02x:%02x:%02x:%02x\n", list[i].mac_address[0],
list[i].mac_address[1], list[i].mac_address[2],
list[i].mac_address[3], list[i].mac_address[4],
list[i].mac_address[5]);
printf("power_save_mode=%d\n",