Managing Filters
190
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Rx Filters
_u16 Size
=
sizeof
(SlWlanRxFilterRetrieveStateBuff_t);
_u16 opt = SL_WLAN_RX_FILTER_STATE;
RetVal = sl_WlanGet( SL_WLAN_RX_FILTERS_ID, &opt ,(_u16*)&Size , (_u8*)&RxFilterIdBitField );
11.5.3 Removing a Filter
Removing a filter is started by removing the filters from the active filters list. If the filter is persistent,
removing it alone is not enough, and the STORE operation must also be called.
In this command, filters with bits set to 1 are removed, and filters with bits set to 0 or filters which are not
defined are ignored.
To remove filters, call the sl_WlanSet API with the following arguments:
•
ConfigId: SL_WLAN_RX_FILTERS_ID
•
ConfigOpt: SL_WLAN_RX_FILTER_REMOVE
11.5.4 Storing Filters into the SFLASH
The filters are not stored on the storage automatically. This operation must be initiated by the host. In this
command, filters where a persistent bit is set are stored. The stored filters are loaded each time the device
is started.
To store the filters, call the sl_WlanSet command with the following arguments:
•
ConfigId: SL_WLAN_RX_FILTERS_ID
•
ConfigOpt: SL_WLAN_RX_FILTER_STORE
Example:
retVal = sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_STORE, 0, NULL);
11.5.5 Update Filter Arguments
To update the rule attributes of an existing filter, call the sl_WlanSet command with the following
arguments:
•
ConfigId: SL_WLAN_RX_FILTERS_ID
•
ConfigOpt: SL_WLAN_RX_FILTER_UPDATE_ARGS
Example:
memcpy(updateFilterBuff.Args.Value.Bssid[0], filterData, 6);
memcpy(updateFilterBuff.Args.Mask, MacMAsk, 6);
updateFilterBuff.FilterId = FilterId;
updateFilterBuff.BinaryOrAscii = 1;
retVal = sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_UPDATE_ARGS,
sizeof
(SlWlanRxFilterUpdateArgsCommandBuff_t),
(
unsigned char
*) &updateFilterBuff);