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

Setting up whitelist in SDK V12.2.0

ble_app_template.zipI need to setup whitelist. To achieve that while calling ble_advertising_init I specified

ble_adv_whitelist_enabled = true

then, while handling BLE_ADV_EVT_WHITELIST_REQUEST I use:

uint32_t err_code;
		ble_gap_addr_t whitelist_addr = {1, BLE_GAP_ADDR_TYPE_RANDOM_STATIC, {0x25,0xD7,0x90,0x11,0x7A,0xC8}};
    const ble_gap_addr_t      *p_whitelist_addr[] = {&whitelist_addr};
		switch (ble_adv_evt)
    {
			case BLE_ADV_EVT_WHITELIST_REQUEST:
				err_code = sd_ble_gap_whitelist_set(p_whitelist_addr, 1);
				APP_ERROR_CHECK(err_code);
				err_code = ble_advertising_whitelist_reply(NULL, 1, NULL, 0);
				APP_ERROR_CHECK(err_code);
			break;			

I made sure that both err_codes above are 0 once those 2 functions return but all this results in no advertising, instead I am experiencing (in RTT Viewer) APP_ERROR:ERROR:Fatal. If I commented out content of the 'case' above - then my device is advertising.

Did I miss anything while setting up my whitelist?

I think I did everything as described in Software Development Kit > nRF5 SDK > nRF5 SDK v12.2.0 > Libraries > BLE libraries > Advertising Module > Whiltelist > Usage

which says:

If you are using the S13x SoftDevice v3.x, call sd_ble_gap_whitelist_set. Then, call ble_advertising_whitelist_reply (you only need to provide the counts)

in my case I am using S132 V3.1.0

Update I tried to grab error details but Keil (?) is experiencing encoding issues while trying to display the file name, I don't have such a problem with at least files I create myself and main.c image description

The project can be found in the attachment.

Parents
  • No, I just ran the project with that line uncommented to reproduce the problem. Did you have the device advertising once you uncommented that line? My main goal is till to figure out what I did wrong while setting up the white list and that investigation around strange error come up as kind of secondary issue, so, looking at the code in the project, could you please tell me whether you see anything obviously wrong with my whitelist which would result in my device not advertising at all?

Reply
  • No, I just ran the project with that line uncommented to reproduce the problem. Did you have the device advertising once you uncommented that line? My main goal is till to figure out what I did wrong while setting up the white list and that investigation around strange error come up as kind of secondary issue, so, looking at the code in the project, could you please tell me whether you see anything obviously wrong with my whitelist which would result in my device not advertising at all?

Children
No Data
Related