VxWorks API Reference : USB libraries
usbHandleLib [USB] - handle utility functions
usbHandleInitialize( ) - Initializies the handle utility library
usbHandleShutdown( ) - Shuts down the handle utility library
usbHandleCreate( ) - Creates a new handle
usbHandleDestroy( ) - Destroys a handle
usbHandleValidate( ) - Validates a handle
Implements a set of general-purpose handle creation and validation functions.
Using these services, libraries can return handles to callers which can subsequently be validated for authenticity. This provides libraries with an additional measure of "bullet-proofing."
usbHandleInitialize( ) - Initializies the handle utility library
STATUS usbHandleInitialize ( UINT32 maxHandles /* max handles allocated by library */ )
Initializes the handle utility library. Must be called at least once prior to any other calls into the handle utility library. Calls to usbHandleInitialize( ) may be nested, allowing multiple clients to use the library without requiring that they be coordinated.
maxHandles defines the maximum number of handles which should be allocated by the library. Passing a zero in maxHandles causes the library to allocate a default number of handles. maxHandles is ignored on "nested" calls to usbHandleInitialize( ).
OK or ERROR
S_usbHandleLib_OUT_OF_MEMORY
S_usbHandleLib_OUT_OF_RESOURCES
usbHandleShutdown( ) - Shuts down the handle utility library
STATUS usbHandleShutdown (void)
Shuts down the handle utility library. When calls to usbHandleInitialize( ) have been nested, usbHandleShutdown( ) must be called a corresponding number of times.
OK or ERROR
usbHandleCreate( ) - Creates a new handle
STATUS usbHandleCreate ( UINT32 handleSignature, /* Arbitrary handle signature */ pVOID handleParam, /* Arbitrary handle parameter */ pGENERIC_HANDLE pHandle /* Newly allocated handle */ )
Creates a new handle. The caller passes an arbitrary handleSignature and a handleParam. The handleSignature will be used in subsequent calls to usbHandleValidate( ).
OK or ERROR
S_usbHandleLib_NOT_INITIALIZED
S_usbHandleLib_BAD_PARAM
S_usbHandleLib_GENERAL_FAULT
S_usbHandleLib_OUT_OF_HANDLES
usbHandleDestroy( ) - Destroys a handle
STATUS usbHandleDestroy ( GENERIC_HANDLE handle /* handle to be destroyed */ )
This functions destroys the handle created by calling usbHandleCreate( ).
OK or ERROR
S_usbHandleLib_GENERAL_FAULT
S_usbHandleLib_BAD_HANDLE
usbHandleValidate( ) - Validates a handle
STATUS usbHandleValidate ( GENERIC_HANDLE handle, /* handle to be validated */ UINT32 handleSignature, /* signature used to validate handle */ pVOID * pHandleParam /* Handle parameter on return */ )
This function validates handle. The handle must match the handleSignature used when the handle was originally created. If the handle is valid, the pHandleParam will be returned.
OK or ERROR
S_usbHandleLib_NOT_INITIALIZED
S_usbHandleLib_BAD_HANDLE