From 849b9535e7f4ca84aa909cfb9e985ae29f14be72 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 22 Sep 2009 08:07:48 +0000 Subject: Add new error condition to the HID Report Parser for when a report is parsed but no unfiltered items are encountered (i.e. nothing of interest in the device report). Make all host HID "WithParser" demos print the new error condition. --- LUFA/Drivers/USB/Class/Host/HIDParser.c | 3 +++ LUFA/Drivers/USB/Class/Host/HIDParser.h | 1 + 2 files changed, 4 insertions(+) (limited to 'LUFA/Drivers') diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.c b/LUFA/Drivers/USB/Class/Host/HIDParser.c index 450f6afb0..4d433e56e 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.c @@ -296,6 +296,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID } } + if (!(ParserData->TotalReportItems)) + return HID_PARSE_NoUnfilteredReportItems; + return HID_PARSE_Successful; } diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h index 2ee3f7032..4322c5106 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h @@ -144,6 +144,7 @@ HID_PARSE_InsufficientCollectionPaths = 5, /**< More than \ref HID_MAX_COLLECTIONS collections in the report. */ HID_PARSE_UsageStackOverflow = 6, /**< More than \ref HID_USAGE_STACK_DEPTH usages listed in a row. */ HID_PARSE_InsufficientReportIDItems = 7, /**< More than \ref HID_MAX_REPORT_IDS report IDs in the device. */ + HID_PARSE_NoUnfilteredReportItems = 8, /**< All report items from the device were filtered by the filtering callback routine. */ }; /* Type Defines: */ -- cgit v1.2.3