Device.Net icon indicating copy to clipboard operation
Device.Net copied to clipboard

Use WinUsb_GetPipePolicy

Open MelbourneDeveloper opened this issue 6 years ago • 1 comments

Seems like the method for getting buffer sizes for Usb on Windows is wrong.

    The buffer length must be a multiple of the maximum endpoint packet size.
    The length must be less than or equal to the value of MAXIMUM_TRANSFER_SIZE retrieved by WinUsb_GetPipePolicy.

There are no restrictions on the size of the buffer if RAW_IO is not set as the pipe's policy type. If the size of the buffer is greater than the maximum transfer length reported by MAXIMUM_TRANSFER_SIZE, WinUSB divides the request into smaller requests and submits them serially to the host controller.

https://docs.microsoft.com/en-us/windows/desktop/api/winusb/nf-winusb-winusb_writepipe#remarks

Raised here: https://github.com/MelbourneDeveloper/Device.Net/issues/67#issuecomment-507046234

MelbourneDeveloper avatar Jul 06 '19 22:07 MelbourneDeveloper

@realivanjx

This is based on your comment. I will try to fix this soon.

MelbourneDeveloper avatar Jul 06 '19 22:07 MelbourneDeveloper