Dear Nordic fellows,
I have a nRF52832 and I want to use Nordic UART Service to send data in peripheral mode. What is the proper way to use this service?. I'm using nRF5_SDK17.1.0
The ble_app_uart example performs a do while loop with condition err_code == NRF_ERROR_RESOURCES. But doing it this way I can not perform a continuous data transmission.
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);
What I'm trying to do is call the ble_nus_data_send() function and if I get an NRF_ERROR_RESOURCES error, I save the data_array in a FIFO buffer.
When the BLE_GATTS_EVT_HVN_TX_COMPLETE event is received, I retrieve the data from the FIFO and call the ble_nus_data_send() function again.
Thanks in advance,
Fernando.