Filtering of advertisement packets based on their GAP address.
More...
Filtering of advertisement packets based on their GAP address.
◆ 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_addrs | List of addresses to accept. Must be statically allocated. |
[in] | addr_count | The number of addresses in the given list. |
- Return values
-
NRF_SUCCESS | The whitelist was successfully set. |
NRF_ERROR_INVALID_STATE | A blacklist is already in place. Clear the filter before changing the type of accept criteria. |
NRF_ERROR_NULL | The p_addrs variable was NULL. |
NRF_ERROR_INVALID_LENGTH | The 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_addrs | List of addresses to accept. Must be statically allocated. |
[in] | addr_count | The number of addresses in the given list. |
- Return values
-
NRF_SUCCESS | The blacklist was successfully set. |
NRF_ERROR_INVALID_STATE | A whitelist is already in place. Clear the filter before changing the type of accept criteria. |
NRF_ERROR_NULL | The p_addrs variable was NULL. |
NRF_ERROR_INVALID_LENGTH | The 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_addrs | Statically 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_SUCCESS | The blacklist was successfully set. |
NRF_ERROR_NULL | The p_addrs variable was NULL. |
NRF_ERROR_INVALID_DATA | The addresses does not have the same address type. |
NRF_ERROR_INVALID_STATE | Another 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_SUCCESS | The current GAP address filter was removed. |
NRF_ERROR_INVALID_STATE | No 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.