fix hid get report len
This commit is contained in:
@@ -17,8 +17,7 @@ static int hid_class_interface_request_handler(struct usb_setup_packet *setup, u
|
|||||||
switch (setup->bRequest) {
|
switch (setup->bRequest) {
|
||||||
case HID_REQUEST_GET_REPORT:
|
case HID_REQUEST_GET_REPORT:
|
||||||
/* report id ,report type */
|
/* report id ,report type */
|
||||||
(*data)[0] = usbh_hid_get_report(intf_num, LO_BYTE(setup->wValue), HI_BYTE(setup->wValue));
|
usbh_hid_get_report(intf_num, LO_BYTE(setup->wValue), HI_BYTE(setup->wValue), data, len);
|
||||||
*len = 1;
|
|
||||||
break;
|
break;
|
||||||
case HID_REQUEST_GET_IDLE:
|
case HID_REQUEST_GET_IDLE:
|
||||||
(*data)[0] = usbh_hid_get_idle(intf_num, LO_BYTE(setup->wValue));
|
(*data)[0] = usbh_hid_get_idle(intf_num, LO_BYTE(setup->wValue));
|
||||||
@@ -61,9 +60,10 @@ struct usbd_interface *usbd_hid_init_intf(struct usbd_interface *intf, const uin
|
|||||||
return intf;
|
return intf;
|
||||||
}
|
}
|
||||||
|
|
||||||
__WEAK uint8_t usbh_hid_get_report(uint8_t intf, uint8_t report_id, uint8_t report_type)
|
__WEAK void usbh_hid_get_report(uint8_t intf, uint8_t report_id, uint8_t report_type, uint8_t **data, uint32_t *len)
|
||||||
{
|
{
|
||||||
return 0;
|
(*data[0]) = 0;
|
||||||
|
*len = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
__WEAK uint8_t usbh_hid_get_idle(uint8_t intf, uint8_t report_id)
|
__WEAK uint8_t usbh_hid_get_idle(uint8_t intf, uint8_t report_id)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ void usbd_hid_descriptor_register(uint8_t intf_num, const uint8_t *desc);
|
|||||||
void usbd_hid_report_descriptor_register(uint8_t intf_num, const uint8_t *desc, uint32_t desc_len);
|
void usbd_hid_report_descriptor_register(uint8_t intf_num, const uint8_t *desc, uint32_t desc_len);
|
||||||
|
|
||||||
/* Setup request command callback api */
|
/* Setup request command callback api */
|
||||||
uint8_t usbh_hid_get_report(uint8_t intf, uint8_t report_id, uint8_t report_type);
|
void usbh_hid_get_report(uint8_t intf, uint8_t report_id, uint8_t report_type, uint8_t **data, uint32_t *len);
|
||||||
uint8_t usbh_hid_get_idle(uint8_t intf, uint8_t report_id);
|
uint8_t usbh_hid_get_idle(uint8_t intf, uint8_t report_id);
|
||||||
uint8_t usbh_hid_get_protocol(uint8_t intf);
|
uint8_t usbh_hid_get_protocol(uint8_t intf);
|
||||||
void usbh_hid_set_report(uint8_t intf, uint8_t report_id, uint8_t report_type, uint8_t *report, uint8_t report_len);
|
void usbh_hid_set_report(uint8_t intf, uint8_t report_id, uint8_t report_type, uint8_t *report, uint8_t report_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user