Hi I'm trying to create a transparent CDC to NUS bridge, this is based on the nrf52840 dongle.
The Aim of this is to send binary files to our device from a PC, our device is running NUS Peripheral.
The PC will control the chunk sizes and speed as to not overload the NUS
Issue i'm having is on the CDC, for some reason the CDC is halting after one reception.
Below is the CDC RX event done case
case APP_USBD_CDC_ACM_USER_EVT_RX_DONE:
{
NRF_LOG_INFO("CDC_ACM_USER_EVT_RX_DONE");
size_t size;
ret_code_t ret;
/*Get amount of data transferred*/
size = app_usbd_cdc_acm_rx_size(p_cdc_acm);
NRF_LOG_INFO("CDC RX: size: %lu", size);
/* Fetch data until internal buffer is empty */
ret = app_usbd_cdc_acm_read(&m_app_cdc_acm,
&m_cdc_data_array[0],
size);
if (ret == NRF_SUCCESS)
{
NRF_LOG_INFO("NUS TX: size: %lu", size);
ret = ble_nus_c_string_send(&m_ble_nus_c,
(uint8_t *)&m_cdc_data_array[0],
size);
}