Setting special features of logitech mice

Chantry Xavier x.chantry at wanadoo.fr
Mon Sep 12 14:02:25 PDT 2005


Hi,

There is a linux tool I miss a lot on freebsd : http://freshmeat.net/projects/logitech_applet/
According to the README : "This application provides basic control for some of the special features provided by Logitech mice.
There are three feature sets - the ability to switch the mouse
to a higher resolution, the ability to switch the "Smart Scroll"
feature, and Cordless Status Reporting."

This tool is based on libusb, which is portable (it's in /usr/ports/devel/libusb). logitech_applet compiled without problems on freebsd, but it doesn't do anything when running it (not even some output).
So I started looking at libusb.
There is a small testlibusb.c source file in work/libusb-0.1.10a/tests/.
After building the port, you can run work/libusb-0.1.10a/tests/testlibusb , but no output again. But if I run it with debug output  (USB_DEBUG=2 work/libusb-0.1.10a/tests/testlibusb), it returns :
usb_set_debug: Setting debugging level to 2 (on)
usb_os_find_busses: Found /dev/usb0
usb_os_find_busses: Found /dev/usb1
usb_os_find_busses: Found /dev/usb2
usb_os_find_busses: Found /dev/usb3

So it find the busses, but not any devices at all.
After many hours, I finally found it didn't find any devices because of that (work/libusb-0.1.10a/bsd.c , line 542) :
    if (strncmp(di.udi_devnames[0], "ugen", 4) != 0)
      /* best not to play with things we don't understand */
      continue;

So libusb only deals with generic devices (/dev/ugen*), and doesn't support the mouse device /dev/ums0. I tried to comment this code, then the testlibusb program complained it couldn't open the /dev/ums0 device because the device was busy. I killed moused, and now the error is :
USB error: couldn't get device descriptor for /dev/ums0: Inappropriate ioctl for device

After that, I was wondering if I couldn't rewrite a basic code that would only try to open the /dev/ums0, and then try one of the logitech_applet feature (eg getting the actual mouse resolution), so I went through some man pages (usb,ioctl,open,ums,...) and it looks like everything is here, but it's way too complicated for me :)
So if everyone could help me, or have some more accessible docs to recommend, it would be great.
I guess the best way to make this working is to implement ums support in libusb, but I've no idea how to do that.

Cheers,
	Xav



More information about the freebsd-usb mailing list