BLE_GAP_SetScanningFilter

C

uint16_t BLE_GAP_SetScanningFilter(BLE_GAP_ScanFilterConfig_T *p_param);

Description

Sets the scanning filter parameters to filter received advertising or scan response PDUs based on specific data types.

Note

There are three Advertising Data Type (AD_Type) content filter options that can be enabled individually: - Name Filter: Filters by Shortened Local Name (AD_Type=0x08) or Complete Local Name (AD_Type=0x09). - Service Data Filter: Filters by Service Data (AD_Type=0x16). - Manufacturer Data Filter: Filters by Manufacturer Specific Data (AD_Type=0xFF).

When enabled, PDUs with matching AD_Type data are reported via BLE_GAP_EVT_ADV_REPORT or BLE_GAP_EVT_EXT_ADV_REPORT events. This scanning filter is applied after the filterPolicy setting in the BLE_GAP_SetScanningParam or BLE_GAP_SetExtScanningParams API.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully sets the scanning filter parameters.
MBA_RES_OOMInternal memory allocation failure occurred.
MBA_RES_INVALID_PARAThe parameters provided are invalid.