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

How to use NFC/BLE pairing with multiple peripherals?

I'm working on a project using the nRF52840 that will have a central device with an NFC reader and up to three peripheral devices with an NFC tag. The goal is to have an LED on one of the peripheral devices reflect the state of a button on the central device (on when button is pressed, off when button is released). The central will be able to switch between which of the peripherals will be notified of the button state. When the pairing button is pressed, the BLE/NFC pairing process starts, and if there are already three peripherals, one of them is disconnected. If the central is turned off or the peripherals lose connection, then on reboot, the central will scan for the previous three bonded peripherals and the peripherals will directly advertise to the central.

So far I've gotten the NFC/BLE pairing and LED/Button control working with the help of the central and peripheral NFC pairing examples, but I still can't get bonding to work. So I have a couple questions about how to proceed:

1. How can I have three peripherals and control which of the peripherals will turn on/off the LED? I'm thinking it has something to do with the connection handle.

2. How can I get bonding working? I've initialized the peer manager, but it's still not bonding.

Parents
  • Hi. 

     1.

    I'm thinking it has something to do with the connection handle.

    Yes, I would say that you are correct. You could look at the connection handles in order to control which of the peripherals that would turn on/off the LED. 

    2. 

    I've initialized the peer manager, but it's still not bonding.

     Do you see any errors during compilation? Have you tried debugging the application to see if there are any error codes returned?

    Best regards, 
    Joakim

Reply
  • Hi. 

     1.

    I'm thinking it has something to do with the connection handle.

    Yes, I would say that you are correct. You could look at the connection handles in order to control which of the peripherals that would turn on/off the LED. 

    2. 

    I've initialized the peer manager, but it's still not bonding.

     Do you see any errors during compilation? Have you tried debugging the application to see if there are any error codes returned?

    Best regards, 
    Joakim

Children
No Data
Related