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

Send 100 bytes to Nordic UART Service (Bluetooth)

Hello

I am using the ble_thread_dyn_mtd_coap_cli_pca_10056_s140 example and I would like to send 100 bytes of data to display in the logs of the android application "nRF Connect".

My problem is that when I use the "ble_nus_data_send (...)" function with my 100 byte array, I only see the first 60 bytes in the logs of nRF Connect.
The function does not return an error so do you have any idea what could be causing this problem?

Thank you

Parents
  • function does not return an error

    Doesn't it?

    Pretty sure that the examples do illustrate handling data larger than can be sent in one go ...

    EDIT

    From the ble_app_uart example in SDK 17.0.2:

        do
        {
            uint16_t length = (uint16_t)index;
            err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
            if ((err_code != NRF_ERROR_INVALID_STATE) &&
                (err_code != NRF_ERROR_RESOURCES) &&
                (err_code != NRF_ERROR_NOT_FOUND))
            {
                APP_ERROR_CHECK(err_code);
            }
        } while (err_code == NRF_ERROR_RESOURCES);

    it's the NRF_ERROR_RESOURCES which indicates that the requested data size is too big

  • Hello awneil

    No I have no errors ...

    But I found the problem: the ATT_MTU was worth 64 bytes...
    In my code I had:
    nrf_ble_gatt_att_mtu_periph_set (& m_gatt, 64);

    Putting a larger value therefore solves the problem ;-)

Reply Children
No Data
Related