8 years, 2 months ago.

BLE HID Report Size greater 8bit

Dear Community,

Im trying to write an absolute coordinates mouse or digital pen HID descriptor. I was successful with both, but there is a very restricting limitation, I can not figure out how to resolve. Following descriptor works successful with Windows 8/10 for example for a Digital Pen device:

Digital Pen HID descriptor

    0x05, 0x0d,                         // USAGE_PAGE (Digitizers)
    0x09, 0x02,                         // USAGE (Pen digitizer)
    0xa1, 0x01,                         // COLLECTION (Application)
    0x85, 0x01,                         //   REPORT_ID (Digi)
    0x05, 0x0d,                         //   USAGE_PAGE (Digitizers)
    0x09, 0x20,                         //   USAGE (Stylus)
    0xa1, 0x00,                         //   COLLECTION (Physical)
    0x09, 0x42,                         //     USAGE (Tip Switch)
    0x09, 0x32,                         //     USAGE (In Range)
    0x15, 0x00,                         //     LOGICAL_MINIMUM (0)
    0x25, 0x01,                         //     LOGICAL_MAXIMUM (1)
    0x75, 0x01,                         //     REPORT_SIZE (1)
    0x95, 0x02,                         //     REPORT_COUNT (2)
    0x81, 0x02,                         //     INPUT (Data,Var,Abs)
    0x75, 0x01,                         //     REPORT_SIZE (1)
    0x95, 0x06,                         //     REPORT_COUNT (6)
    0x81, 0x01,                         //     INPUT (Cnst,Ary,Abs)
    0x05, 0x01,                         //     USAGE_PAGE (Generic Desktop)
    0x26, 0xff, 0x03,                   //     LOGICAL_MAXIMUM (1023)       
    0x75, 0x08,                         //     REPORT_SIZE (8) <------------------- 8 = maximum?
    0x95, 0x01,                         //     REPORT_COUNT (1)            
    0x55, 0x0F,                         //     UNIT_EXPONENT (-1)           
    0x65, 0x11,                         //     UNIT (cm,SI Linear)                  
    0x35, 0x00,                         //     PHYSICAL_MINIMUM (0)         
    0x46, 0xff, 0x03,                 //     PHYSICAL_MAXIMUM (1023)
    0x09, 0x30,                         //     USAGE (X)                    
    0x81, 0x02,                         //     INPUT (Data,Var,Abs)         
    0x09, 0x31,                         //     USAGE (Y)                    
    0x81, 0x02,                         //     INPUT (Data,Var,Abs)
    0xc0,                               //   END_COLLECTION
    0xc0,                               // END_COLLECTION

Notice the REPORT_SIZE field for X/Y works only, when its set to maximum 8 bit. Which means I have a resolution from -127 to 127 or unsigned 0-255. For a screen resolution of 1280x720 it is way too less. I want to increase the resolution. I tried to set the field REPORT_SIZE to 0x10, which should be 16bit (also 0x0A, 10 bit). But then no input signals are received on the host (windows 8 or 10), whereas 8bit shows the cursor jumping to absolute coordinates. With Digital Pen I see a bubble kind of cursor.

This is how I send data with 16bit report size using the HIDServiceBase.h class as parent (I took the HID mouse example and modified it):

report

        report[0] = 0x01; // report id
        report[1] = buttons; // up or down event
        report[2] = (uint8_t)(x & 0x00FF); 
        report[3] = (uint8_t)((x & 0xFF00) >> 8);
        report[4] = (uint8_t)(y & 0x00FF);
        report[5] = (uint8_t)((y & 0xFF00) >> 8);

        send(report);

If its 8bit, Im not shifting the x and y variable bits.

Does somebody know, if there is some kind of 8bit-limitation on the report_size? Or is something wrong with the descriptor or the report above? Can I set the maximum report_size somewhere?

Tips and ideas how to continue are much appreciated! I can test any suggestions.

Thanks!

Be the first to answer this question.