Dan Williams <dcbw@xxxxxxxxxx> writes: > Sigh... I completely failed getting the script to work, because > Device::USB fails to build it's shared library, because it wants the old > libusb (0.9?) Yes, it requires the old libusb, which is version 0.1 I believe. 0.9 could be some 1.0-pre thing? Don't know. Device::USB was the perl binding which showed up first. I just didn't put any thought into this choice at all. It was packaged in Debian and that is good enough for me. Means that some brave Debian maintainer has gone through all the hassles getting it to build so that I won't have to. Sorry that this caused you such problems. My intention was really choosing something with a fair chance of being supported in current distros. I realize now that I failed... > but happily enough when building it finds libusb-1.0 (the new version) > and uses that, proceeding to segfault when running. And of course, > attempting to build it against the new library (with headers in > /usr/include/libusb-1.0) fails because it can't find the headers, and > I'm not manly enough to figure out how to patch CPAN stuff. The 0.1 and 1.0 APIs are incompatible. The code must be rewritten to use 1.0. > And yes, > both libusb (0.9) and libusb1 (1.0) have to be installed in parallel > because half the distro depends on one, half on the other. Whee. Yes, that's the only possible result when you change a library API to something completely different (if we are talking about 0.1 and 1.0). Rewriting all applications using the old API will take infinite time, leaving the distros with the two options: 1) keep both libraries, or 2) drop some applications But keeping both should be no problem, given that you do like Debian and reserve the "libusb" name for the old API: bjorn@nemi:~$ pkg-config --modversion --libs --cflags libusb 0.1.12 -lusb bjorn@nemi:~$ pkg-config --modversion --libs --cflags libusb-1.0 1.0.11 -I/usr/include/libusb-1.0 -lusb-1.0 > So in short, do you have an older version that doesn't require > Device::USB somewhere? ISTR a few months ago you did. No, I am sorry but I didn't. I might have talked about doing a C version, but never got around to doing it. Made the perl thing because that was something I could do in literally no time. Not good for code quality, but better than nothing. Rewriting the whole thing in any language with libusb bindings should be easy, but it will take *me* more time than I've got for such projects. The script just does (in libusb-1.0 terms): libusb_init() libusb_open_device_with_vid_pid() libusb_get_active_config_descriptor() /* foreach interface, if the interface descriptor has one of the * possibe endpoint configs (intr in + bulk in/out or only intr in): */ { libusb_kernel_driver_active() libusb_detach_kernel_driver() libusb_claim_interface() libusb_control_transfer() // out // sleep some time libusb_control_transfer() // in libusb_release_interface() } libusb_close() libusb_exit() The message to send is constant. The received message must be parsed. Bjørn -- 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