From: Russell Williams Date: 2006-12-03T03:34:06+09:00 Subject: Re: USB ------_=_NextPart_001_01C71640.6F0FAB4C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable javra: > >Google for libusb. >The first two hits are for the *nix project and the Windows port of it. >Might help. You'd have to write a Ruby-C extension for it though. >Might turn out to be easier/faster than writing your own USB driver, if >that's what you meant. Libusb is reasonably easy to use, but a big catch on *nix is that you = have to be running as root. Not a good idea for your entire = application. So I found it easier to write a small C daemon that = listens to a *nix domain socket and send through what it gets to the USB = device using appropriate libusb calls. You could also write some = Ruby-to-libusb wrappers and then write the daemon in Ruby instead of C = if you wanted to learn the Ruby-to-C interfaces, but in my view that's = adding needless complexity. Depending on the type of USB device the = amount of device control vs. data that you need to make to talk to it = can be quite complex. I'm happy to share the daemon source if you send = me some private mail. =20 The best way to figure out how to talk to your device is to reverse = engineer what a manufacturer-provided Windows driver does unless you = happen to have good device-level USB documentation. You can do this by = looking at logs snapped by SnoopyPro. =20 ------_=_NextPart_001_01C71640.6F0FAB4C--