Hello,
I am trying to connect to one specific device. To make this I am advertising with the whitelist. The problem is that the whitelist do not seem to work. I got the following code:
ble_gap_adv_params_t adv_params;
ble_gap_addr_t *whitelist_addr[1];
memset(&adv_params, 0, sizeof(adv_params));
adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
adv_params.p_peer_addr = NULL;
ble_gap_addr_t temp2;
temp2.addr[0] = 0x55;
temp2.addr[1] = 0x55;
temp2.addr[2] = 0x55;
temp2.addr[3] = 0x55;
temp2.addr[4] = 0x55;
temp2.addr[5] = 0x55;
/* Setup whitelist */
whitelist_addr[0] = &temp2;
whitelist.pp_addrs = whitelist_addr;
whitelist.addr_count = 1;
whitelist.irk_count = 1;
adv_params.fp = BLE_GAP_ADV_FP_FILTER_CONNREQ;
adv_params.p_whitelist = &whitelist;
adv_params.interval = APP_ADV_INTERVAL;
adv_params.timeout = UNLIMITED_TIMEOUT;
sd_ble_gap_adv_start(&adv_params);
In this case my device is not discoverable anymore. What I expected is that it would be discoverable and reject all devices that does not have an address equals 0x5555555555. If I change to code to direct advertisement with the specific peer address of my PCA10000 dongle, I can see the device and still be able to connect, but I expected the nRF51822 would reject this because my whitelist does not include that peer address.
I have some questions about this:
- Is it possible to create a whitelist like this?
- Do I have to set something so it is advertising with whitelist?
Thanks