class Item
Defined at line 17 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
Value class that represents a USB HID report descriptor "Item" as defined
by the Device Class Definition for Human Interface Devices Firmware
specification 1.11 for "short items" (see usb.org).
Public Methods
void Item (Type type, Tag tag, uint8_t size, uint32_t data)
Construct an Item from explicit values.
No validation is performed.
Defined at line 86 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
Type type ()
Defined at line 89 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
Tag tag ()
Defined at line 90 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
uint32_t data ()
Defined at line 91 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
Item ReadNext (const uint8_t * data, size_t len, size_t * actual)
Construct an Item from a HID report descriptor bytestream.
|data| should contain a hid report descriptor with |len| > 0
and the returned object is one parsed hid report item.
Upon return |*actual| contains how many bytes to advance to the
next Item. Caller must check that:
|*actual| is not zero
If so, parsing is not supported for this stream.
|*actual| is not greater than |len|.
If so, more data is needed and returned item's data()
is set to zero.
Most bit patterns are valid items so if garbage data is given
to this method a set of valid-looking items can be returned so
the next layer must validate that the sequence of items is
reasonable and structurally correct.
Defined at line 129 of file ../../src/ui/input/lib/hid-parser/item.cc
int32_t signed_data ()
Defined at line 161 of file ../../src/ui/input/lib/hid-parser/item.cc
Enumerations
enum Type
| Name | Value |
|---|---|
| kMain | 0 |
| kGlobal | 1 |
| kLocal | 2 |
| kReserved | 3 |
| kLongItem | 4 |
Defined at line 19 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h
enum Tag
| Name | Value |
|---|---|
| kInput | 0 |
| kOutput | 1 |
| kFeature | 2 |
| kCollection | 3 |
| kEndCollection | 4 |
| kUsagePage | 5 |
| kLogicalMinimum | 6 |
| kLogicalMaximum | 7 |
| kPhysicalMinimum | 8 |
| kPhysicalMaximum | 9 |
| kUnitExponent | 10 |
| kUnit | 11 |
| kReportSize | 12 |
| kReportId | 13 |
| kReportCount | 14 |
| kPush | 15 |
| kPop | 16 |
| kUsage | 17 |
| kUsageMinimum | 18 |
| kUsageMaximum | 19 |
| kDesignatorIndex | 20 |
| kDesignatorMinimum | 21 |
| kDesignatorMaximum | 22 |
| kStringIndex | 23 |
| kStringMinimum | 24 |
| kStringMaximum | 25 |
| kDelimiter | 26 |
| kReserved | 27 |
Defined at line 28 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h