How best to get over-current notification to user application?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

What's the best way to get a notification in user space when an overcurrent
event occurs on a usb port? The idea is to let a user application notify the
user that something is wrong.

When a usb port is short-circuited (or otherwise over-loaded), a message like
this is sent to the system log:

	hub 1-1:1.0: over-current change on port 3

So one solution would be to create a chain of pipes, running something like
'tail -f /var/log/messages | egrep "hub.*over-current change"' and read the
output from this in the program. Is there a better way (some kind of sysfs
interface for port power state, maybe)?

Thanks,
Arvid Brodin
Enea Services Stockholm AB
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux