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

1-1 permanent connection between central and peripheral

Hello,
I am trying to implement 1-1 connection between a central and a peripheral, with these (classic) requirements :
- when starting central, scan for any peripheral with a given name
- connect to it => peripheral does not advertise anymore
- when central is powered down, peripheral must not advertise
- when central is powered up with a peer stored, it should connect to it

For now, I'm not concerned by security issues, I'm looking for the minimal implementation to make it work.

I have some questions :
A) From what I gather from the documentation, I guess the correct way to implement this is with the peer manager + whitelist with a maximum link of 1. Is this correct ? Is there a simpler/other API ?
B) Is the reconnect automatic at start with the peer manager ? If not, what is the function for that ? scan with whitelist ?
C) Is this possible with the "No pairing/bonding" mode of peer manager ? If not, is "Pairing, no bonding" the way to go ?
D) Is there a standard way for the central to indicate to the peripheral to reset peer or should I create a custom service for that ?

Thanks !

Parents Reply
  • To try to make some progress, I have tried using bonding on my perihperal and to iniate bonding from my central (or from nRF connect).
    I have looked at ble_app_hids_mouse that does exactly that.

    What I don't get is that once the central disconnects, the peripheral does not advertise, so it can't reconnect ... 
    Or is there a way to connect to a bonded non-advertising peripheral ? How ?

    I feel like I'm still at the start of the conversation : how can I implement a 1-1 connection between a central and peripheral, that supports disconnections from either side ?

Children
  • Ok I succeeded with JustWorks bonding. I guess it's not possible with "pairing, no bonding".

    Peripheral still advertises when central disconnnects, but refuses all connections.

  • Hi, 

    QuentinFarizon said:
    I was indeed testing with nRF Connec. I see that I can able a bond from nRF Connect, but how can I initiaite pairing without bonding ?

    Click the settings button for the device in nRF Connect for Desktop, select "Pair". Then, click "Pair". Wait until the pair is established before you continue.

     

    QuentinFarizon said:
    But I don't see any sdk examples using these parameters. Do you have an example application that is not provided with the SDK ?

    Unfortunately, we don't have that, but you can modify the security parameters of the Template Application to achieve that. 

    QuentinFarizon said:
    The goal is to use my central device which is a NRF52832. From there, how can I initiate pairing without bonding ? What example can I look at ?

     You can take a look at the BLE Heart Rate Collector Example which initials bonding from central with pm_conn_secure. The example is using LESC pair parameters, but the procedure is the same. 

    QuentinFarizon said:
    is there a way to connect to a bonded non-advertising peripheral ? How ?

    No, the peripheral has to advertise after disconnect.

    QuentinFarizon said:
    how can I implement a 1-1 connection between a central and peripheral, that supports disconnections from either side ?

     Did you play around Heart Rate Application and BLE Heart Rate Collector Example? The examples support pair with whitelist which can restrict the specific connection.  After disconnecting with the central (hrs_c), the peripheral (hrs) will adverse again. This might help your issue. 

    -Amanda H. 

Related