2.2.4.7 USB_DEVICE_ClientStatusGet Function
C
USB_DEVICE_CLIENT_STATUS USB_DEVICE_ClientStatusGet(
USB_DEVICE_HANDLE usbDeviceHandle
);
Summary
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.
Precondition
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.
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. } }
Remarks
The application may ordinarily not find the need to use this function. It can be used for troubleshooting or debugging purposes.