XferData Fails when Large Amount of Data is Requested - KBA215067
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Version: *A
Translation - Japanese: 大量のデータが要求されるとXferDataが失敗する - KBA215067 - Community Translated (JA)
Question:
When I use the XferData (or the BeginDataXfer) call, large amount of data is requested and the transfer can fail. Why does this happen and how do I fix it?
Answer:
XferData directly requests or sends the specified amount of data to the host controller driver. The host driver can queue only a certain maximum size depending on the transfer type (Bulk, Isoc, Interrupt, or Control) and the OS version. For details on the maximum transfer sizes, see the MSDN article at https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-bandwidth-allocation.
To overcome this issue, you can split the large request into multiple requests of smaller sizes (with the size equal to the maximum transfer size allowed in the specified OS).
Alternatively, you can use the third parameter of XferData called packetMode (Boolean) to queue requests in multiples of wMaxPacketSize.
So, for example, for bulk endpoints in C#, this would be:
bool isPacketMode = true;
bool transferResult = BulkEndpoint.XferData(ref xferBuffer, ref xferLength, isPacketMode);
- Tags:
- asynchronous
- begindataxfer
- bulk transfer
- c
- control transfer
- driver
- host application
- in transfer
- interrupt transfer
- isochronous transfer
- maximum transfer size
- ss_usb
- xferdata
-
This widget could not be displayed.Anonymous