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

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.

Parents
  • FormerMember
    0 FormerMember

    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.

Reply
  • FormerMember
    0 FormerMember

    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.

Children
Related