www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - USB API


usbHostGetStatus

Retrieves status information from a given device using the GetStatus Standard Device Request

int usbHostGetStatus( unsigned char driverId,

unsigned char address,
unsigned char receiver,
unsigned char index,
unsigned short far *status );

Parameters

driverId

ID of the user driver

address

Address of the resp. device

receiver

Receiver of the GetStatus request; this parameter decides whether the status of the device, an interface, an endpoint or a user- defined structure is to be retrieved; must be one of the following:
  • USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_DEVICE
  • USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_INTERFACE
  • USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_ENDPOINT
  • USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_OTHER
The symbolic names are defined in USB_SPEC.H.

index

Index of the resp. structure. The value of this parameter depends on the value of the receiver parameter.
If the receiver is USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_DEVICE, the index must always be 0.
If the receiver is USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_INTERFACE, the index must contain the ID of the resp. interface.
If the receiver is USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_ENDPOINT, the index parameter must contain the number of the resp. endpoint. If it is an IN endpoint, bit 7 has to be set additionally. (e.g. IN endpoint 1 => 0x81).
If the receiver is USB_SPEC_DEVICE_REQUEST_TYPE_RECEIVER_OTHER, the value of the index parameter is device-specific.

status

Pointer to an unsigned short variable where the status is to be stored.

Return Value

Error code

Comments

This function reserves endpoint 0 of the resp. device for the user driver that calls it before using the endpoint and it releases it again afterwards.
Note that this function may take up to 2000 ms to complete, because it waits that long for data to arrive from the device.
This function must not be called from within the callback-function.

RTOS API

This library function uses a dynamic link to reach the function USB_SERVICE_HOST_GET_STATUS offered by RTOS USB Software Interrupt.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    n/an/an/aV1.06

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.05

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document