Hello,
We would like our app to only be seen by:
- Devices that have previously connected
- Devices that we allow to be added to the whitelist via the temporary disabling
I have been using the ble_app_proximity SDK 8.0.0 as a guide to obtain this behavior but cannot get it to work. No matter what advertising mode I am in, all devices can see the advertisements. Is there an explicit way you get added to the whitelist? I thought it was just the act of connecting that added the device to the list.
Any clarification would be appreciated. Apparently the code below performs the magic but I'm not sure if this is enough. Do I need to augment it with more logic?
ble_gap_addr_t * p_whitelist_addr[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
ble_gap_irk_t * p_whitelist_irk[BLE_GAP_WHITELIST_IRK_MAX_COUNT];
whitelist.addr_count = BLE_GAP_WHITELIST_ADDR_MAX_COUNT;
whitelist.irk_count = BLE_GAP_WHITELIST_IRK_MAX_COUNT;
whitelist.pp_addrs = p_whitelist_addr;
whitelist.pp_irks = p_whitelist_irk;
err_code = dm_whitelist_create(&m_app_handle, &whitelist);
APP_ERROR_CHECK(err_code);
if ((whitelist.addr_count != 0) || (whitelist.irk_count != 0))
{
adv_params.fp = BLE_GAP_ADV_FP_FILTER_CONNREQ;
adv_params.p_whitelist = &whitelist;
advertising_init();
m_advertising_mode = BLE_FAST_ADV;
}
else
{
m_advertising_mode = BLE_SLOW_ADV;
}
adv_params.interval = APP_ADV_INTERVAL_FAST;
adv_params.timeout = APP_FAST_ADV_TIMEOUT;
err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING_WHITELIST);
APP_ERROR_CHECK(err_code);
break;
Thanks!