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

How can i connect multiperipherals with different device names?

HI,

I have connected to one peripheral from my central and retrieved all the services(For example i need Device Information Service, got all the characteristic values) and stored in global variables.

Now i need to connect another peripheral and pass the information(Earlier which i got connected from peripheral Device Information Service values) using Nordic Uart Service(NUS).

 

After disconnecting from one peripheral and trying to connect other peripheral my previous global variable data is being lost.how can i do it?

How multilink peripheral_central will work for connecting different device names?

Parents Reply Children
  • yes Einar i want to keep some information between connections,while trying to connect second peripheral i am pressing reset button(So that i can scan&connect to other device) on my nRF52840 board.How can i pass information between connections without reset?

    How to store variable data even after resetting board?

    How multilink peripheral_central will work for connecting different device names?

  • Hi,

    Why do you reset the nRF between the connections? The nRF does not need to reset during normal operations. Typically, during the lifetime of a product reset will only occur due to power failure (such as battery replacement), an error condition or if you use system OFF low power mode (not relevant for most applications).

    If you need to store data persistently in flash I recommend you to look at the FDS, which is a simple file system. You can also consider using retention registers if you only need to store a few bytes, and don't need it to be persistent when there is a power failure.

    The ble_app_multilink_central example in SDK 15 demonstrates how to search for device name and connect if the name matches (see the on_adv_report() function in main.c)

Related