SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
The black list lets users filter the stations which can connect to the AP according to their MAC address. The list contains up to eight entries and is persistent. Adding or removing a station to and from the list results in a file write to the external serial flash. Adding a station to the black list, which is currently connected to the AP, does not disconnect this station from the AP. The host application can enable and disable the black list without erasing the list of stations. By default, the black list is enabled. Removing a station from a list can be done by the MAC address or by the index of the entry.
The SimpleLink Wi-Fi device allows enabling or disabling the black list mode.
Example:
_i16 Status;
_u8 access_list_mode = SL_WLAN_AP_ACCESS_LIST_MODE_DENY_LIST;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_MODE, sizeof(access_list_mode), (_u8 *)&access_list_mode);
if( Status )
{
/* error */
}
Add a station to the black list. Adding a station to the black list will not disconnect it.
Example:
_i16 Status;
_u8 sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_ADD_MAC, sizeof(sta_mac), (_u8 *)
&sta_mac);
if( Status )
{
/* error */
}
Removing a station from the black list can be done using the MAC address or entry index (retrieve the entry index with Get Black option, which is specified as follows).
Examples of removing entry according to the MAC address:
_i16 Status;
_u8 sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_MAC, sizeof(sta_mac), (_u8 *)
&sta_mac);
if( Status )
{
/* error */
}
Examples of removing entry according to the entry index:
_i16 Status;
_u8 sta_index = 0;
Status = sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_IDX, sizeof(sta_index), (_u8 *)&sta_index);
if( Status )
{
/* error */
}
Get the number of denied stations in the current black list.
Example:
_i16 Status;
_u8 aclist_num_entries;
_u16 config_opt = SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES;
_u16 len = sizeof(aclist_num_entries);
Status = sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&aclist_num_entries);
if( Status )
{
/* error */
}
Get the AP black list starting from a specific index. The number of entries in the list can be determined from the returned total length, divided by the address size.
Example:
_i16 Status;
_u8 aclist_mac[SL_WLAN_MAX_ACCESS_LIST_STATIONS][MAC_LEN];
unsigned char aclist_num_entries;
unsigned short config_opt;
unsigned short len;
int actual_aclist_num_entries;
unsigned short start_aclist_index;
unsigned short aclist_info_len;
int i;
start_aclist_index = 0;
aclist_info_len = 2*MAC_LEN;
Status = sl_WlanGet(SL_WLAN_CFG_AP_ACCESS_LIST_ID, &start_aclist_index, &aclist_info_len, (_u8*)&aclist_mac[start_aclist_index]);
if( Status )
{
/* error */
}
actual_aclist_num_entries = aclist_info_len / MAC_LEN; /* number of stations in the list */