Ports and Interfaces > USB

help with a simple report design change

(1/2) > >>

ulao:
I'm having trouble with this. I want to change the following report.

Currently the 17 and 18 allowing 128 bytes.  Or at least this is what it show allow. 18 has 131 because its 128+report id + address. I'm not %100  sure why the 17 shows 127. 129 would make more sense to me. (this was a borrowed example).


 0xa1, 0x01,                    // COLLECTION (Application)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
        0x75, 0x08,                    //   REPORT_SIZE (8)
   
        0x85, 0x11,                    //   REPORT_ID (17)
        0x95, 0x7f,                    //   REPORT_COUNT (127) ***
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
   
        0x85, 0x12,                    //   REPORT_ID (18)
        0x95, 0x83,                    //   REPORT_COUNT (131) ***
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0,                           // END_COLLECTION


My goal is to allow both reports to allow 512


but everything I try fails enumeration. I'm thinking the header bytes need to change for larger amounts (i.e 0x26 to 0x27) .  I'm also not sure if I need to change my logical max. I bolded the areas I think have to change.

0xa1, 0x01,                    // COLLECTION (Application)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255) <---1024?
        0x75, 0x08,                    //   REPORT_SIZE (8)
   
        0x85, 0x11,                    //   REPORT_ID (17)
        0x95, 0x7f, #x##,          //   REPORT_COUNT (127) <---513 ?
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
   
        0x85, 0x12,                    //   REPORT_ID (18)
        0x95, 0x83 #x##,           //   REPORT_COUNT (131)  <---515 ?
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0,                           // END_COLLECTION

Jan Axelson:
Report count does not include report ID or other info, just the number of bytes of report data, assuming report size = 8..

If report size = 512 (200h), the first item should be 96.

26h for logical max = 512 (200h) is correct.

See 6.2.2.7 in the HID spec.

ulao:
So I did this but on my report 17 I get "get descriptor" instead of "get report" ?

     //long
    0xa1, 0x01,                    // COLLECTION (Application)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x26, 0xff,                    //   LOGICAL_MAXIMUM (255)
        0x75, 0x08,                    //   REPORT_SIZE (8)
   
        0x85, 0x13,                    //   REPORT_ID (19)
        0x96, 0x02, 0x01,              //   REPORT_COUNT (512)
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x00,              //   FEATURE (Data,Var,Abs,Buf)
   
        0x85, 0x14,                    //   REPORT_ID (20)
        0x96, 0x02, 0x00,              //   REPORT_COUNT (512)
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0,                           // END_COLLECTION
   
    //short
    0xa1, 0x01,                    // COLLECTION (Application)
        0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
        0x26, 0xff,                    //   LOGICAL_MAXIMUM (255)
        0x75, 0x08,                    //   REPORT_SIZE (8)
   
        0x85, 0x11,                    //   REPORT_ID (17)
        0x95, 0x40,                    //   REPORT_COUNT (64)
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x00,              //   FEATURE (Data,Var,Abs,Buf)
   
        0x85, 0x12,                    //   REPORT_ID (18)
        0x95, 0x40,                   //   REPORT_COUNT (64)
        0x09, 0x00,                    //   USAGE (Undefined)
        0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0,                           // END_COLLECTION


I can't imagine what I did wrong there.  Maybe my error is else where.

this is my code
device.GetFeatureReport(inputReportBuffer, 64); //64

Jan Axelson:
I don't know what you mean by this:

on my report 17 I get "get descriptor" instead of "get report" ?

ulao:
Sorry, I was sniffing the USB and this report should be a get report but I'm seeing get descriptor instead? Somehow this descriptor change has corrupt things. Previous advice about uninstalling already applied.

Navigation

[0] Message Index

[#] Next page

Go to full version