USB Client connection Event

Is there possibe to attach to an event that listens if a USB host is connected?

ie. USBClientController.HostConnectedEvent ???

Start by reading the USB Host support tutorial.

I think you missunderstod me, I like to have an event when a Host is connected to USBizi not when a device is connected to USBizi.

I don’t think you understand what USB host support means. What are you trying to achieve?

Mike, forget the words “host” and “Device” for a sec :slight_smile: He is tying to connect USBizi to a PC and want USBizi to raise an event if the PC was detected.

I think the best and easiest way would be by detecting power coming from the PC, connect the power pin to one of the IOs.

I think I miss understood the question. :slight_smile:

Maybe the OP wants to know if USB debugging is active?

Thanks Gus!

A thought came to me…

Usually, when you are configuring a device as a USB client, it is receiving power via the USB cable that is connected to the PC.

So, if your device is powered on, it is physically connected to the PC. Why would you need an event? :slight_smile:

If the device starts with debug port = COM and a PC is connected to USB I enable mass storage. And when the pc is disconnected I need to reboot the device so all file updates made on the device Will take effect.

If I hade an event when the pc was connected/disconnected then I could make this without any performance reduce (poll method).

If the debug port is COM I Always get “stopped” when getting USB client State even when the PC is connected?