INtime SDK Help
UsbControlXfer
INtime SDK v7 > About INtime > Networking and I/O > USB > USB calls > UsbControlXfer

Perform a synchronous control transfer (endpoint 0).

int32_t UsbControlXfer( 
int32_t udev,
uint8_t request,
uint8_t requesttype,
uint16_t value,
uint16_t index,
void *data,
uint16_t len,
uint16_t * act_len,
uint32_t flags,
uint32_t timeout
);

Parameters

udev
Device handle from UsbOpenDevice.
request 
Control request. One of:

USB_REQ_GET_STATUS
USB_REQ_CLEAR_FEATURE
USB_REQ_SET_FEATURE
USB_REQ_SET_ADDRESS
USB_REQ_GET_DESCRIPTOR
USB_REQ_SET_DESCRIPTOR
USB_REQ_GET_CONFIGURATION
USB_REQ_SET_CONFIGURATION
USB_REQ_GET_INTERFACE
USB_REQ_SET_INTERFACE
USB_REQ_SYNCH_FRAME

requesttype 
Control request type. One of:
USB_RT_WRITE
USB_RT_READ
USB_RT_STANDARD
USB_RT_CLASS
USB_RT_VENDOR
USB_RT_DEVICE
USB_RT_INTERFACE
USB_RT_ENDPOINT
USB_RT_OTHER
value
Request specific data. See USB specification for details.
index
Identifies a particular target. 
data 
Pointer to user buffer.
len 
Length of expected data transfer.
act_len
Pointer to a variable to receive the actual length of the transfer.
flags
Transfer flags. One of the following:
USB_FORCE_SHORT_XFER - force a short transmit last
USB_SHORT_XFER_OK - allow short reads
USB_DELAY_STATUS_STAGE - insert delay before STATUS
USB_MULTI_SHORT_OK - allow multiple short frames  
timeout 
Millisecond timeout for the operation.

Return Values

USB_ERR_NORMAL_COMPLETION Success. The operation was completed.
USB_ERR_NO_STACK The USB stack is not ready.
USB_ERR_MEMORY Memory could not be allocated for the operation.
USB_ERR_TIMEOUT The device did not respond.

Requirements

Versions Defined in Include Link to
INtime 5.0 intime/rt/include/usbif3.h usbif3.h usbif3.lib