From: Vojtech P. <vo...@su...> - 2001-06-27 08:35:22
|
On Mon, Jun 25, 2001 at 06:17:35PM +0300, Matan Ziv-Av wrote: > On Sun, 24 Jun 2001, Vojtech Pavlik wrote: > > > On Sun, Jun 24, 2001 at 08:26:45AM -0700, James Simmons wrote: > > > > > > > simple, really. open(fd,/proc/bus/usb/devices), select(fd). Select will > > > > stop blocking once the file changes. > > > > > > That I got. How do you determine which device got attached ordetected? > > > > You read the file contents, of course. You get a list of attached > > devices, all with names and vendor/product IDs, possibly more. You > > compare it to what you've read last time, the difference is devices that > > connected/disconnected. > > > What about non usb devices? > Conncecting/disconnecting devices should be solved in the input/evdev > layer, without relying on other subsystems. I was suggesting creating /proc/input/devices, working the same way as the USB one does. -- Vojtech Pavlik SuSE Labs |