From ee6c22bd376e10506d92b61b5f5c42f51536c5a3 Mon Sep 17 00:00:00 2001 From: Ciaran Woodward Date: Tue, 21 Dec 2021 12:43:34 +0000 Subject: [PATCH] Loosen up usage page check in validate While the implementation can only support one usage per report id, the report collections themselves have usages, which are acceptable. This change allows these usages to pass the validate check. --- lib_xua/src/hid/hid_report.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib_xua/src/hid/hid_report.c b/lib_xua/src/hid/hid_report.c index a514ff08..97d7f014 100644 --- a/lib_xua/src/hid/hid_report.c +++ b/lib_xua/src/hid/hid_report.c @@ -678,6 +678,10 @@ static unsigned hidReportValidateAddReportId( struct HID_validation_info *info, * @return unsigned HID_STATUS value */ static unsigned hidReportValidateAddUsagePageItem( struct HID_validation_info *info, const USB_HID_Short_Item_t *item ) { + + if ( info->collectionOpenedCount == 0 ) { + return HID_STATUS_GOOD; + } if ( info->reportUsagePage[info->currentReportIdx] ) { printf("Error: Multiple usage pages per report ID not supported by this implementation.\n"); return HID_STATUS_BAD_REPORT_DESCRIPTOR;