In this thread it is mentioned that GetReport and SetReport are coded just
for single byte.. It is also mentioned that we need to change but doesn't
specify what needs to be changed. Any idea what needs to be done?
https://community.nxp.com/thread/425616
Here is our SetReport we took from the sample code
static ErrorCode_t HID_SetReport(USBD_HANDLE_T hHid, USB_SETUP_PACKET
*pSetup, uint8_t * *pBuffer, uint16_t length)
{
//bns testing buffer
uint8_t j =0;
uint16_t i = 0;
uint8_t buf[10];
/* we will reuse standard EP0Buf */
if (length == 0) {
return LPC_OK;
}
uint8_t ReportID = pSetup->wValue.WB.L;
/* ReportID = SetupPacket.wValue.WB.L; */
switch (pSetup->wValue.WB.H) {
case HID_REPORT_INPUT:
return ERR_USBD_STALL; /* Not Supported */
case HID_REPORT_OUTPUT:
//bns 3/8/2018 commenting the below line because using
separate buffer for input, output and feature reports
//*loopback_report = **pBuffer;
//bns 3/82018 - save the set report buffer for time being
and think of how to set this report , however this works for one bytes
//if our report is more than one byte need to copy this
*output_report = **pBuffer;
//need the length too
out_feature_length = length;
break;
case HID_REPORT_FEATURE:
switch (ReportID)
{
case 0:
//bns just fo testing so wrapping the copy
for (i = 0; i< length; i++)
{
buf[j++] = *pBuffer[i];
if (j%10 == 0)
j =0;
}
break;
case 3:
//bns just fo testing so wrapping the copy
for (i = 0; i< length; i++)
{
buf[j++] = *pBuffer[i];
if (j%10 == 0)
j =0;
}
break;
case 4:
//bns just fo testogn so wrapping the copy
for (i = 0; i< length; i++)
{
buf[j++] = *pBuffer[i];
if (j%10 == 0)
j =0;
}
break;
}
//return ERR_USBD_STALL;
break;
}
return LPC_OK;
}
Thanks
Shobha