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

Whitelist not restrict connections

Hi!

I'm try restrict device connections with whitelist.

Code based on examples/ble_peripheral/ble_app_hids_mouse.

My problem - any devices can bond and connect even after whitelist is not empty.

Example in SDK 15.3 with board "nrf52840 dongle" show same result.

I break my table with my head.

Thanks in advance.

Parents
  • Hi,

    By default, the example will after APP_ADV_FAST_DURATION(30 sec) switch to slow advertising(BLE_ADV_EVT_SLOW_WHITELIST), and here the whitelist is by default turned off with the function ble_advertising_restart_without_whitelist(). Snippet from on_adv_evt():

            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;

    You can change it to this to avoid that:

            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;

Reply
  • Hi,

    By default, the example will after APP_ADV_FAST_DURATION(30 sec) switch to slow advertising(BLE_ADV_EVT_SLOW_WHITELIST), and here the whitelist is by default turned off with the function ble_advertising_restart_without_whitelist(). Snippet from on_adv_evt():

            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;

    You can change it to this to avoid that:

            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;

Children
No Data
Related