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

nrf52-ble-app-uart-c-multilink-master with multiple ble_app_uart - bi-directional communication?

In a system based on one nrf52-ble-app-uart-c-multilink-master and multiple ble_app_uart, the data from any entity is sent to all devices.

i.e. each ble_app_uart is sending data to the master.

But any other device in the network that is connected to the master, is getting this data as well.

Is it possible to avoid it? since it is causing high traffic 

Top Replies

Parents
  • Is it possible to avoid it?

    Yes.

    There is no such thing as broadcast in BLE - so your system must be deliberately iterating through all the connected devices, and sending this "data" to each one.

    If that's not the functionality you require, then remove the code which does that.

  • "There is no such thing as broadcast in BLE" 

    But every byte that is sent from  nrf52-ble-app-uart-c-multilink-master, is sent to all connected devices?

    Isn't it?

  • In the master code, I found the echo part and will remove it.

    Probably this is the reason got all the data that each of the devices got what a single device transmitted 

    if (ECHOBACK_BLE_UART_DATA)
    {
    for(int c = 0; c < NRF_SDH_BLE_CENTRAL_LINK_COUNT; c++)
    {
    // Send data back to the peripheral.
    do
    {
    ret_val = ble_nus_c_string_send(&m_ble_nus_c[c], p_data, data_len);
    if ((ret_val != NRF_SUCCESS) && (ret_val != NRF_ERROR_BUSY) && (ret_val != NRF_ERROR_INVALID_STATE))
    {
    NRF_LOG_ERROR("Failed sending NUS message. Error 0x%x. ", ret_val);
    APP_ERROR_CHECK(ret_val);
    }
    } while (ret_val == NRF_ERROR_BUSY);
    }
    }

Reply
  • In the master code, I found the echo part and will remove it.

    Probably this is the reason got all the data that each of the devices got what a single device transmitted 

    if (ECHOBACK_BLE_UART_DATA)
    {
    for(int c = 0; c < NRF_SDH_BLE_CENTRAL_LINK_COUNT; c++)
    {
    // Send data back to the peripheral.
    do
    {
    ret_val = ble_nus_c_string_send(&m_ble_nus_c[c], p_data, data_len);
    if ((ret_val != NRF_SUCCESS) && (ret_val != NRF_ERROR_BUSY) && (ret_val != NRF_ERROR_INVALID_STATE))
    {
    NRF_LOG_ERROR("Failed sending NUS message. Error 0x%x. ", ret_val);
    APP_ERROR_CHECK(ret_val);
    }
    } while (ret_val == NRF_ERROR_BUSY);
    }
    }

Children
Related