none
Combined device HID descriptor does not seem to work in Windows 8 RRS feed

  • Question

  • I am building a Bluetooth LE device with the following HID descriptor:

        0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
        0x09, 0x06,                    // USAGE (Keyboard)
        0xa1, 0x01,                    // COLLECTION (Application)
        0x85, 0x01,                    //   REPORT_ID (1)
        0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
        0x19, 0xe0,                    //   USAGE_MINIMUM (Keyboard LeftControl)
        0x29, 0xe7,                    //   USAGE_MAXIMUM (Keyboard Right GUI)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
        0x75, 0x01,                    //   REPORT_SIZE (1)
        0x95, 0x08,                    //   REPORT_COUNT (8)
        0x81, 0x02,                    //   INPUT (Data,Var,Abs)
        0x95, 0x01,                    //   REPORT_COUNT (1)
        0x75, 0x08,                    //   REPORT_SIZE (8)
        0x81, 0x03,                    //   INPUT (Cnst,Var,Abs)
        0x95, 0x05,                    //   REPORT_COUNT (5)
        0x75, 0x01,                    //   REPORT_SIZE (1)
        0x05, 0x08,                    //   USAGE_PAGE (LEDs)
        0x19, 0x01,                    //   USAGE_MINIMUM (Num Lock)
        0x29, 0x05,                    //   USAGE_MAXIMUM (Kana)
        0x91, 0x02,                    //   OUTPUT (Data,Var,Abs)
        0x95, 0x01,                    //   REPORT_COUNT (1)
        0x75, 0x03,                    //   REPORT_SIZE (3)
        0x91, 0x03,                    //   OUTPUT (Cnst,Var,Abs)
        0x95, 0x06,                    //   REPORT_COUNT (6)
        0x75, 0x08,                    //   REPORT_SIZE (8)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x25, 0x65,                    //   LOGICAL_MAXIMUM (101)
        0x05, 0x07,                    //   USAGE_PAGE (Keyboard)
        0x19, 0x00,                    //   USAGE_MINIMUM (Reserved (no event indicated))
        0x29, 0x65,                    //   USAGE_MAXIMUM (Keyboard Application)
        0x81, 0x00,                    //   INPUT (Data,Ary,Abs)
        0xc0,                          // END_COLLECTION
        0x05, 0x0c,                    // USAGE_PAGE (Consumer Devices)
        0x09, 0x01,                    // USAGE (Consumer Control)
        0xa1, 0x01,                    // COLLECTION (Application)
        0x85, 0x02,                    //   REPORT_ID (2)
        0x05, 0x0c,                    //   USAGE_PAGE (Consumer Devices)
        0x0a, 0x08, 0x01,              //   USAGE (Police Alarm)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
        0x75, 0x01,                    //   REPORT_SIZE (1)
        0x95, 0x01,                    //   REPORT_COUNT (1)
        0x81, 0x02,                    //   INPUT (Data,Var,Abs)
        0x75, 0x07,                    //   REPORT_SIZE (7)
        0x95, 0x01,                    //   REPORT_COUNT (1)
        0x81, 0x01,                    //   INPUT (Cnst,Ary,Abs)
        0xc0,                          // END_COLLECTION
        0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
        0x09, 0x02,                    // USAGE (Mouse)
        0xa1, 0x01,                    // COLLECTION (Application)
        0x09, 0x01,                    //   USAGE (Pointer)
        0xa1, 0x00,                    //   COLLECTION (Physical)
        0x85, 0x03,                    //     REPORT_ID (3)
        0x95, 0x03,                    //     REPORT_COUNT (3)
        0x75, 0x01,                    //     REPORT_SIZE (1)
        0x05, 0x09,                    //     USAGE_PAGE (Button)
        0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
        0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)
        0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
        0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
        0x81, 0x02,                    //     INPUT (Data,Var,Abs)
        0x95, 0x01,                    //     REPORT_COUNT (1)
        0x75, 0x05,                    //     REPORT_SIZE (5)
        0x81, 0x01,                    //     INPUT (Cnst,Ary,Abs)
        0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)
        0x09, 0x30,                    //     USAGE (X)
        0x09, 0x31,                    //     USAGE (Y)
        0x15, 0x81,                    //     LOGICAL_MINIMUM (-127)
        0x25, 0x7f,                    //     LOGICAL_MAXIMUM (127)
        0x75, 0x08,                    //     REPORT_SIZE (8)
        0x95, 0x02,                    //     REPORT_COUNT (2)
        0x81, 0x06,                    //     INPUT (Data,Var,Rel)
        0xc0,                          //   END_COLLECTION
        0xc0                           // END_COLLECTION

    When connected to Windows, the mouse input works but the keyboard input does not.  Both work when connected to a Mac.

    Thursday, February 20, 2014 12:24 AM

Answers

  • I have finally solved this problem.  This issue was I was sending 9 bytes of data on the keyboard report instead of 8 which the descriptor requires.  It works in both OSs now.

    As a sidenote, the Windows 8 bluetooth connection management/stability is an order of magnitude better than OS X, which crashes all the time and often fails to connect ;) Although I did have another problem where I couldn't remove the device and had to reinstall Windows to fix it...so swings and roundabouts!

    • Marked as answer by nrbrk Wednesday, February 26, 2014 1:46 PM
    Wednesday, February 26, 2014 1:16 PM

All replies

  • What do you see in Device Manager when the device is paired ? If you open Device Manager -> View ->Devices by connection and expand the tree, does it show both Mouse and Keyboard enumerated.
    Tuesday, February 25, 2014 1:36 AM
  • I can't seem to see it in device manager.  I can see the Bluetooth device but it doesn't have anything underneath it.  However, it does appear in Devices and Printers, and this is what I see (device name removed)

    http://i.imgur.com/ZE0vwGO.png

    Edit - I hadn't scrolled down: http://i.imgur.com/FnybLUi.png

    What's strange is it does work if I remove either the keyboard or the mouse from the descriptor.  But together the keyboard stops working.


    • Edited by nrbrk Tuesday, February 25, 2014 7:27 AM
    Tuesday, February 25, 2014 7:25 AM
  • From the images you shared, it would appear that the Keyboard and Mouse are both enumerated which seems to suggest that the descriptor is fine. I'm wondering if you are somehow not sending the correct data - for example the report ID for mouse packets is mixed up with that of keyboard packets ? Since keystrokes are secure pipes, we can't really tap into it without attaching a kernel debugger.
    Tuesday, February 25, 2014 7:08 PM
  • As I mentioned, it works on OS X.  I don't think GATT sends the report ID with the data.  Here is an L2CAP packet on GATT notification:

    0c00 0400 1b42 0000 0000 5200 0000 0000

    The opcode is 0x1b which is notification, 0x42 which indicated the attribute handle (the GATT characteristic, which defined the report ID in a descriptor), then the rest is the HID report data.  0x52 is arrow key up.

    The report ID is defined as a constant in a descriptor on the characteristic.  It has to be working as otherwise OS X wouldn't know which one was mouse and which was keyboard.  I changed the order the characteristics are listed but it still works fine on OS X, which means that OS X correctly parses the report ID descriptor.

    Windows also seems to parse the report ID descriptor correctly.  The hardware ID is

    HID\{00001812-0000-1000-8000-00805f9b34fb}_Dev_VID&012201_PID&0100_REV&0100&Col01

    I think Col01 indicates Report ID 1.  The mouse is correctly identified as Col03.

    Is there a way to get information about the parsing of the bluetooth ATT packet?  Or anywhere I should be looking for logs?


    • Edited by nrbrk Tuesday, February 25, 2014 8:29 PM
    Tuesday, February 25, 2014 7:41 PM
  • I am a bit confused now as it doesn't seem to work with just the keyboard descriptor from the HID spec, report reference 0x0001 (no report id, input).  Again, it works on OS X.
    Tuesday, February 25, 2014 11:10 PM
  • I have finally solved this problem.  This issue was I was sending 9 bytes of data on the keyboard report instead of 8 which the descriptor requires.  It works in both OSs now.

    As a sidenote, the Windows 8 bluetooth connection management/stability is an order of magnitude better than OS X, which crashes all the time and often fails to connect ;) Although I did have another problem where I couldn't remove the device and had to reinstall Windows to fix it...so swings and roundabouts!

    • Marked as answer by nrbrk Wednesday, February 26, 2014 1:46 PM
    Wednesday, February 26, 2014 1:16 PM