How to send message from two slave to one master in nRF52

I hope to send a message from two slave to one master using nRF52 through bluetooth.

I send a message from a slave to a master with ble_app_uart_c and ble_app_uart. And I also connected two slave and one master with ble_app_multilink_central and peripheral. But I can't combine and apply that two case.

So please tell me how to send a message in multilink code, or how to use ble_app_uart as multilink.

I also found some information on internet, but I can't understand with them.

  • From what I understand, you want multilink functionality in the ble_app_uart_c example?

    To do so, I would recommend you to add the UART functionality to the mulitlink example. The required steps (from the top of my head) are the following:

    1) Replace the lbs files, ble_lbs_c with the UART files, ble_nus_c.

    2) Replace lbs_c_init, by similar version for the UART service, nus_c_init. Remember that the UART service will have to be added the same way as the LBS service in the "for"-loop.

    3) The NUS BLE event handler in main.c, "on_ble_evt()", have to be merged into "on_ble_evt()" in the multilink example:

    • The mulitilink functionality should be kept when the UART functionality is being added.
    • One main difference between the two examples: The multilink example connects to a device based on its advertised device name, while the UART example connects to a device based on its UUID.
    • I would recommend to go through all events in on_ble_evt() and compare the functionality.

    4) Add the UART BLE event handler (ble_nus_c_on_ble_evt) to ble_evt_dispatch() in the multilink example.

  • Hi Kristin, 

    I'm trying the same like JW, I worked like your steps. 

    On step 3 I'm confused, do you have a example for step 3? 

    Thaks for your help

  • Is "on_ble_evt" the same as "ble_evt_handler" ? 

    which SDK you are using ? 

  • Yes,  on_ble_evt() is the same as ble_evt_handler(). 

    The steps above is based on SDK 12 or 13.

    From SDK 14.0.0, ble_evt_dispatch() was replaced by NRF_SDH_BLE_OBSERVER().

  • Thanks for your reply, but I can't get it to work, do I need to more settings ? or do I need to copy more form the uart example? 

Related