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

Sending more than 1 packet per connection with nRF52840

As I'm new to the nRF52840 and Bluetooth, I read documents and DevZone posts related to the bluetooth maximum throughput.

According to the references like Jimmy and Sigurd and so on, it seems that I can get higher throughput if I set MTU to the maximum value and send multiple packets per connection.

The problem is that it was not able for me to find options to enable sending multiple packets.

Currently, I mixed ble_app_uart and saadc examples to get signal and send them via bluetooth. And the data length extension and MTU size are set to the maximum as I know.

And I send data using the following code which is written by another team member

static void nus_data_handler(ble_nus_evt_t * p_evt)
{

    if (p_evt->type == BLE_NUS_EVT_RX_DATA)
    {
        uint32_t err_code;

        NRF_LOG_HEXDUMP_DEBUG(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length);

        for (uint32_t i = 0; i < p_evt->params.rx_data.length; i++)
        {
            do
            {
                err_code = app_uart_put(p_evt->params.rx_data.p_data[i]);
                if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
                {
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
        if (p_evt->params.rx_data.p_data[p_evt->params.rx_data.length - 1] == '\r')
        {
            while (app_uart_put('\n') == NRF_ERROR_BUSY);
        }
    }

}

Are there any examples sending multiple packets per connection so I can try to implement to mine?

Related