USB Libraries Help > USB Host Libraries > USB CDC Host Library > Library Interface > a) Client Access Functions > USB_HOST_CDC_Open Function
MPLAB Harmony USB Stack
USB_HOST_CDC_Open Function

This function will open the specified CDC device. Once opened, the CDC device can be accessed via the handle which this function returns. The cdcDeviceObj parameter is the value returned in the USB_HOST_CDC_ATTACH_EVENT_HANDLER event handling function.

C
USB_HOST_CDC_HANDLE USB_HOST_CDC_Open(
    USB_HOST_CDC_OBJ cdcDeviceObj
);
Preconditions

The client handle should be valid.

Parameters
Parameters 
Description 
cdcDeviceObj 
CDC device object handle returned in the USB_HOST_CDC_ATTACH_EVENT_HANDLER function. 
Returns

Will return a valid handle if the device could be opened successfully, else will return USB_HOST_CDC_HANDLE_INVALID. The function will return a valid handle if the device is ready to be opened.

Remarks

None.

Example