USB: Set actual_length value for Get HID descriptor

This commit is contained in:
Florin9doi 2024-08-11 12:12:42 +03:00 committed by Ty
parent 6bedcd768f
commit 07fd035aa2
4 changed files with 7 additions and 5 deletions

View File

@ -133,7 +133,8 @@ namespace usb_pad
{
case USB_DT_REPORT:
ret = sizeof(hid_report_descriptor);
memcpy(data, hid_report_descriptor, ret);
std::memcpy(data, hid_report_descriptor, ret);
p->actual_length = ret;
break;
}
break;

View File

@ -166,7 +166,8 @@ namespace usb_pad
{
case USB_DT_REPORT:
ret = sizeof(hid_report_descriptor);
memcpy(data, hid_report_descriptor, ret);
std::memcpy(data, hid_report_descriptor, ret);
p->actual_length = ret;
break;
}
break;

View File

@ -216,7 +216,8 @@ namespace usb_pad
{
case USB_DT_REPORT:
ret = sizeof(hid_report_descriptor);
memcpy(data, hid_report_descriptor, ret);
std::memcpy(data, hid_report_descriptor, ret);
p->actual_length = ret;
break;
}
break;

View File

@ -296,7 +296,7 @@ namespace usb_pad
{
case USB_DT_REPORT:
ret = sizeof(hid_report_descriptor);
memcpy(data, hid_report_descriptor, ret);
std::memcpy(data, hid_report_descriptor, ret);
p->actual_length = ret;
break;
default:
@ -308,7 +308,6 @@ namespace usb_pad
if (length > 0)
{
p->actual_length = 0;
//p->status = USB_RET_SUCCESS;
}
break;
case SET_IDLE: