![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| 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.
| [in,out] | scan | Scan library instance. |
| [in] | type | Filter type. |
| [in] | data | The filter data to add. |
| NRF_SUCCESS | If the filter is added successfully. |
| NRF_ERROR_NULL | If a NULL pointer is passed as input. |
| NRF_ERROR_DATA_SIZE | If the name filter length is too long. Maximum name filter length corresponds to NRF_BLE_SCAN_NAME_MAX_LEN. |
| NRF_ERROR_NO_MEM | If the number of available filters is exceeded. |
| NRF_ERROR_INVALID_PARAM | If the filter type is incorrect. Available filter types: Filter types. |