BLE Peer Manager Filter#

Peer Manager for Bluetooth Low Energy. Responsible for advertising and creating connections. The user can set the advertising parameters.

Functions#

sl_status_t
sl_status_t
sl_status_t
ble_peer_manager_set_filter_address_type(sl_bt_gap_address_type_t filter_addr_type)
sl_status_t
ble_peer_manager_set_filter_device_name(const char *device_name, uint8_t device_name_len, bool full_match)
sl_status_t
ble_peer_manager_set_filter_service_uuid16(sl_bt_uuid_16_t *service_uuid16)
sl_status_t
sl_status_t
ble_peer_manager_set_filter_service_data(uint8_t *service_data, uint8_t service_data_offset, uint8_t service_data_len)
sl_status_t
ble_peer_manager_set_filter_manufacturer_data(uint8_t *manufacturer_data, uint8_t manufacturer_data_offset, uint8_t manufacturer_data_len)
sl_status_t
bool
ble_peer_manager_find_match(bd_addr *address, sl_bt_gap_address_type_t address_type, int8_t rssi, const uint8array *adv_data)
sl_status_t
ble_peer_manager_str_to_address(const char *str, bd_addr *address)

Function Documentation#

ble_peer_manager_filter_init#

void ble_peer_manager_filter_init (void )
Parameters
N/A

Initialize filtering.


Definition at line 45 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_bt_address#

void ble_peer_manager_set_filter_bt_address (bool enabled)
Parameters
[in]enabled

Enable or disable BT address filtering.

Enable/disable BT address filtering.


Definition at line 52 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_add_allowed_bt_address#

sl_status_t ble_peer_manager_add_allowed_bt_address (bd_addr * filter_addr)
Parameters
[in]filter_addr

BT address to allow

Add a new allowed BT address.


Definition at line 63 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_remove_allowed_bt_address#

sl_status_t ble_peer_manager_remove_allowed_bt_address (bd_addr * filter_addr)
Parameters
N/Afilter_addr

Remove a BT address from the allowed list.


Definition at line 70 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_address_type#

sl_status_t ble_peer_manager_set_filter_address_type (sl_bt_gap_address_type_t filter_addr_type)
Parameters
[in]filter_addr_type

Address type to set the filter to.

Set filter address type.


Definition at line 80 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_device_name#

sl_status_t ble_peer_manager_set_filter_device_name (const char * device_name, uint8_t device_name_len, bool full_match)
Parameters
[in]device_name

Device name to set the filter to.

[in]device_name_len

Length of the device name.

[in]full_match

If true, only full matches are accepted in the scan response.

Set filter device name.

Set the filter device name to the specified device name. The device name in the scan response will only be checked if the advertisement type is Shortened Local Name (0x08) or Complete Local Name (0x09).


Definition at line 100 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_service_uuid16#

sl_status_t ble_peer_manager_set_filter_service_uuid16 (sl_bt_uuid_16_t * service_uuid16)
Parameters
[in]service_uuid16

Service UUID16 to set the filter to.

Set filter service UUID16.

Set the filter service UUID16 to the specified service UUID16. The service UUID in the scan response will only be checked if the advertisement type is Incomplete List of 16-bit Service Class UUIDs or Complete List of 16-bit Service Class UUIDs.


Definition at line 118 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_service_uuid128#

sl_status_t ble_peer_manager_set_filter_service_uuid128 (uuid_128 * service_uuid128)
Parameters
[in]service_uuid128

Service UUID128 to set the filter to.

Set filter service UUID128.

Set the filter service UUID128 to the specified service UUID128. The service UUID in the scan response will only be checked if the advertisement type is Incomplete List of 32-bit Service Class UUIDs or Complete List of 16-bit Service Class UUIDs.


Definition at line 134 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_service_data#

sl_status_t ble_peer_manager_set_filter_service_data (uint8_t * service_data, uint8_t service_data_offset, uint8_t service_data_len)
Parameters
[in]service_data

Service data to set the filter to.

[in]service_data_offset

Offset of the service data.

[in]service_data_len

Length of the service data.

Set filter service data.

Set the filter service data to the specified service data. When processing the scan response, the search will start from the given offset until the given length using memcmp(). The service data in the scan response will only be checked if the advertisement type is Service Data - 128-bit UUID.


Definition at line 154 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_manufacturer_data#

sl_status_t ble_peer_manager_set_filter_manufacturer_data (uint8_t * manufacturer_data, uint8_t manufacturer_data_offset, uint8_t manufacturer_data_len)
Parameters
[in]manufacturer_data

Manufacturer data to set the filter to.

[in]manufacturer_data_offset

Offset of the manufacturer data.

[in]manufacturer_data_len

Length of the manufacturer data.

Set filter manufacturer data.

Set the filter manufacturer data to the specified manufacturer data. When processing the scan response, the search will start from the given offset until the given length using memcmp(). The manufacturer data in the scan response will only be checked if the advertisement type is Manufacturer Specific Data.


Definition at line 176 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_set_filter_rssi#

sl_status_t ble_peer_manager_set_filter_rssi (int8_t rssi)
Parameters
[in]rssi

RSSI to set the filter to.

Set filter RSSI.

Set the filter RSSI (Signal strength indicator in the last received packet) to the specified RSSI. The RSSI in the scan response has to be greater than the set value. Units: dBm Range: -127 to +20


Definition at line 195 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_is_filter_set#

bool ble_peer_manager_is_filter_set ()

Check if there are any filters set.


Definition at line 203 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_reset_filter#

void ble_peer_manager_reset_filter ()

Reset filters.

Reset all filters to default values.


Definition at line 210 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_find_match#

bool ble_peer_manager_find_match (bd_addr * address, sl_bt_gap_address_type_t address_type, int8_t rssi, const uint8array * adv_data)
Parameters
[in]address

Address of the device.

[in]address_type

Address type of the device.

[in]rssi

RSSI of the device.

[in]adv_data

Advertising data of the device.

Find a match for the filters.

Check if the scan response matches the filters. There is an AND relationship between the filters, meaning that all filters must match for the function to return true.


Definition at line 227 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_is_filter_set_allowed#

bool ble_peer_manager_is_filter_set_allowed (void )
Parameters
N/A

Definition at line 232 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

ble_peer_manager_str_to_address#

sl_status_t ble_peer_manager_str_to_address (const char * str, bd_addr * address)
Parameters
[in]str

Hexadecimal representation of the BLE address with optional separator characters ':' or ' ', e.g. "AA:BB:CC:DD:EE:FF".

[out]address

Output.

Parse BT address from string.

Returns

  • Status of the operation.


Definition at line 242 of file common/ble_peer_manager/filter/inc/ble_peer_manager_filter.h

Macro Definition Documentation#

BLE_PEER_MANAGER_FILTER_LOG#

#define BLE_PEER_MANAGER_FILTER_LOG
Value:
0

Definition at line 43 of file common/ble_peer_manager/filter/config/ble_peer_manager_filter_config.h