VxWorks API Reference : USB libraries
usbQueueLib [USB] - O/S-independent queue functions
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
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.
usbQueueCreate( ) - Creates a O/S-independent queue structure
STATUS usbQueueCreate ( UINT16 depth, /* Max entries queue can handle */ pQUEUE_HANDLE pQueueHandle /* Handle of newly created queue */ )
This function creates a queue which can accomodate a number of USB_MESSAGE entries according to the depth parameter. Returns the
OK or ERROR
S_usbQueueLib_BAD_PARAMETER
S_usbQueueLib_OUT_OF_MEMORY
S_usbQueueLib_OUT_OF_RESOURCES
usbQueueDestroy( ) - Destroys a queue
STATUS usbQueueDestroy ( QUEUE_HANDLE queueHandle /* Hnadle of queue to destroy */ )
This function destroys a queue created by calling usbQueueCreate( ).
OK or ERROR.
S_usbQueueLib_BAD_HANDLE
usbQueuePut( ) - Puts a message onto a queue
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 */ )
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.
OK or ERROR
S_usbQueueLib_BAD_HANDLE
S_usbQueueLib_Q_NOT_AVAILABLE
usbQueueGet( ) - Retrieves a message from a queue
STATUS usbQueueGet ( QUEUE_HANDLE queueHandle, /* queue handle */ pUSB_MESSAGE pMsg, /* USB_MESSAGE to receive msg */ UINT32 blockFlag /* specifies blocking action */ )
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.
OK or ERROR
S_usbQueueLib_BAD_HANDLE
S_usbQueueLib_Q_NOT_AVAILABLE