nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ ble_scan_filter_add()

uint32_t ble_scan_filter_add ( struct ble_scan * scan,
uint8_t type,
const struct ble_scan_filter_data * data )

#include <ble_scan.h>

Add scan filter.

Available when CONFIG_BLE_SCAN_FILTER is enabled. This function adds a new filter by type Filter types. The filter will be added if the number of filters of a given type does not exceed CONFIG_BLE_SCAN_UUID_COUNT, CONFIG_BLE_SCAN_NAME_COUNT, CONFIG_BLE_SCAN_ADDRESS_COUNT, CONFIG_BLE_SCAN_APPEARANCE_COUNT, or BLE_SCAN_MANUFACTURER_DATA_COUNT, depending on the filter type, and if the same filter has not already been set.

Parameters
[in,out]scanScan library instance.
[in]typeFilter type.
[in]dataThe filter data to add.
Return values
NRF_SUCCESSIf the filter is added successfully.
NRF_ERROR_NULLIf a NULL pointer is passed as input.
NRF_ERROR_DATA_SIZEIf the name filter length is too long. Maximum name filter length corresponds to NRF_BLE_SCAN_NAME_MAX_LEN.
NRF_ERROR_NO_MEMIf the number of available filters is exceeded.
NRF_ERROR_INVALID_PARAMIf the filter type is incorrect. Available filter types: Filter types.