 | UsbDeviceControlWrite Method |
Initiates a USB control transfer with optional data sent to the USB device.
Namespace:
WinUsbNet
Assembly:
WinUsbNet (in WinUsbNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic void ControlWrite(
byte bmRequestType,
byte bRequest,
ushort wValue,
ushort wIndex,
byte[] buffer
)
Public Sub ControlWrite (
bmRequestType As Byte,
bRequest As Byte,
wValue As UShort,
wIndex As UShort,
buffer As Byte()
)
public:
void ControlWrite(
unsigned char bmRequestType,
unsigned char bRequest,
unsigned short wValue,
unsigned short wIndex,
array<unsigned char>^ buffer
)
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. - buffer
- Type: SystemByte
An array of bytes with the data to write to the
USB device. May be null.
ExceptionsException | Condition |
---|
IOException | The UsbDevice is not open,
or the transfer did not complete. |
Win32Exception | An error was reported by
the operating system. |
Remarks
The first four 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 field of the USB Setup packet is set to the
length of buffer, or zero if buffer
is null.
See Also