Hacker News new | ask | show | jobs
by devy 3739 days ago
Good point. I wonder if there is a way to detect USB cable being plugged into the port?
1 comments

You'd need the USB port, hub it's plugged into, all the way to the controller, to be aware of passing this information around, though you could probably use any sort of reporting on total voltage/amperage downstream for detecting it if it reported that information.

(Unfortunately, AFAIK, most USB hubs don't report power draw for devices that are "just" drawing power and don't use the data pins, so you don't get that.)