VxWorks API Reference : USB libraries

usbHandleLib [USB]

NAME

usbHandleLib [USB] - handle utility functions

ROUTINES

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

DESCRIPTION

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."


USB libraries : Routines

usbHandleInitialize( )

NAME

usbHandleInitialize( ) - Initializies the handle utility library

SYNOPSIS

STATUS usbHandleInitialize
    (
    UINT32 maxHandles         /* max handles allocated by library */
    )

DESCRIPTION

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( ).

RETURNS

OK or ERROR

ERRNO

 S_usbHandleLib_OUT_OF_MEMORY
 S_usbHandleLib_OUT_OF_RESOURCES

SEE ALSO

usbHandleLib


USB libraries : Routines

usbHandleShutdown( )

NAME

usbHandleShutdown( ) - Shuts down the handle utility library

SYNOPSIS

STATUS usbHandleShutdown (void)

DESCRIPTION

Shuts down the handle utility library. When calls to usbHandleInitialize( ) have been nested, usbHandleShutdown( ) must be called a corresponding number of times.

RETURNS

OK or ERROR

SEE ALSO

usbHandleLib


USB libraries : Routines

usbHandleCreate( )

NAME

usbHandleCreate( ) - Creates a new handle

SYNOPSIS

STATUS usbHandleCreate
    (
    UINT32          handleSignature, /* Arbitrary handle signature */
    pVOID           handleParam,     /* Arbitrary handle parameter */
    pGENERIC_HANDLE pHandle          /* Newly allocated handle */
    )

DESCRIPTION

Creates a new handle. The caller passes an arbitrary handleSignature and a handleParam. The handleSignature will be used in subsequent calls to usbHandleValidate( ).

RETURNS

OK or ERROR

ERRNO

 S_usbHandleLib_NOT_INITIALIZED
 S_usbHandleLib_BAD_PARAM
 S_usbHandleLib_GENERAL_FAULT
 S_usbHandleLib_OUT_OF_HANDLES

SEE ALSO

usbHandleLib


USB libraries : Routines

usbHandleDestroy( )

NAME

usbHandleDestroy( ) - Destroys a handle

SYNOPSIS

STATUS usbHandleDestroy
    (
    GENERIC_HANDLE handle     /* handle to be destroyed */
    )

DESCRIPTION

This functions destroys the handle created by calling usbHandleCreate( ).

RETURNS

OK or ERROR

ERRNO

 S_usbHandleLib_GENERAL_FAULT
 S_usbHandleLib_BAD_HANDLE

SEE ALSO

usbHandleLib


USB libraries : Routines

usbHandleValidate( )

NAME

usbHandleValidate( ) - Validates a handle

SYNOPSIS

STATUS usbHandleValidate
    (
    GENERIC_HANDLE handle,          /* handle to be validated */
    UINT32         handleSignature, /* signature used to validate handle */
    pVOID *        pHandleParam     /* Handle parameter on return */
    )

DESCRIPTION

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.

RETURNS

OK or ERROR

ERRNO

 S_usbHandleLib_NOT_INITIALIZED
 S_usbHandleLib_BAD_HANDLE

SEE ALSO

usbHandleLib