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

Advertising Whitelist Difference between hids_keyboard and hids_mouse example

SDK: 17.0.0

Hardware: E-Byte E73-2G4M04S1B module

Chipset: NRF52832 QFAA QFN48

Running the hids examples, I noticed that the hids_mouse example will go from Fast Adv Whitelist → Slow Adv Whitelist → Slow Adv. However, once bonded, the hids_keybaord example never advertises without Whitelist until going through the Delete Bonds process. I can't identify the difference in advertising_init() or advertising_start() functions that would cause the mouse to behave any differently than the keyboard.

Ultimately I'd like to be able to press a button to disconnect from any peers and restart advertising without whitelist, but that may be a separate thread - right now, I'd just like to understand how to properly set up advertising so that I can automatically move from Whitelisted to non-Whitelisted advertising without hardware intervention.

Thanks

Parents
  • Hi,

    There seems to be a bug in the HID mouse example. The handling of the BLE_ADV_EVT_SLOW_WHITELIST event is like this:

            case BLE_ADV_EVT_SLOW_WHITELIST:
                NRF_LOG_INFO("Slow advertising with whitelist.");
                err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING_WHITELIST);
                APP_ERROR_CHECK(err_code);
                err_code = ble_advertising_restart_without_whitelist(&m_advertising);
                APP_ERROR_CHECK(err_code);
                break;

    which is not correct. It should have been the same as the keyboard example (where it does not start advertising without whitelist here):

            case BLE_ADV_EVT_SLOW_WHITELIST:
                NRF_LOG_INFO("Slow advertising with whitelist.");
                err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING_WHITELIST);
                APP_ERROR_CHECK(err_code);
                break;

    In both cases whitelisting can be explicitly turned off by a button press, where ble_advertising_restart_without_whitelist() is called on the BSP_EVENT_WHITELIST_OFF event. This is the correct approach for a HID device, which you only want to advertise without whitelisting when you are specifically trying to connect it to a new central.

  • Got it, thank you! I'll try to implement restart_without_whitelist() then, that seems like exactly what I need.

Reply Children
No Data
Related