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

Peripheral whitelist madness

I am developing a multi-peripheral product that knows all the possible connectable central Bluetooth device addresses (centrals are all NFC enabled smartphones).

When a central NFC taps the peripheral it sends some user info and its Bluetooth address to the peripheral, if the peripheral approves this info it advertises using a whitelist for that central only.

This is where things get odd, if the address in the whitelist is for central-1 all works well, if the address in the whitelist is for central-2 it breaks down with the following error code at run time:

<error> app: ERROR 12802 [Unknown error code] at C:\nordic\nRF5_SDK_15.3.0_59ac345\xxxxx\main.c:366
PC at: 0x00032F47
<error> app: End of error report

I'm using a nRF52840  PCA10056 dev-board and s140 15.3 SDK.

This is the relevant code in 'on_adv_evt':

359  case BLE_ADV_EVT_WHITELIST_REQUEST:
360 // static ble_gap_addr_t whitelist_addr = {1, BLE_GAP_ADDR_TYPE_RANDOM_STATIC, {0x74,0x83,0xCA,0xD7,0x41,0xC8}};	// this works
361    static ble_gap_addr_t whitelist_addr = {1, BLE_GAP_ADDR_TYPE_RANDOM_STATIC, {0x6B,0x39,0xA0,0x0E,0x6C,0x54}};	// this doesn't
362    ble_gap_addr_t const *p_whitelist_addr[] = {&whitelist_addr};
363
364    err_code = sd_ble_gap_whitelist_set(p_whitelist_addr, 1);
365    APP_ERROR_CHECK(err_code);
366
367    err_code = ble_advertising_whitelist_reply(&m_advertising, &whitelist_addr, 1, NULL, 0);
368    APP_ERROR_CHECK(err_code);
369    break;

I hope someone can help clarify what is happening.

Thanks

Related