How to handle different report IDs in USB ROM Stack?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to handle different report IDs in USB ROM Stack?

371 Views
ssudhir
Contributor II

Hi,

We have the following code  in the  GerReport Handler.

uint8_t ReportID = pSetup->wValue.WB.L;

                switch (pSetup->wValue.WB.H) {

                case HID_REPORT_INPUT:

                 //now think if different report ID

                  switch (ReportID)

                  {

                    case 0: //when we don't define

                      *pBuffer = input_report;

                      *plength = 8;

                      break;

                  case 1: //when we defined report ID as 1

                    *pBuffer = input_report;

                      *plength = 8;

                      break;

                  }

                                break;

 

                case HID_REPORT_OUTPUT:

                //bns 3/19 shoudl never be here !

                                return ERR_USBD_STALL;                                             // Not Supported

                break;

 

                case HID_REPORT_FEATURE:

                switch (ReportID)

                {

                case 0:  //when we don't define

                                   

                  *pBuffer = feature_report;

                  *plength = 1;

                  break;

                case 3: // when we define report ID as 1

                  *pBuffer = feature_report;

                  *plength = 64;

                  break;

                 

                }

               

                break;

                }

                return LPC_OK;

 

We can establish HID communication with the host and LPC4357 when we don't define report ID  in our report descriptor. (by default report ID 0)  . However, when we specify a report ID in our descriptor, the host is not able to get either feature or Input report. We do hit the breakpoint. At the host side, the application code store specifies report ID for the output report. Fr example, if the output length is 64, we assign 65 bytes, and in the first byte we store the report ID. At the device side, we assumed that the USB Stack is handling it.  However, when we change the report ID, the host mentions  - incompatible report ID.  What is that we need to do to handle different report IDs

Thanks

0 Kudos
1 Reply

318 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Just according to your description, I've not found out the cause of the phenomen yet.
So I'd like to learn more information about the phenomenon to dig deeper, I was wondering if you can share the update HID report descriptor you mentioned and the complete demo code you ran.
Looking forward to your reply.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos