viUsbControlIn
Syntax
viUsbControlIn(ViSession vi, ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViPBuf buf, ViPUInt16 retCnt)
Description
This function can be used to request arbitrary data from a USB device on the default control port. The user must be aware of how to use each parameter based on the relevant USB base or class specification, or based on a vendor-specific request definition.
Parameters
Name |
Dir |
Type |
Description |
vi |
IN |
ViSession |
Unique logical identifier to a session. |
bmRequestType |
IN |
ViInt16 |
Bitmap field for defining the USB control port request. The bitmap fields are as defined by the USB specification. The direction bit must be device-to-host. |
bRequest |
IN |
ViInt16 |
Request ID for this transfer. The meaning of this value depends on bmRequestType. |
wValue |
IN |
ViUInt16 |
Request value for this transfer. |
wIndex |
IN |
ViUInt16 |
Specifies the interface or endpoint index number, depending on bmRequestType. |
wLength |
IN |
ViUInt16 |
Length of the data in bytes to request from the device during the Data stage. If this value is 0, then buf is ignored. |
buf |
OUT |
ViPBuf |
Actual data received from the device during the Data stage. If wLength is 0, then this parameter is ignored. |
retCnt |
OUT |
ViPUInt16 |
Actual number of bytes received from the device during the Data stage. |
Special Value for retCnt Parameter |
|||
Value |
|
|
Action Description |
VI_NULL |
|
|
Do not return the actual number of bytes read from the control pipe. |
Return Values
Type ViStatus |
This is the function return status. It returns either a completion code or an error code as follows. |
Completion Code |
Description |
VI_SUCCESS |
Operation completed successfully. |
Error Codes |
Description |
VI_ERROR_INV_MASK |
The value in bmRequestType does not have the direction bit set to the correct value. |
VI_ERROR_IO |
Could not perform operation because of I/O error. |
VI_ERROR_INV_PARAMETER |
The upper 8 bits of bmRequestType or bRequest are not zero. |
VI_ERROR_INV_SESSION |
The given session or object reference is invalid (both are the same value). |
VI_ERROR_NSUP_OPER |
The given vi does not support this operation. |
VI_ERROR_RSRC_LOCKED |
Specified operation could not be performed because the resource identified by vi has been locked for this kind of access. |
VI_ERROR_CONN_LOST |
The I/O connection for the given session has been lost. |
See Also
See the USB INSTR resource description.