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

Whitelisting in Gatt Server mode (SDK 15.2 /nrf52840)

Im using sdk 15.2 with 2 nrf52840 boards, i would like the server to connect to a particular client. How to add the devices to whitelist in sdk 15.2 ?. I have gone through various blogs and  I have used the following snippet, but the server connects to any client available in the vicinity. Please do correct me if im wrong .

ble_gap_addr_t whitelist_addr = {1, BLE_GAP_ADDR_TYPE_PUBLIC,{0x27,0x23,0xBC,0x70,0xF2,0xDC}};
ble_gap_addr_t const *p_whitelist_addr[] = {&whitelist_addr};

ret_code_t err_code;
err_code = sd_ble_gap_whitelist_set(p_whitelist_addr, 1);
if (err_code==NRF_SUCCESS)
{
NRF_LOG_INFO("wHITELIST SET SUCCESSFULLY ");
}
APP_ERROR_CHECK(err_code);

thanks,

Preethi

Related