HIDReport * HIDParser::ReportAt(uint8 type, uint8 index) { for (uint8 i = 0; i < fReportCount; i++) { HIDReport *report = fReports[i]; if (report == NULL || (report->Type() & type) == 0) continue; if (index-- == 0) return report; } return NULL; }
HIDReport * HIDParser::FindReport(uint8 type, uint8 id) { for (uint8 i = 0; i < fReportCount; i++) { HIDReport *report = fReports[i]; if (report == NULL) continue; if ((report->Type() & type) != 0 && report->ID() == id) return report; } return NULL; }
uint8 HIDParser::CountReports(uint8 type) { uint8 count = 0; for (uint8 i = 0; i < fReportCount; i++) { HIDReport *report = fReports[i]; if (report == NULL) continue; if (report->Type() & type) count++; } return count; }