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

Multilink example code

Hi  i am using SDK15.2, nrf52832 board.

Which function is necessary to achieve multilink in example code. I dont understand how the central is connecting multiple peripherals at the same?

Please provide me some more details because i have the similar requirement to connect multiple peripherals at the same time.

Thanks,

Rekha

Parents Reply Children
  • What do you mean by "being tracked"? Do you mean where you can see if any of the devices that are connected sends a message, or how you can send messages to a specific device? How you connect to the devices, or how to know when the devices are disconnected?

    Basically, the SoftDevice (BLE stack) handles all of the connections, so you will not notice anything, unless something happens, such as a connection event, disconnection event, or if someone sends a message.

  • Hi Edvin,

    Sorry if my question was not clear.

    Do you mean where you can see if any of the devices that are connected sends a message,

    Yes i meant this. 

    Thanks

  • Ok. I see.

    Depending on what service you have, it is the service handler of that service. In an unmodified ble_app_multilink_central, which uses the lbs (led button service), this would be the lbs_c_evt_handler() in main.c. 

    An event will be triggered when one of the connected boards pushes a button. This event is BLE_LBS_C_EVT_BUTTON_NOTIFICATION.

    Note that it is the same event for all devices, but you can see in the message that is printed in the log:

    NRF_LOG_INFO("Link 0x%x, Button state changed on peer to 0x%x",
                p_lbs_c_evt->conn_handle,
                p_lbs_c_evt->params.button.button_state);

    So a message could be: "Link 0x2, Button state changed on peer to 0x1", which means that the device with connection handle 2 pressed the button.

    So you use the connection handle, conn_handle, to determine which device that sent the message, and depending on what characteristic you have, the data will be found in that characteristic. 

Related