Re: Determining endpoint number from event callback
I am not familiar with all the details of a USB stack, so what I have deduced is only based on examining Harmony source code. The endpoints are defined in the system_config.h file for each cdc "instance". A callback is registered for each instance, so the callback associates a USB event with the correct instance (endpoint?). There are read complete and write complete events defined, so you can set flags to show which device was involved.
Although I see there are Interrupt endpoints defined, I have not used them. They must be buried in the USB stack.
Here is the sequence that I used to configure the USB stack:
USB_DEVIVE_Open() // returns a deviceHandle
USB_DEVICE_EventHandlerSet(handle, device_callback,0) //registers a device callback
USBDeviceEventHandler(event,0) // returns device events
when a USB_DEVICE_EVENT_CONFIGURED device event occurs, then callbacks are registered for each CDC device (USB_DEVICE_CDC_EventHandlerSet(instance, cdc_callback0, data);
The cdc_callback responds to CDC events, such as read_complete, etc. and a flag can be set for your applications code to take some action.