Jump to main content

##

# 2.2.4.11 USB_DEVICE_IsSuspended Function

## C

    bool USB_DEVICE_IsSuspended(
        USB_DEVICE_HANDLE usbDeviceHandle
    );

## Summary

This function returns true is the device is presently in suspended state. The application can use this function in conjunction with the USB_DEVICE_StateGet function to obtain the detailed state of the device (such as addressed and suspended, configured and suspended etc.). The Device Layer also provides the macro USB_DEVICE_EVENT_SUSPENDED event to indicate entry into suspend state.

## Precondition

The USB Device Layer must have been initialized and opened before calling this function.

## Parameters

Param | Description
--- | ---
usbDeviceHandle | Pointer to the Device Layer Handle that is returned from USB_DEVICE_Open

## Returns

Returns true if the device is suspended.

## Example

    // This code example shows how the application
    // can find out if the device is in a configured but suspended state.

    if(USB_DEVICE_IsSuspended(usbDeviceHandle))
    {
        // Device is in a suspended state.

        if(USB_DEVICE_STATE_CONFIGURED == USB_DEVICE_StateGet(usbDeviceHandle))
        {
            // This means the device is in configured and suspended state.

        }
    }

## Remarks

None.