VxWorks API Reference : USB libraries

usbQueueLib [USB]

NAME

usbQueueLib [USB] - O/S-independent queue functions

ROUTINES

usbQueueCreate( ) - Creates a O/S-independent queue structure
usbQueueDestroy( ) - Destroys a queue
usbQueuePut( ) - Puts a message onto a queue
usbQueueGet( ) - Retrieves a message from a queue

DESCRIPTION

This file contains a generic implementation of O/S-independent queue functions which are built on top of the the ossLib library's mutex and semaphore functions.

The caller creates a queue of depth "n" by calling usbQueueCreate( ) and receives a QUEUE_HANDLE in response. The QUEUE_HANDLE must be used in all subsequent calls to usbQueuePut( ), usbQueueGet( ), and usbQueueDestroy( ).

Each entry on a queue is described by a USB_QUEUE structure which contains msg, wParam, and lParam fields. The values of these fields are completely arbitrary and may be used in any way desired by the calling application.


USB libraries : Routines

usbQueueCreate( )

NAME

usbQueueCreate( ) - Creates a O/S-independent queue structure

SYNOPSIS

STATUS usbQueueCreate
    (
    UINT16        depth,       /* Max entries queue can handle */
    pQUEUE_HANDLE pQueueHandle /* Handle of newly created queue */
    )

DESCRIPTION

This function creates a queue which can accomodate a number of USB_MESSAGE entries according to the depth parameter. Returns the

RETURNS

OK or ERROR

ERRNO

 S_usbQueueLib_BAD_PARAMETER
 S_usbQueueLib_OUT_OF_MEMORY
 S_usbQueueLib_OUT_OF_RESOURCES

SEE ALSO

usbQueueLib


USB libraries : Routines

usbQueueDestroy( )

NAME

usbQueueDestroy( ) - Destroys a queue

SYNOPSIS

STATUS usbQueueDestroy
    (
    QUEUE_HANDLE queueHandle  /* Hnadle of queue to destroy */
    )

DESCRIPTION

This function destroys a queue created by calling usbQueueCreate( ).

RETURNS

OK or ERROR.

ERRNO

 S_usbQueueLib_BAD_HANDLE

SEE ALSO

usbQueueLib


USB libraries : Routines

usbQueuePut( )

NAME

usbQueuePut( ) - Puts a message onto a queue

SYNOPSIS

STATUS usbQueuePut
    (
    QUEUE_HANDLE queueHandle, /* queue handle */
    UINT16       msg,         /* app-specific message */
    UINT16       wParam,      /* app-specific parameter */
    UINT32       lParam,      /* app-specific parameter */
    UINT32       blockFlag    /* specifies blocking action */
    )

DESCRIPTION

Places the specified msg, wParam, and lParam onto queueHandle. This function will only block if the specified queue is full. If the queue is full, blockFlag specifies the blocking behavior. OSS_BLOCK blocks indefinitely. OSS_DONT_BLOCK does not block and returns an error if the queue is full. Other values of blockFlag are interpreted as a count of milliseconds to block before declaring a failure.

RETURNS

OK or ERROR

ERRNO

 S_usbQueueLib_BAD_HANDLE
 S_usbQueueLib_Q_NOT_AVAILABLE

SEE ALSO

usbQueueLib


USB libraries : Routines

usbQueueGet( )

NAME

usbQueueGet( ) - Retrieves a message from a queue

SYNOPSIS

STATUS usbQueueGet
    (
    QUEUE_HANDLE queueHandle, /* queue handle */
    pUSB_MESSAGE pMsg,        /* USB_MESSAGE to receive msg */
    UINT32       blockFlag    /* specifies blocking action */
    )

DESCRIPTION

Retrieves a message from the specified queueHandle and stores it in pOssMsg. If the queue is empty, blockFlag specifies the blocking behavior. OSS_BLOCK blocks indefinitely. OSS_DONT_BLOCK does not block and returns an error immediately if the queue is empty. Other values of blockFlag are interpreted as a count of milliseconds to block before declaring a failure.

RETURNS

OK or ERROR

ERRNO

 S_usbQueueLib_BAD_HANDLE
 S_usbQueueLib_Q_NOT_AVAILABLE

SEE ALSO

usbQueueLib