 | UsbDeviceControlRead Method |
Initiates a USB control transfer that reads data from the USB device.
Namespace:
WinUsbNet
Assembly:
WinUsbNet (in WinUsbNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic byte[] ControlRead(
byte bmRequestType,
byte bRequest,
ushort wValue,
ushort wIndex,
ushort wLength
)
Public Function ControlRead (
bmRequestType As Byte,
bRequest As Byte,
wValue As UShort,
wIndex As UShort,
wLength As UShort
) As Byte()
public:
array<unsigned char>^ ControlRead(
unsigned char bmRequestType,
unsigned char bRequest,
unsigned short wValue,
unsigned short wIndex,
unsigned short wLength
)
Parameters
- bmRequestType
- Type: SystemByte
The USB bmRequestTypefield. - bRequest
- Type: SystemByte
The USB bRequestfield. - wValue
- Type: SystemUInt16
The USB wValuefield. - wIndex
- Type: SystemUInt16
The USB wIndexfield. - wLength
- Type: SystemUInt16
The USB wLengthfield.
Return Value
Type:
ByteA byte array containing the bytes read from the USB device.
ExceptionsException | Condition |
---|
IOException | The UsbDevice is not open. |
Win32Exception | An error was reported by
the operating system. |
Remarks
The arguments of this method correspond precisely with the
like-named fields of a USB Setup packet. See the USB specification
for the meaning and use of these parameters.
The wLength parameter is the maximum number of
bytes to read from the USB device, and the USB device may send less.
The length of the returned byte array is the actual number of
bytes received.
See Also