<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting HID Feature report for different Report IDs in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871619#M34752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our code also looks very similar to yours and when we set a break point it does hit there.&lt;/P&gt;&lt;P&gt;As I mentioned earlier it works with the descriptor that has on Report ID, but doesn't work when it has more than more report ID. However, in both cases, when we set a break point it hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static ErrorCode_t HID_GetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t * *pBuffer, uint16_t *plength)&lt;BR /&gt;{&lt;BR /&gt; /* ReportID = SetupPacket.wValue.WB.L; */&lt;BR /&gt; switch (pSetup-&amp;gt;wValue.WB.H) {&lt;BR /&gt; case HID_REPORT_INPUT:&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; *pBuffer = input_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HID_REPORT_OUTPUT:&lt;BR /&gt;&lt;BR /&gt; return ERR_USBD_STALL; // Not Supported &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;case HID_REPORT_FEATURE:&lt;BR /&gt;&lt;BR /&gt; *pBuffer = feature_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; &lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; return LPC_OK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Mar 2019 18:19:31 GMT</pubDate>
    <dc:creator>ssudhir</dc:creator>
    <dc:date>2019-03-21T18:19:31Z</dc:date>
    <item>
      <title>Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871617#M34750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Getting HID Feature report for different Report IDs&lt;/P&gt;&lt;P&gt;For Generic HID (LPC4357 – using ROM USB stack) when we have a report without different report&lt;/P&gt;&lt;P&gt;ID, and the count for all three reports are 64, &amp;nbsp;In the HID_GetReport Handler has the following code to get the feature report&lt;/P&gt;&lt;P&gt;*pBuffer = feature_report;&lt;/P&gt;&lt;P&gt;&amp;nbsp;*plength = 64;&lt;/P&gt;&lt;P&gt;At the Host end We are able to successfully get the feature report.&lt;/P&gt;&lt;P&gt;Some where in out EP Handler we are calling&lt;/P&gt;&lt;P&gt;USBD_API-&amp;gt;hw-&amp;gt;WriteEP(hUsb, pHidCtrl-&amp;gt;epin_adr, inbuffer, 64);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when we change our report structure with 3 different report ID (separate ID for Input, Output &amp;amp; Feature), &amp;nbsp;and also changed the count (Feature is still 64 but changed the Input to 8) the get report fails.&lt;/P&gt;&lt;P&gt;Any material about how to get Feature reports or explanation will be helpful.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2019 20:47:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871617#M34750</guid>
      <dc:creator>ssudhir</dc:creator>
      <dc:date>2019-03-19T20:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871618#M34751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello S S, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After finished the Report description, also Report data, then add the content in GetReport function as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_16.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/69705i1B4C984D7C6280A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_16.png" alt="pastedImage_16.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;set a breakpoint, check whether can run into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;TIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 10:26:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871618#M34751</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-03-21T10:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871619#M34752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our code also looks very similar to yours and when we set a break point it does hit there.&lt;/P&gt;&lt;P&gt;As I mentioned earlier it works with the descriptor that has on Report ID, but doesn't work when it has more than more report ID. However, in both cases, when we set a break point it hits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static ErrorCode_t HID_GetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t * *pBuffer, uint16_t *plength)&lt;BR /&gt;{&lt;BR /&gt; /* ReportID = SetupPacket.wValue.WB.L; */&lt;BR /&gt; switch (pSetup-&amp;gt;wValue.WB.H) {&lt;BR /&gt; case HID_REPORT_INPUT:&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; *pBuffer = input_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HID_REPORT_OUTPUT:&lt;BR /&gt;&lt;BR /&gt; return ERR_USBD_STALL; // Not Supported &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;case HID_REPORT_FEATURE:&lt;BR /&gt;&lt;BR /&gt; *pBuffer = feature_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; &lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; return LPC_OK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:19:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871619#M34752</guid>
      <dc:creator>ssudhir</dc:creator>
      <dc:date>2019-03-21T18:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871620#M34753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello S S,&lt;/P&gt;&lt;P&gt;How about the input_report in your code, does input_report[0] is right report ID ?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;*pBuffer = input_report;&lt;BR /&gt; *plength = 64;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and the plength should equal input data +1 (Report ID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About more then one ID, how do you configure Report description? Also check the report ID in Get report request in PC,&lt;/P&gt;&lt;P&gt;the input_report[0] should also use this report ID.&amp;nbsp; And what's the appearance about your said "doesn't work" ?&lt;/P&gt;&lt;P&gt;Also you can send me a simple project that can reproduce the problem, I will test it on my side .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 08:37:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871620#M34753</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-03-26T08:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871621#M34754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks TIC.&lt;/P&gt;&lt;P&gt;We made bit more progress and here is the description of our problem now. I have included the descriptor file, and also python code we use as a host in case you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we don’t define report ID in our report descriptor, it takes the default ID that is ‘0’. In that case, we didn’t have to set report ID in the input or feature report we are sending. It looked like ROM stack was adding the report ID. For example, the input buffer looked like this&lt;BR /&gt;[20,21,22,23,24,25,26,27]&lt;BR /&gt;The host receives this&lt;BR /&gt;[0, 20,21,22,23,24,25,26,27]&lt;/P&gt;&lt;P&gt;However, when we specify a report ID say 1 for the input report, as per your suggestion we added the report ID as the first byte and now the host receives&lt;BR /&gt;For example, report ID with ‘1’ our input buffer at the device side looks like this &lt;BR /&gt;[1,20,21,22,23,24,25,26,27]&lt;BR /&gt;And the &lt;BR /&gt;The host receives this&lt;BR /&gt;[1, 20,21,22,23,24,25,26,27]&lt;BR /&gt;Now regarding Report Descriptor with multiple report IDs&lt;/P&gt;&lt;P&gt;Here are our descriptor and the code too. &lt;BR /&gt;Our understanding is, we can define different report ID so that we can utilize the bus efficiently. For example, if a feature Report with ID as 2 can have 2 bytes and another feature report with ID as 3 can have 64 bytes and report ID 2 results in 2 bytes transfer and report ID 3 results in 64 bytes transfer. Is that true? In our case, reports are sent padding. For example, if the HID_FEATURE_REPORT_BYTES is defined 64, then all feature reports are sent as 64 bytes.&lt;BR /&gt;For example, feature report with ID ‘2’ looks like this at the device side &lt;BR /&gt;[2,10,11]&lt;BR /&gt;Then the host receives this&lt;BR /&gt;[2,10,11,0,0------0] – Total 65 bytes – because as I mentioned HID_FEATURE_REPORT_BYTES is defined 64.&lt;BR /&gt;What is that we need to do if we want to send different length reports without padding?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our descriptor&lt;/P&gt;&lt;P&gt;define HID_INPUT_REPORT_BYTES 8 /* size of report in Bytes */&lt;BR /&gt;#define HID_OUTPUT_REPORT_BYTES 64 /* size of report in Bytes */&lt;BR /&gt;#define HID_FEATURE_REPORT_BYTES 64 /* size of report in Bytes */&lt;BR /&gt;const uint8_t HID_ReportDescriptor[] = {&lt;BR /&gt; HID_UsagePageVendor(0x45),&lt;BR /&gt; HID_Usage(0x00), //name of hhe usage for the entire application&lt;BR /&gt; HID_Collection(HID_Application),&lt;BR /&gt; HID_Usage(0xA010), //name of the usage for the entire input report&lt;BR /&gt; HID_ReportID(0x01),&lt;BR /&gt; HID_Collection(HID_Logical),&lt;BR /&gt; HID_Usage(0xA011),&lt;BR /&gt; HID_Usage(0xA012),&lt;BR /&gt; HID_Usage(0xA013),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(3),&lt;BR /&gt; HID_Input(HID_Variable), &lt;BR /&gt; HID_Usage(0xA014),&lt;BR /&gt; HID_Usage(0xA015),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xF),&lt;BR /&gt; HID_ReportSize(4), &lt;BR /&gt; HID_ReportCount(2),&lt;BR /&gt; HID_Input(HID_Variable), &lt;BR /&gt; HID_Usage(0xA016),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(4),&lt;BR /&gt; HID_Input(HID_Variable), &lt;BR /&gt; HID_EndCollection, //end of input collection&lt;BR /&gt; HID_ReportID(0x02),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(HID_OUTPUT_REPORT_BYTES),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_Usage(0xA020),&lt;BR /&gt; HID_Output(HID_Variable),&lt;BR /&gt; HID_Usage(0xA0001), //name of the usage for the entire feature report&lt;BR /&gt; HID_ReportID(0x03),&lt;BR /&gt; HID_Collection(HID_Logical),&lt;BR /&gt; HID_Usage(0xA0002),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(1),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0xA0003),&lt;BR /&gt; HID_Usage(0xA0004),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xF &lt;BR /&gt; HID_LogicalMaxS(0xF),&lt;BR /&gt; HID_ReportSize(4), &lt;BR /&gt; HID_ReportCount(2),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0xA0005),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(1),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0xA0006),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(61),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_EndCollection, //end of feature&lt;BR /&gt; //testing another feature report with ID 4 format is the same&lt;BR /&gt; HID_Usage(0x30), //name of the usage for the entire feature report&lt;BR /&gt; HID_ReportID(0x04),&lt;BR /&gt; HID_Collection(HID_Logical),&lt;BR /&gt; HID_Usage(0x32),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(1),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0x33),&lt;BR /&gt; HID_Usage(0x34),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xF &lt;BR /&gt; HID_LogicalMaxS(0xF),&lt;BR /&gt; HID_ReportSize(4), &lt;BR /&gt; HID_ReportCount(2),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0x35),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(1),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_Usage(0x36),&lt;BR /&gt; HID_LogicalMin(0), // value range: 0 - 0xFF &lt;BR /&gt; HID_LogicalMaxS(0xFF),&lt;BR /&gt; HID_ReportSize(8), &lt;BR /&gt; HID_ReportCount(5),&lt;BR /&gt; HID_Feature(HID_Variable| HID_Volatile), //device might change &lt;BR /&gt; HID_EndCollection, //end of feature&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; HID_EndCollection,&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;The initialization routine&lt;BR /&gt;/* HID init routine */&lt;BR /&gt;ErrorCode_t usb_hid_init(USBD_HANDLE_T hUsb,&lt;BR /&gt; USB_INTERFACE_DESCRIPTOR *pIntfDesc,&lt;BR /&gt; uint32_t *mem_base,&lt;BR /&gt; uint32_t *mem_size)&lt;BR /&gt;{&lt;BR /&gt; USBD_HID_INIT_PARAM_T hid_param;&lt;BR /&gt; USB_HID_REPORT_T reports_data[1];&lt;BR /&gt; ErrorCode_t ret = LPC_OK;&lt;BR /&gt; uint16_t count = 0;&lt;/P&gt;&lt;P&gt;memset((void *) &amp;amp;hid_param, 0, sizeof(USBD_HID_INIT_PARAM_T));&lt;BR /&gt; /* HID paramas */&lt;BR /&gt; hid_param.max_reports = 1;&lt;BR /&gt; /* Init reports_data */&lt;BR /&gt; reports_data[0].len = HID_ReportDescSize;&lt;BR /&gt; reports_data[0].idle_time = 0;&lt;BR /&gt; reports_data[0].desc = (uint8_t *) &amp;amp;HID_ReportDescriptor[0];&lt;/P&gt;&lt;P&gt;if ((pIntfDesc == 0) || (pIntfDesc-&amp;gt;bInterfaceClass != USB_DEVICE_CLASS_HUMAN_INTERFACE)) {&lt;BR /&gt; return ERR_FAILED;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;hid_param.mem_base = *mem_base;&lt;BR /&gt; hid_param.mem_size = *mem_size;&lt;BR /&gt; hid_param.intf_desc = (uint8_t *) pIntfDesc;&lt;BR /&gt; /* user defined functions */&lt;BR /&gt; hid_param.HID_GetReport = HID_GetReport;&lt;BR /&gt; hid_param.HID_SetReport = HID_SetReport;&lt;BR /&gt; hid_param.HID_EpIn_Hdlr = HID_Ep_Hdlr;&lt;BR /&gt; hid_param.HID_EpOut_Hdlr = HID_Ep_Hdlr;&lt;BR /&gt; hid_param.report_data = reports_data;&lt;/P&gt;&lt;P&gt;ret = USBD_API-&amp;gt;hid-&amp;gt;init(hUsb, &amp;amp;hid_param);&lt;BR /&gt; /* allocate USB accessable memory space for report data */&lt;BR /&gt; //loopback_report = (uint8_t *) hid_param.mem_base;&lt;BR /&gt; output_report = (uint8_t *) hid_param.mem_base;&lt;BR /&gt; //bns 3/8 - since we are using 64 bytes make it 64 - originally it was 4&lt;BR /&gt; hid_param.mem_base += 65;&lt;BR /&gt; hid_param.mem_size += 65;&lt;BR /&gt; //bns adding onout and out put&lt;BR /&gt; input_report = (uint8_t *) hid_param.mem_base;&lt;BR /&gt; memset((uint8_t*) input_report, 0, 65);&lt;BR /&gt; //bns 3/8 - since we are using 64 bytes make it 64 - originally it was 4&lt;BR /&gt; hid_param.mem_base += 65;&lt;BR /&gt; hid_param.mem_size += 65;&lt;BR /&gt; &lt;BR /&gt; //bns adding feature &lt;BR /&gt; feature_report = (uint8_t *) hid_param.mem_base;&lt;BR /&gt; memset((uint8_t*) feature_report, 0, 65);&lt;BR /&gt; //bns 3/8 - since we are using 64 bytes make it 64 - &lt;BR /&gt; hid_param.mem_base += 65;&lt;BR /&gt; hid_param.mem_size += 65;&lt;BR /&gt; /* update memory variables */&lt;BR /&gt; /* update memory variables */&lt;BR /&gt; &lt;BR /&gt; *mem_base = hid_param.mem_base;&lt;BR /&gt; *mem_size = hid_param.mem_size;&lt;BR /&gt; //bns 3/8 initlaize bit of inout so that we know what we are sending for test&lt;BR /&gt; for (int i = 0;i&amp;lt;10;i++)&lt;BR /&gt; input_report[i] =i+20;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; //bns 3/14 initialize bit of feature so that we know what we are sending for test&lt;BR /&gt; for (int i = 0;i&amp;lt;10;i++)&lt;BR /&gt; feature_report[i] =i+10;&lt;BR /&gt; &lt;BR /&gt; return LPC_OK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And now the get report code&lt;BR /&gt;static ErrorCode_t HID_GetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET *pSetup, uint8_t * *pBuffer, uint16_t *plength)&lt;BR /&gt;{&lt;BR /&gt; uint8_t ReportID = pSetup-&amp;gt;wValue.WB.L; &lt;BR /&gt; switch (pSetup-&amp;gt;wValue.WB.H) {&lt;BR /&gt; case HID_REPORT_INPUT:&lt;BR /&gt; //now think if different report ID&lt;BR /&gt; switch (ReportID)&lt;BR /&gt; {&lt;BR /&gt; case 0: //when we don't define&lt;BR /&gt; //Can't assign explicitly 0 as report ID, but it is assigned default , in that case&lt;BR /&gt; // USB stack adds report ID as the first byte so not required to assign explicitly&lt;BR /&gt; //In general, we are using first byte as the report ID in the input buffer and second byte onwards data&lt;BR /&gt; //and due to what we mentioned earlier, just give data that is input_report second byte onwards&lt;BR /&gt; *pBuffer = input_report+1;&lt;BR /&gt; *plength = 8;&lt;BR /&gt; break;&lt;BR /&gt; case 1: //when we defined report ID as 1&lt;BR /&gt; //as we are testing different report ID etc add report ID here, much easier and no confusion&lt;BR /&gt; //after concluding about report ID can initialize as part of initialization routine&lt;BR /&gt; input_report[0] = 1;&lt;BR /&gt; input_report[1] = 11;&lt;BR /&gt; *pBuffer = input_report;&lt;BR /&gt; *plength = 8;&lt;BR /&gt; break;&lt;BR /&gt; case 4: //when we defined report ID as 1&lt;BR /&gt; //as we are testing different report ID etc add report ID here, much easier and no confusion&lt;BR /&gt; //after concluding about report ID can initialize as part of initialization routine&lt;BR /&gt; input_report[0] = 4;&lt;BR /&gt; //change data to test &lt;BR /&gt; input_report[1] = 44;&lt;BR /&gt; *pBuffer = input_report;&lt;BR /&gt; *plength = 8;&lt;BR /&gt; break; &lt;BR /&gt; }&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HID_REPORT_OUTPUT:&lt;BR /&gt; //bns 3/19 shoudl never be here ! &lt;BR /&gt; return ERR_USBD_STALL; // Not Supported &lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;case HID_REPORT_FEATURE:&lt;BR /&gt; switch (ReportID)&lt;BR /&gt; {&lt;BR /&gt; case 0: //when we don't define&lt;BR /&gt; //add report ID here no confusion&lt;BR /&gt; // feature_report[0] = 0; &lt;BR /&gt; *pBuffer = feature_report+1;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; break;&lt;BR /&gt; case 1:&lt;BR /&gt; //as we are testing different report ID etc add report ID here, much easier and no confusion&lt;BR /&gt; //after concluding about report ID can initialize as part of initialization routine&lt;BR /&gt; feature_report[0] = 1; &lt;BR /&gt; *pBuffer = feature_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; break;&lt;BR /&gt; case 3: // when we define report ID as 3&lt;BR /&gt; //as we are testing different report ID etc add report ID here, much easier and no confusion&lt;BR /&gt; //after concluding about report ID can initialize as part of initialization routine&lt;BR /&gt; &lt;BR /&gt; feature_report[0] = 3; &lt;BR /&gt; //just to test different data&lt;BR /&gt; feature_report[1]=33;&lt;BR /&gt; *pBuffer = feature_report;&lt;BR /&gt; *plength = 64;&lt;BR /&gt; break;&lt;BR /&gt; case 4: // when we define report ID as 3&lt;BR /&gt; //as we are testing different report ID etc add report ID here, much easier and no confusion&lt;BR /&gt; //after concluding about report ID can initialize as part of initialization routine&lt;BR /&gt; feature_report[0] = 4; &lt;BR /&gt; //just to test different data&lt;BR /&gt; feature_report[1]=44;&lt;BR /&gt; &lt;BR /&gt; *pBuffer = feature_report;&lt;BR /&gt; *plength = 8;&lt;BR /&gt; break;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; return LPC_OK;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 16:48:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871621#M34754</guid>
      <dc:creator>ssudhir</dc:creator>
      <dc:date>2019-03-27T16:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting HID Feature report for different Report IDs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871622#M34755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp; S S,&lt;/P&gt;&lt;P&gt;To my understanding, we need&amp;nbsp; refer to&amp;nbsp; the&amp;nbsp; "HID_ReportSize(x),&amp;nbsp; HID_ReportCount(x), " under each report ID, to define suitable "*plength" under GetReport() function also define the size of g_mouse.report[].&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; case HID_REPORT_INPUT:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Mouse_UpdateReport();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*pBuffer = &amp;amp;g_mouse.report[0];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*plength = 64;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And If you just want to change Report length, you can change the data of "*plength = ".&lt;/P&gt;&lt;P&gt;I haven't REPORT_FEATURE demo , also haven't a&amp;nbsp; good host tool like yours, so I just using&lt;/P&gt;&lt;P&gt;Bus Hound to test the report input，config *plength to 4 and 64, below is the result.&lt;/P&gt;&lt;P&gt;The Bus Hound sometimes doesn't show all the data, I think in your python code, you can see all the&lt;/P&gt;&lt;P&gt;64 bytes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_518.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/68534i89742D397287E55B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_518.png" alt="pastedImage_518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_519.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/68612i55FD216B1A0615B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_519.png" alt="pastedImage_519.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2019 09:11:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Getting-HID-Feature-report-for-different-Report-IDs/m-p/871622#M34755</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-04-01T09:11:43Z</dc:date>
    </item>
  </channel>
</rss>

