From: Matan Ziv-Av <ma...@sv...> - 2001-06-25 15:18:35
|
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. -- Matan Ziv-Av. ma...@sv... |