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

Linking nRF52 central and peripheral devices via BLE

My problem:

I have to setup a BLE connection between two nRF52 devices one central device and one peripheral device. I have multiple central devices (C1, C2 to Cn) and multiple peripheral devices (P1, P2 to Pm). There is always a one-on-one connection between one central and one peripheral.

Encryption is not required.

Scenario of the desired behavior:

  • Normal behavior (start situation)
    Starting with C1 linked to P1 and C2 linked to P2.
    While scanning C1 should not be able to make a connection to another device than P1
    While advertising P1 should not be able to make a connection to another device than C1
  • Establish new link
    Setting C1 and P2 in a mode (let’s call it “open for linking”) where they can connect respectively to all my peripheral or central devices which are also in the “open for linking” mode at that same moment.
    When C1 and P2 make a connection, they should establish a link and leave the “open for linking” mode.
  • Normal behavior (after linking C1 to P2)
    While scanning C1 should not be able to make a connection to another device than P2
    While advertising P2 should not be able to make a connection to another device than C1
    While scanning C2 is not able to make a connection because P2 is no longer accepting C2.
    While advertising P1 is not able to make a connection because C1 is no longer accepting P1.

Ideally the link is stored in non-volatile memory.

What is the most straightforward way of implementing this?

I hope my question is clear and you can recommend a simple solution to me. Thank you in advance for your support!

Related