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

Multilink central with UART

Hello,

I am trying to develop a sensor which can connect to multiple sensors and send the data which is received by its UART through bluetooth, at the peripheral. Central device reveives the data through the bluetooth and then sends it out through UART. I have tried the example given in the SDK and it is working fine. Now i want to add multilink features to the central device. I tried adding, but it did not work out. Can someone please help me out with the same? Is there any example program available for this?

SDK Used: NRF52 SDK 16.0

Chipset : NRF52832

IDE : Segger Embedded Studio

Regards,

Subbu

Parents Reply
  • Hi Subbu

    I tried to keep the example as similar as possible to the original example, and modified it to send the data to all links rather than just a single one. 

    You can obviously change this as you see fit depending on your application requirements. 

    To find the points in the code where I send data to all the links just look for a loop similar to this:

    for(int c = 0; c < NRF_SDH_BLE_CENTRAL_LINK_COUNT; c++)
    ...

    And yes, to disable the echo just set the ECHOBACK_BLE_UART_DATA define on line 75 of main.c to 0.

    Best regards
    Torbjørn

Children
  • Hi Torbjørn,

    Thank you. But does peripheral has something to do with sending the information to all links? Because the peripheral is the one who is sending the data to the central. Does the central resend the data to all the links?

    Also i did not get the answer for this. There is no target device name specified anywhere. Then how does the central know, which peripheral to connect to?

    Regards,

    Subbu

  • Hi Subbu

    In any BLE connection you will have one central and one peripheral, but you can send data any way you like, it doesn't matter if you are on the central or peripheral side. 

    The code I sent supports up to 4 central links, which means you can connect to 4 different peripheral devices at the same time. 

    When data is received from either of the peripheral devices it will be sent back to all of the connected peripheral devices. 

    The different connected peripherals can be identified by their unique connection handle, which is a 16-bit number that starts at 0 and is incremented by 1 for each additional connection. 

    Whenever you need to send some data to one of the peripherals you use the connection handle to identify them. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

     

    Thank you for the reply. In the earlier example, which came along with the SDK, the ble central was getting conncected to devices with the target device names. I felt that was better to create multiple networks in a single area (i.e., multiple centrals and peripherals together, but they connect to their respective device names). 

    And according to you, just clearing the Echoback should solve all my other concerns. Will check it and get back to you in case if there is anything.

    Regards,

    Subbu

  • Hi Subbu

    The good thing is that the connection establishment process is controlled from the application, so if you want to enforce a certain connection strategy or naming policy of devices you are able to do so. 

    If you have any more questions just let me know Slight smile

    Best regards
    Torbjørn

Related