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

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

 



On Wed, 25 May 2011, Arvid Brodin wrote:

> 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)?

The port status information is not exported to userspace in any way 
other than the kernel log.

Alan Stern

--
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