This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Issue connecting peripheral using MAC address (NRF52832,SDK15.3, S132 6.1.1)

Hello Nordic Team,

I want to connect peripheral using Mac address, i am setting mac address filter in Scan init but Filter is not getting set

below is my Scan init function. 

static void scan_init(void)
{
ret_code_t err_code;
nrf_ble_scan_init_t init_scan;
static uint8_t addr[BLE_GAP_ADDR_LEN] = {0x74, 0x5C, 0x0D, 0xAA, 0x19, 0x93}; 

memset(&init_scan, 0, sizeof(init_scan));

init_scan.p_scan_param = &m_scan_param;
init_scan.connect_if_match = true;

err_code = nrf_ble_scan_init(&m_scan, &init_scan, scan_evt_handler);
APP_ERROR_CHECK(err_code);

err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_ADDR_FILTER, addr);
APP_ERROR_CHECK(err_code);

err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_ADDR_FILTER, true);
APP_ERROR_CHECK(err_code);

}

below code remains disabled in nrf_ble_scan_filter_set function , value for NRF_BLE_SCAN_ADDRESS_CNT is 1 in sdk_config.h

#if (NRF_BLE_SCAN_ADDRESS_CNT > 0)
case SCAN_ADDR_FILTER:
{
uint8_t * p_addr = (uint8_t *)p_data;
return nrf_ble_scan_addr_filter_add(p_scan_ctx, p_addr);
}
#endif

Scan program is running but Filter is not getting set.

Kindly help in resolving the issue.

Regards

Hitesh

Parents Reply Children
No Data
Related