Hey Marcel, On Sat, 2007-06-16 at 21:35 +0200, Marcel Holtmann wrote: > > What we could do is: > > 1) have a HAL addon that will set the device's bdaddr in a property of > > the device when plugged into USB > > I think a HAL addon that export the BD_ADDR of the controller as a > property is a good idea. We might also wanna add the current configured > host controller for that device and add a method to change that address. That would be pretty straight forward, although probably unnecessary in this particular case. > > 2) have bluetooth-applet (or any other front-end) ask the user whether > > to set the device as trusted when it's plugged in (can be switched off > > with a config item) > > Personally I think this should happen without any user-interaction once > you plugin the controller. However haven't thought about it that much. How do we need to behave when there's more than one bluetooth adapter in the machine? > > 3) Add a method to the input service (AddUSBDevice(string address, > > string usbdev) that will get the USB HID report descriptor, and set the > > device as trusted along with the rest of the info > > No. I don't wanna have hardware specific methods in that API. Well, it would do the work of adding the usb device to the database as trusted, and copying the HID report descriptor data over. > > I could work on that (it should be pretty straight-forward), except I > > don't have any code to get the bdaddr from the device and I don't know > > how to get the HID report descriptor from the device either. If you have > > some code that does that, feel free to pass it on, I can do the > > integration. > > Check http://www.holtmann.org/papers/bluetooth/csw2007_slides.pdf and > you will see the report ids that will give you that information. I do > have code for that, but can't find it right now. Maybe it is on one of > my machines that I switched off. Got it (after much brain damage), thanks. I've cooked up the attached program. The goal is: - Run program from udev when device is plugged in - Program gets host bdaddr, device bdaddr and hid report descriptor - Sets the host bdaddr on the device - Stores the HID report descriptor in the input storage So, the process would be all automated, and hopefully integrated in bluez-utils. It could easily be extended to other device types (such as the proxy dongles) given a method of getting the device's bluetooth address(es). An example program attached, that I'd like to integrate into bluez-utils. Not really tested, as my system decided to not give me the HID desc report anymore... Marcel, could you check the USB HID desc report <-> hidp_connadd_req code? The compile line is at the top of the file, you need to run the compilation from within bluez-utils/input/ Cheers -- Bastien Nocera