Click or drag to resize

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)
Syntax
public void ControlWrite(
	byte bmRequestType,
	byte bRequest,
	ushort wValue,
	ushort wIndex,
	byte[] 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.
Exceptions
ExceptionCondition
IOExceptionThe UsbDevice is not open, or the transfer did not complete.
Win32ExceptionAn 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