I have added a timeout in my code to make sure that my data being sent out on the BULK_IN pipe finishes in a certain time. If it doesn't, I want to abort the transfer (aka flush it from the pipe). I've tried using the USB_DCI_Cancel_Transfer/_usb_device_cancel_transfer() function, but that ooesn't seem to work properly. I would expect that once I call that function, the g_winusb_endpoint_data.ep[index].bin_consumer and g_winusb_endpoint_data.ep[index].bin_producer would once again be equal. I don't think that is the case.
What is the proper way to flush my pipe from my device? Do I need to reset the endpoint somehow?