This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why is my BLE device not discoverable?

I am using the nRF51822 module. I am using the following code to set my device discoverable:

ble_gap_adv_params_t adv_params;

ble_gap_addr_t       *whitelist_addr[1];  

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

/* Advertising to the specific address */
adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
adv_params.p_peer_addr = NULL;

/* Setup whitelist */
whitelist_addr[0] 		 = Flash_Read_Address();
whitelist.pp_addrs 		 = whitelist_addr;
whitelist.addr_count     = 1;
whitelist.irk_count		 = 1;
	
adv_params.p_whitelist = &whitelist;
adv_params.fp          = BLE_GAP_ADV_FP_FILTER_CONNREQ;
adv_params.interval    = APP_ADV_INTERVAL;
adv_params.timeout     = UNLIMITED_TIMEOUT;

sd_ble_gap_adv_start(&adv_params);

I am trying to set my BLE device discoverable and filter connection requests with the whitelist. The problem is that I cannot find my BLE device with the Filter Policy on BLE_GAP_ADV_FP_FILTER_CONNREQ. What I expected is that my BLE device would be discoverable, and rejected requests from devices with an address that is not included in the whitelist.

What am I doing wrong here, or do I understand the concept of whitelist wrong?

Thanks.

Related