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

write andriod bluethooth mac to whitelist ,encounter fatal error.

hi expert

 i use sdk14.1 ,nrf58312, when my phone(andriod 5.2.1)connected to nrf58312 board ,i find the addr type is 2, so i want write the mac to whitelist ,but when i set the type to 2,

the board always encounter fatal error at sd_ble_gap_adv_start();when i set the type to 0,no more fatal error,but phone can't connect to board.please help analysis my fault,thank you in advance.

case BLE_ADV_EVT_WHITELIST_REQUEST:
     BLE_LOG_DEBUG("%s:BLE_ADV_EVT_WHITELIST_REQUEST.", (uint32_t)__func__);
     uint32_t err_code;
     const ble_gap_addr_t whitelist_addr = {1,2,{0x7B,0x1C,0x5B,0x47,0x5D,0x20}};//vivo
     const ble_gap_addr_t      *p_whitelist_addr[] = {&whitelist_addr};
     ble_gap_irk_t  whitelist_irks[BLE_GAP_WHITELIST_ADDR_MAX_COUNT];
     err_code = sd_ble_gap_whitelist_set(p_whitelist_addr, 1);
     if (err_code == NRF_SUCCESS)
	 {
		 BLE_LOG_DEBUG("after set BLE whitelist.");
	 } 
	 // White list reply
	err_code = ble_advertising_whitelist_reply(&m_advertising,&whitelist_addr, 1, NULL, 0);
	if (err_code == NRF_SUCCESS)
	{
		BLE_LOG_DEBUG("guofengying after replys %s: BLE whitelist.", (uint32_t)__func__);
	}
	break;

<error> app: Fatal error

Related