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

Getting Restarted when enabling whitelist

Hello everybody, I'm using NRF Beacon (51822) board, sdk 6.1.0.0 and s110, problem is when I enable whitelist and add the Bluetooth address of my phone( 74:51:BA:F7:60:9F) ( to get connected to my phone only) in the whitelist table and configure other parameters as defined in the reference manual, but seems like the device restarts automatically due to error response from

err_code = sd_ble_gap_adv_start(&adv_params);

APP_ERROR_CHECK(err_code);

and also wanted to know what is BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED mode and IRK ?

I attached the piece of code below for more details

APP_ADV_INTERVAL is (0x640) ie, one second interval and APP_ADV_TIMEOUT_IN_SECONDS is 180 secondds


static void advertising_init(void){
uint32_t      err_code;
ble_advdata_t advdata;
ble_advdata_t scanrsp;
uint8_t       flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
ble_uuid_t adv_uuids[] = {{BLE_UUID_NUS_SERVICE, m_nus.uuid_type}};
memset(&advdata, 0, sizeof(advdata));
advdata.name_type               = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance      = true;
advdata.flags.size              = sizeof(flags);
advdata.flags.p_data            = &flags;

memset(&scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
scanrsp.uuids_complete.p_uuids  = adv_uuids;

err_code = ble_advdata_set(&advdata, &scanrsp);
APP_ERROR_CHECK(err_code);}

static void advertising_start(void){ 
uint32_t      err_code;
ble_gap_adv_params_t adv_params;
ble_gap_addr_t  *device_info_array[1],device_info;
ble_gap_whitelist_t whitelist_details;
device_info.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;

            device_info.addr[0] = 0x9F;
		device_info.addr[1] = 0x60;
		device_info.addr[2] = 0xF7;
		device_info.addr[3] = 0xBA;
		device_info.addr[4] = 0x51;
		device_info.addr[5] = 0x74;

device_info_array[0] = &device_info;
whitelist_details.pp_addrs = device_info_array;
whitelist_details.addr_count=1;

memset(&adv_params, 0, sizeof(adv_params));
adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
adv_params.p_peer_addr = NULL;
adv_params.fp          = BLE_GAP_ADV_FP_FILTER_CONNREQ;
adv_params.interval    = APP_ADV_INTERVAL;
adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;
adv_params.p_whitelist = &whitelist_details;
err_code = sd_ble_gap_adv_start(&adv_params);
APP_ERROR_CHECK(err_code);}
Related