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
  • 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. 

Children
No Data
Related