2020-12-09 01:45 PM
I'm using the USB middleware for a STM32F765 MCU application. I am able to use the function USBD_CUSTOM_HID_SendReport() for transmitting data payload from my application to a USB host, but don't currently have visibility of if/when the data prepared by this function actually got read by the USB host.
Suppose the USB host is asking for reports every 1ms. If I make the following consecutive function calls:
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,DataBuf1, 64);
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,DataBuf2, 64);
the host will never see DataBuf1 because it did not ask the device for data between these function calls. DataBuf2 is queued up in the report.
I don't want to call USBD_CUSTOM_HID_SendReport() again until I'm sure the data prepared in the previous USBD_CUSTOM_HID_SendReport() call was actually received by the host. So I need something like this:
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,DataBuf1, 64);
//wait here until confirmation that USB host requested report
USBD_CUSTOM_HID_SendReport(&hUsbDeviceFS,DataBuf2, 64);
Is there anything within the USB middleware I can monitor that will let me know if the data prepared by the SendReport function actually made it to the host?
Similar question asked here - but no solution mentioned: https://stackoverflow.com/questions/60602110/is-there-anyway-through-which-usb-device-know-that-the-data-is-read-from-endpoin