Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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;
}