Member
Registered: Nov 2009
Location: Burnaby BC
Posts: 77
Original Poster
Rep:
|
After hours of searching on the web, I found out that bluez-utils 3.7 doesn't support Dell bluetooth. Version 4.5 does, but I couldn't find the source for it. So I cut the code from 4.66 on CentOS 6, and patched the 3.7 version.
Here is the patch:
--- bluez-utils-3.7.orig/tools/hid2hci.c 2006-08-09 13:51:28.000000000 -0700
+++ bluez-utils-3.7/tools/hid2hci.c 2011-12-17 20:02:37.000000000 -0800
@@ -211,6 +211,52 @@
return err;
}
+static int switch_dell(struct device_info *devinfo)
+{
+ char report[] = { 0x7f, 0x00, 0x00, 0x00 };
+
+ struct usb_dev_handle *handle;
+ int err;
+
+ switch (devinfo->id->mode) {
+ case HCI:
+ report[1] = 0x13;
+ break;
+ case HID:
+ report[1] = 0x14;
+ break;
+ }
+
+ handle = usb_open(devinfo->dev);
+ if (!handle)
+ return -EIO;
+
+ /* Don't need to check return, as might not be in use */
+ usb_detach_kernel_driver_np(handle, 0);
+
+ if (usb_claim_interface(handle, 0) < 0) {
+ usb_close(handle);
+ return -EIO;
+ }
+
+ err = usb_control_msg(handle,
+ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0,
+ report, sizeof(report), 5000);
+
+ if (err == 0) {
+ err = -1;
+ errno = EALREADY;
+ } else {
+ if (errno == ETIMEDOUT)
+ err = 0;
+ }
+
+ usb_close(handle);
+
+ return err;
+}
+
static struct device_id device_list[] = {
{ HCI, 0x0a12, 0x1000, switch_hidproxy },
{ HID, 0x0a12, 0x0001, switch_hidproxy },
@@ -225,6 +271,9 @@
{ HCI, 0x046d, 0xc705, switch_logitech },
{ HCI, 0x046d, 0xc70a, switch_logitech }, /* Logitech diNovo mouse */
{ HCI, 0x046d, 0xc70e, switch_logitech }, /* logitech diNovo keyboard */
+ { HCI, 0x413c, 0x8154, switch_dell }, /* Dell Wireless 410 */
+ { HCI, 0x413c, 0x8158, switch_dell }, /* Dell Wireless 370 */
+ { HCI, 0x413c, 0x8162, switch_dell }, /* Dell Wireless 365 */
{ -1 }
};
|