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

Pair whit more than 1 device

Hi, if i pair my nrf51-dk with my iPhone works, than I pres discontent (bluetooth settings), now, if I try whit another iPhone this doesn't work...

If I reset the board or upgrade the application the pair mode doesn't work with the second phone.

The only one solution is erase all whit nrfgostudio, put new Softdevice s110, put new application and then I can connect whit another device. but only one!!

My application is as a copy the hid_keyboard_example. What whold I do for pair my nr51-dk with more than one phone?!

Thanks Regards

  • Hi,

    The HID mouse example is set up to pair and bond with a central, then keep that bonding information to connect to the same central again later. It also uses a whitelist, to only allow connecting to a selected set of centrals. This is reasonable behaviour for a HID device. In most cases you use it for the same device, and you definitely do not want it to connect to random centrals in the event of a connection loss. And you do not want to set up a new connection manually every time you use the HID device.

    The example uses persistent storage manager and BLE device manager to store the bonding info. Data is saved to flash memory, which makes it persistent. The memory area will not be overwritten by a reinstall of the SoftDevice or the application, which explains the behaviour you are seeing.

    To connect (and bond) with another central, you can explicitly tell the HID mouse application to forget the current bonding information. To do this, press button 2 while resetting the DK. You can also have a look at the documentation for the HID Mouse Application for the standard behaviour (see the Testing section for a functionality walk-through).

    You can also disable the whitelist. This is done while the device is in advertising mode, by pressing and holding button 2 for a couple of seconds. You can have a look at the BSP indication states, which are used to show the current state of the example program. It should go from whitelisting (LED 1 blinking, period 1s) to normal advertising (LED 1 blinking, period 2s), and now the HID mouse application should accept connections from new centrals.

    Regards, Terje

  • Thanks now it works, I used the Mouse example and now I can pair to more than one devices. I still have a problem: I need to wait at least 30 sec before I can pair again to another iPhone (with Android I don't need to wait). Do you know how to shorten this time? I was trying a different thing, I disable the "white list", in this way there was no delay but I can pair only to max 7 devices, after that the button is dead, I need to reprogram it!!! Thanks in advance for your help

    Enrico

  • The maximum number of bonds to remember is defined in device_manager_cnfg.h (DEVICE_MANAGER_MAX_BONDS), and by default is set to 7. You can change this number to a maximum of 10 for the current implementation of device manager. You will still be able to use the "press and hold button 2 on reset" approach to forget all bonds, so reprogramming is not required.

    I do not know why you get a waiting time of half a minute when trying to connect to an iPhone. If you have previously connected to the same iPhone there might be some caching issues on the iPhone side.

  • Very thanks, no if i have previously connected to the same iPhone I do not waiting half a minute, I waiting half a minute for connect another device not previusly connected Regards

Related