Keyboard multi-pairing does not work.

Hello,

I am developing a BLE keyboard. I am using SDK17.1.0 and nRF52840.
The part that is stuck is multi-pairing. I need to develop a function that alternately connects to 3 central devices like Logitech keyboard.
In the meantime, I found the following post(posted by Kenneth) on Nordic Devzone and ported this code to the keyboard source (ble_app_hids_keyboard) of SDK17.1.0 and am testing it using nRF52DK.

https://devzone.nordicsemi.com/f/nordic-q-a/57881/store-custom-application-data-using-peer-manager/234701

The connection to the first device is successful. When I press button 3 on the nRF52DK board, the connection with the first device is disconnected and a new advertisement is made. However, the other central devices do not search and I cannot connect. On the nRF52DK board, the LED clearly blinks and displays Advertise. And when I look at the log through Putty, Fast Advertising and Slow Advertising are displayed. But why is the device not searched for on the new central device?

And I would appreciate it if you could update the main.c in the link above more stably.

Best Regards,

YIM.

  • As you advised, I downloaded and installed SDK 15.2 and tested using the main.c file linked above.
    The behavior of the device is the same. Log are here.

    <info> app: HID Keyboard example started.
    <info> app: Button (control gap address): 2
    <info> app: Show stored peer id and gap address
    <info> app: Peer id: 0 Stored button (can control gap address): 3
    <info> app:     m_whitelist_peer_cnt 2, MAX_PEERS_WLIST 8
    <info> app: Fast advertising with whitelist.
    <info> app: Slow advertising with whitelist.

    The connection was fine with the Windows laptop at first. Then, when I press button 3 or 2 on the DK board, the connection with the Windows laptop is disconnected and when I search for the device on the new Android phone, the device is not found. In other words, the device is not found on the other central device, the Android phone, so I cannot connect.
    This behavior is the same as what I tested with SDK 17.1. 0.

    When advertising, the log appears as follows. This is the same log for both SDK 17.1. 0 and SDK 15.2. 0.

    Fast advertising with whitelist.
    Slow advertising with whitelist.

    Is the reason why the device is not found now because of the whitelist issue?
    Should I use ble_advertising_restart_without_whitelist() as you mentioned?
    Pressing 1 on the DK board seems to be a function to turn off the whitelist, but it doesn't work the same way in SDK17.1.0 or SDK15.2.0.

    Is there a way to solve it using ble_advertising_restart_without_whitelist()?
    I look forward to your more kind answer. Please.

    Best Regards,

    Yim.

  • Using ble_advertising_restart_without_whitelist() will likely help here yes.

    I wonder though if part of the problem can actually be that this worked at some time, and that those other other "slots" already have been bonded to a central device before, and that is why it is enabling whitelist by default here. Have you tried running an "nrfjprog --recover" once to ensure the entire chip is erased before you program the application? This should at the same time delete old bonds.

    Kenneth

Related