nRF5 SDK for Mesh v5.0.0
Functions
GAP address filtering

Filtering of advertisement packets based on their GAP address. More...

Functions

uint32_t bearer_filter_gap_addr_whitelist_set (const ble_gap_addr_t *const p_addrs, uint16_t addr_count)
 Set a whitelist for GAP addresses. More...
 
uint32_t bearer_filter_gap_addr_blacklist_set (const ble_gap_addr_t *const p_addrs, uint16_t addr_count)
 Set a blacklist for GAP addresses. More...
 
uint32_t bearer_filter_gap_addr_range_set (const ble_gap_addr_t *const p_addrs)
 Set a range for GAP addresses. More...
 
uint32_t bearer_filter_gap_addr_clear (void)
 Remove the currently assigned GAP address filter. More...
 
uint32_t bearer_gap_addr_filtered_amount_get (void)
 Read out amount filtered packets according the advertisement addresses settings. More...
 

Detailed Description

Filtering of advertisement packets based on their GAP address.

Function Documentation

◆ bearer_filter_gap_addr_whitelist_set()

uint32_t bearer_filter_gap_addr_whitelist_set ( const ble_gap_addr_t *const  p_addrs,
uint16_t  addr_count 
)

Set a whitelist for GAP addresses.

Only packets with a GAP address entry in the whitelist will be passed from the radio to the stack for processing.

Note
The p_addrs parameter must point to a statically allocated list of addresses of at least addr_count length.
Warning
Changing the contents of the whitelist while it's in use may result in unwanted packets being accepted. It is recommended to clear the list before changing it.
Parameters
[in]p_addrsList of addresses to accept. Must be statically allocated.
[in]addr_countThe number of addresses in the given list.
Return values
NRF_SUCCESSThe whitelist was successfully set.
NRF_ERROR_INVALID_STATEA blacklist is already in place. Clear the filter before changing the type of accept criteria.
NRF_ERROR_NULLThe p_addrs variable was NULL.
NRF_ERROR_INVALID_LENGTHThe addr_count variable was 0.

◆ bearer_filter_gap_addr_blacklist_set()

uint32_t bearer_filter_gap_addr_blacklist_set ( const ble_gap_addr_t *const  p_addrs,
uint16_t  addr_count 
)

Set a blacklist for GAP addresses.

Packets with a GAP address entry in the blacklist will not be passed from the radio to the upper stack for processing.

Note
The p_addrs parameter must point to a statically allocated list of addresses of at least addr_count length.
Warning
Changing the contents of the blacklist while it's in use may result in unwanted packets being accepted. It is recommended to clear the list before changing it.
Parameters
[in]p_addrsList of addresses to accept. Must be statically allocated.
[in]addr_countThe number of addresses in the given list.
Return values
NRF_SUCCESSThe blacklist was successfully set.
NRF_ERROR_INVALID_STATEA whitelist is already in place. Clear the filter before changing the type of accept criteria.
NRF_ERROR_NULLThe p_addrs variable was NULL.
NRF_ERROR_INVALID_LENGTHThe addr_count variable was 0.

◆ bearer_filter_gap_addr_range_set()

uint32_t bearer_filter_gap_addr_range_set ( const ble_gap_addr_t *const  p_addrs)

Set a range for GAP addresses.

Packets with a GAP address equal to or higher than the first entry and a GAP address lower than the second entry will pass, ie p_addrs[0] <= addr < p_addrs[1].

Note
The p_addrs parameter must point to a statically allocated list of addresses of at least 2 entries. The addresses must have the same address type.
Warning
Changing the range filter while it's in use may result in unwanted packets being accepted. It is recommended to clear the filter before changing it.
Parameters
[in]p_addrsStatically allocated array of two or more addresses, with the same address type, where the first one is lower than or equal to the second.
Return values
NRF_SUCCESSThe blacklist was successfully set.
NRF_ERROR_NULLThe p_addrs variable was NULL.
NRF_ERROR_INVALID_DATAThe addresses does not have the same address type.
NRF_ERROR_INVALID_STATEAnother filter is already in place. Clear it before changing the type of accept criteria.

◆ bearer_filter_gap_addr_clear()

uint32_t bearer_filter_gap_addr_clear ( void  )

Remove the currently assigned GAP address filter.

Return values
NRF_SUCCESSThe current GAP address filter was removed.
NRF_ERROR_INVALID_STATENo GAP address filter was in place.

◆ bearer_gap_addr_filtered_amount_get()

uint32_t bearer_gap_addr_filtered_amount_get ( void  )

Read out amount filtered packets according the advertisement addresses settings.

Returns
Amount of the filtered packets with unsuitable advertisement addresses.

Documentation feedback | Developer Zone | Subscribe | Updated