Hello, I got problem in enabling whitelist on starting advertising.
My working enviroment is PCA10028 V1.1.0 2015'18, SoftDevice S130 2.0.1, SDK 12.2.0 MCP works on Android 6.0.1, Nexus 7(2013).
I refere project from ble_app_hids_keyboard and refactor ble_adverting module.
The working flow describes on below:
- Start indirect connectable Advertising without whitelist in advertisment data #1.
- Android MCP connects and bonds successful.
- Disconnect and update whitelist from peer manager.
- Set advertisment data #2 and start indirect conntable advertising with updated whitelist by calling sd_ble_gap_adv_start(), it occurs error. The returned error code is 0x3201.
If I disable whitelist and do the same working flow, it works fine. The only different is in setting advertising parameter.
p_adv_params->type = BLE_GAP_ADV_TYPE_ADV_IND; // connectable undirected
p_adv_params->fp = BLE_GAP_ADV_FP_FILTER_CONNREQ; // enable whitelist
//p_adv_params->fp = BLE_GAP_ADV_FP_ANY; // disable whitlist
p_adv_params->interval = NO_REQ_ADV_INTREVAL;
p_adv_params->timeout = NO_REQ_ADV_TIMEOUT;
// enable whielist
ble_adv_fetch_whitelist(); // fetch current whitelist from peer mamanger
#if (NRF_SD_BLE_API_VERSION == 2)
p_adv_params->p_whitelist = &m_whitelist;
#endif
// disable white list
//p_adv_params->p_whitelist = NULL;
// set advertising data
ret = ble_advdata_set(&m_advdata, &m_rspdata);
// ....some code in here
ret = sd_ble_gap_adv_start(&adv_params); // stop in this place
I stop in sd_ble_gap_adv_start() and watch the ble_gap_adv_params_t, value is on below:
type: BLE_GAP_ADV_TYPE_ADV_IND
p_peer_addr: NULL
fp: BLE_GAP_ADV_FP_FILTER_CONNREQ (0x02)
p_whitelist: ->pp_addrs[0]->addr_type: BLE_GAP_ADDR_TYPE_PUBLIC
->pp_addrs[0]->addr: "0xB4 0xAD 0x60 0x0B 0x22 0xAC"
->addr_count: 1
->pp_irks[0]->irk: "0x1C 0x1B 0xBE 0x3E 0x1F 0x2F 0x2B 0x19 0x1F 0x07 0x72 0xC0 0xBE 0xEE 0x85 0xAE"
->irk_count: 1
interval: 1600
timeout: 30
channel_mask: .ch_37_off: 0
.ch_38_off: 0
.ch_39_off: 0
could anyone tell me what is the problem?