USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > b) Client Core Functions > USB_DEVICE_ClientStatusGet Function
MPLAB Harmony USB Stack
USB_DEVICE_ClientStatusGet Function

This function returns the status of the client (ready or closed). The application can use this function to query the present state of a client. Some of the USB Device Layer functions do not have any effect if the client handle is invalid. The USB_DEVICE_ClientStatusGet function in such cases can be used for debugging or trouble shooting.

C
USB_DEVICE_CLIENT_STATUS USB_DEVICE_ClientStatusGet(
    USB_DEVICE_HANDLE usbDeviceHandle
);
Preconditions

The USB device layer must have been initialized and opened before calling this function.

Parameters
Parameters 
Description 
usbDeviceHandle 
Pointer to the device layer handle that is returned from USB_DEVICE_Open 
Returns

USB_DEVICE_CLIENT_STATUS type of client status.

Remarks

The application may ordinarily not find the need to use this function. It can be used for troubleshooting or debugging purposes.

Example
// This code example shows usage of the
// USB_DEVICE_ClientStatusGet function.

if(USB_DEVICE_CLIENT_STATUS_READY == USB_DEVICE_ClientStatusGet(usbDeviceHandle))
{
    // Client handle is valid.
    if(USB_DEVICE_IsSuspended(usbDeviceHandle))
    {
        // Device is suspended. Do something here.
    }
}