Author Topic: Packing the report descriptor  (Read 6270 times)

gi

  • Member
  • ***
  • Posts: 27
Packing the report descriptor
« on: March 25, 2013, 10:06:32 pm »
Hi Jan,

I would like to ask what is wrong with my report descriptor here, I want to combine usages with the same global items.

Code: [Select]
0x06, 00, ff,                                                         /* Usage Page */
0x09, 0x10,                                                         /* Usage */
0xa1, 0x02,                                                         /* Collection (Logical) */
0x85, Dev_FEAT_REPORT_ID,                 /*   REPORT ID ()*/
0x15, 0,         /*      LOGICAL_MINIMUM ()*/
0x25, 3,          /*      LOGICAL_MAXIMUM () */
0x75, 2,    /*      REPORT_SIZE()      */
0x95, 1,            /*      REPORT_COUNT()      */
0x09, PERIPH_1,                                    /*  USAGE              */
0x09, PERIPH_2,                              /*  USAGE              */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x25, 1,          /*      LOGICAL_MAXIMUM () */
0x75, 1,    /*      REPORT_SIZE()      */
0x09, DEV_PERIPH_FLAG,          /*   USAGE                */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x25, 7          /*      LOGICAL_MAXIMUM () */
0x75, 3,    /*      REPORT_SIZE()      */
0x09, PERIPH_3,/*   USAGE                */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x95, 3,            /*      REPORT_COUNT()      */
0x09, PERIPH_4, /*   USAGE                */
0x09, PERIPH_5,                  /*   USAGE                */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x75, 2,    /*      REPORT_SIZE()     2-bits of PADDING */
0xB1, 1,                /*      FEATURE(CONSTANT)    */
0x09, PERIPH_6, /*   USAGE                */
0x09, PERIPH_7, /*   USAGE                */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x75, 2,    /*      REPORT_SIZE()     2-bits of PADDING */
0xB1, 1,                /*      FEATURE(CONSTANT)    */
0x09, PERIPH_8, /*   USAGE                */
0x09, PERIPH_9, /*   USAGE                */
0xB1, 2,                /*      FEATURE(Data,Var,Abs) */
0x75, 2,    /*      REPORT_SIZE()     2-bits of PADDING */
0xB1, 1,                /*      FEATURE(CONSTANT)    */
0xC0                                                                  /* End Collection */

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Packing the report descriptor
« Reply #1 on: March 25, 2013, 10:11:18 pm »
What happens when you try to use it? Does the device enumerate successfully? Can you send or receive any reports?

gi

  • Member
  • ***
  • Posts: 27
Re: Packing the report descriptor
« Reply #2 on: March 25, 2013, 10:42:38 pm »
Hi Jan,

Thanks for the very quick reply.

When I try to use it (plug it in my PC) the HID-device entry in busdog did not appear. But when I try to remove this descriptor it display in busdog sniffer.

Here is what I want to achieve.


thanks and hope you can help me on this.
« Last Edit: March 25, 2013, 10:45:24 pm by gi »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Packing the report descriptor
« Reply #3 on: March 26, 2013, 10:49:20 pm »
One way to debug a report descriptor is to simplify it. Start with a known good descriptor and edit it/add to it gradually.

After changing descriptors, Windows might remember previous descriptors unless you change the Product ID or delete the device in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\<VVVVPPPPRRRR>                   

VVVV is the vendor id
PPPP is the product id
RRRR is the revision number.