USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > a) System Interaction Functions > USB_DEVICE_Status Function
MPLAB Harmony USB Stack
USB_DEVICE_Status Function

This function provides the current status of the USB device layer.

C
SYS_STATUS USB_DEVICE_Status(
    SYS_MODULE_OBJ object
);
Preconditions

The USB_DEVICE_Initialize function must have been called before calling this function.

Parameters
Parameters 
Description 
object 
Driver object handle, returned from USB_DEVICE_Initialize 
Returns

SYS_STATUS_READY - Indicates that the device is busy with a previous system level operation and cannot start another 

SYS_STATUS_UNINITIALIZED - Indicates that the device layer is in a deinitialized state

Remarks

None.

Example
// This code example shows how the USB_DEVICE_Status function
// can be used to check if the USB Device Layer is ready
// for client operations. 

SYS_MODULE_OBJ      object;     // Returned from DRV_USB_Initialize
SYS_STATUS          status;

status = USB_DEVICE_Status(object);

if (SYS_STATUS_READY != status)
{
    // Handle error
}