Access Point
51
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
WLAN
•
DNS server – IPv4 DNS server address
Example:
_i16 Status;
_i16 Role;
SlNetCfgIpV4Args_t ipV4;
ipV4.Ip
= (_u32)SL_IPV4_VAL(10,1,1,201);
/*
IP address
*/
ipV4.IpMask
= (_u32)SL_IPV4_VAL(255,255,255,0);
/* Subnet mask
*/
ipV4.IpGateway
= (_u32)SL_IPV4_VAL(10,1,1,1);
/* Default gateway address
*/
ipV4.IpDnsServer = (_u32)SL_IPV4_VAL(8,16,32,64);
/* _u32 DNS server address
*/
Status =
sl_NetCfgSet(SL_NETCFG_IPV4_AP_ADDR_MODE,SL_NETCFG_ADDR_STATIC,
sizeof
(SlNetCfgIpV4Args_t),(_u8
*)&ipV4);
if
( Status )
{
/* error */
}
/* restart the device */
Status = sl_Stop(0);
Role = sl_Start(NULL,NULL,NULL);
4.4.4 Station Management
The SimpleLink Wi-Fi device lets users manage the connected stations by using host commands. Users
can enable the device to view the connected stations and disconnect stations according to their MAC
address.
4.4.4.1
Get Connected Stations
The SimpleLink Wi-Fi device lets users get the current number of connected stations and get the full list of
connected stations.
Example:
_i16 Status;
_u8 NumConnectedStations;
_u16 ValueLen
=
sizeof
(_u8);
_u32 i;
SlNetCfgStaInfo_t ApStaList[4];
_u16 sta_info_len;
_u16 start_sta_index = 0;
_u16 actual_num_sta;
Status
= sl_NetCfgGet(SL_NETCFG_AP_STATIONS_NUM_CONNECTED, NULL, &ValueLen,
&NumConnectedStations);
if
( Status )
{
/* error */
}
/* get list of connected stations */
start_sta_index = 0;
/* from index */
sta_info_len =
sizeof
(ApStaList);
/* 4 stations to get */
Status
= sl_NetCfgGet(SL_NETCFG_AP_STATIONS_INFO_LIST, &start_sta_index, &sta_info_len, (_u8
*)ApStaList);
if
( Status )
{
/* error */
}
/* extract actual stations in the response */
actual_num_sta = sta_info_len /
sizeof
(SlNetCfgStaInfo_t);