Hello,.
I have a question about using app_usbd_cdc_acm_read and app_usbd_cdc_acm_read_any in SDK15.2.0,
I am not sure I fully understand the description in reference of app_usbd_cdc_acm_read call:
- NRF_SUCCESS Data was stored into user buffer. User can provide another buffer to be filled, or check bytes left in internal buffer using app_usbd_cdc_acm_bytes_stored
- NRF_ERROR_IO_PENDING There is not enough data in internal buffer to fill user buffer. When data is stored APP_USBD_CDC_ACM_USER_EVT_RX_DONE event will be raised. User can schedule up to two buffers.
- NRF_ERROR_BUSY There are already two buffers queued for transfers.
According to this description, when there is not enough data in internal buffer can fill user buffer, the call will return a NRF_ERROR_IO_PENDING, so what will happen to the data stored in internal buffer now? will the data be copied to user buffer or just stay there waiting for enough data arrived ? if the data is copied to user buffer, then will APP_USBD_CDC_ACM_USER_EVT_RX_DONE will be raised at this point?
However, if the data is not copied to user buffer, then what will happen if, the expected receiving size if larger than internal buffer size, say, 256bytes or even larger? won't the data in internal buffer overwritten by coming bytes?
thank your for your help!
/Roland