USBDeviceControlIn Method (Byte, Byte, Int32, Int32, Int32) |
Initiates a control transfer over the default control endpoint. The request should have an IN direction (specified by the highest bit
of the requestType parameter). A buffer to receive the data is automatically created by this method.
Namespace:
MadWizard.WinUSBNet
Assembly:
WinUSBNet (in WinUSBNet.dll) Version: 2.0.0.0 (2.0.0.0)
Syntaxpublic byte[] ControlIn(
byte requestType,
byte request,
int value,
int index,
int length
)
Public Function ControlIn (
requestType As Byte,
request As Byte,
value As Integer,
index As Integer,
length As Integer
) As Byte()
public:
array<unsigned char>^ ControlIn(
unsigned char requestType,
unsigned char request,
int value,
int index,
int length
)
Parameters
- requestType
- Type: SystemByte
The setup packet request type. The request type must specify the IN direction (highest bit set). - request
- Type: SystemByte
The setup packet device request. - value
- Type: SystemInt32
The value member in the setup packet. Its meaning depends on the request. Value should be between zero and 65535 (0xFFFF). - index
- Type: SystemInt32
The index member in the setup packet. Its meaning depends on the request. Index should be between zero and 65535 (0xFFFF). - length
- Type: SystemInt32
Length of the data to transfer. A buffer will be created with this length and the length member of the setup packet
will be set to this length.
Return Value
Type:
ByteA buffer containing the data transfered.
RemarksThis routine initially allocates a buffer to hold the length bytes of data expected from the device.
If the device responds with less data than expected, this routine will allocate a smaller buffer to copy and return only the bytes actually received.
See Also