Filter Creation
186
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Rx Filters
11.4.5.2 Connection State and Role
The filter can be set to be tested only in specific connection state; for example, only in STA mode or only
in AP mode. The state in which the filter is considered is a combination of role and connection state.
Supported roles:
•
SL_WLAN_RX_FILTER_ROLE_AP
•
SL_WLAN_RX_FILTER_ROLE_STA
•
SL_WLAN_RX_FILTER_ROLE_PROMISCUOUS (transceiver)
•
SL_WLAN_RX_FILTER_ROLE_NULL
Supported connection states:
•
SL_WLAN_RX_FILTER_STATE_STA_CONNECTED
•
SL_WLAN_RX_FILTER_STATE_STA_NOT_CONNECTED
•
SL_WLAN_RX_FILTER_STATE_STA_HAS_IP
•
SL_WLAN_RX_FILTER_STATE_STA_HAS_NO_IP
Example of defining a filter which only works in transceiver mode:
/* Parent */
Trigger.ParentFilterID = parentId;
/* No counter is used, which is the common scenario */
Trigger.Counter = SL_WLAN_RX_FILTER_NO_TRIGGER_COUNTER;
/* Role is set to Transceiver mode */
Trigger.Role = SL_WLAN_RX_FILTER_ROLE_PROMISCUOUS;
/* The connection state is ignored
since the filter works in the Transceiver mode */
Trigger.ConnectionState = SL_WLAN_RX_FILTER_STATE_STA_CONNECTED;
Example of defining a filter which only works in STA mode after the IP is acquired:
/* Parent */
Trigger.ParentFilterID = parentId;
/* No counter is used, which is the common scenario */
Trigger.Counter = SL_WLAN_RX_FILTER_NO_TRIGGER_COUNTER;
/* Connection state and role, role is STA */
Trigger.Role = SL_WLAN_RX_FILTER_ROLE_STA;
/* Works only in case ip is acquired */
Trigger.ConnectionState = SL_WLAN_RX_FILTER_STATE_STA_HAS_IP;
Example of defining a filter which only works in STA mode:
/* Parent */
Trigger.ParentFilterID = parentId;
/* No counter is used, which is the common scenario */
Trigger.Counter = SL_WLAN_RX_FILTER_NO_TRIGGER_COUNTER;
/* Connection state and role, role is STA */
Trigger.Role = SL_WLAN_RX_FILTER_ROLE_STA;
/* Work on any connection state */
Trigger.ConnectionState =
SL_WLAN_RX_FILTER_STATE_STA_CONNECTED |
SL_WLAN_RX_FILTER_STATE_STA_NOT_ CONNECTED |
SL_WLAN_RX_FILTER_STATE_STA_HAS_IP |
SL_WLAN_RX_FILTER_STATE_STA_HAS_NO_IP;