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 class Type : uint8_t
Name Value Comments
kMain 0 --
kGlobal 1 --
kLocal 2 --
kReserved 3 --
kLongItem 4

Note: long items are not fully parsed.

Defined at line 19 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h

enum class Tag : uint8_t
Name Value Comments
kInput 0

Main tags.

kOutput 1

Main tags.

kFeature 2

Main tags.

kCollection 3

Main tags.

kEndCollection 4

Main tags.

kUsagePage 5

Global tags.

kLogicalMinimum 6

Global tags.

kLogicalMaximum 7

Global tags.

kPhysicalMinimum 8

Global tags.

kPhysicalMaximum 9

Global tags.

kUnitExponent 10

Global tags.

kUnit 11

Global tags.

kReportSize 12

Global tags.

kReportId 13

Global tags.

kReportCount 14

Global tags.

kPush 15

Global tags.

kPop 16

Global tags.

kUsage 17

Local tags.

kUsageMinimum 18

Local tags.

kUsageMaximum 19

Local tags.

kDesignatorIndex 20

Local tags.

kDesignatorMinimum 21

Local tags.

kDesignatorMaximum 22

Local tags.

kStringIndex 23

Local tags.

kStringMinimum 24

Local tags.

kStringMaximum 25

Local tags.

kDelimiter 26

Local tags.

kReserved 27

Reserved tag (for any type).

Defined at line 28 of file ../../src/ui/input/lib/hid-parser/include/lib/hid-parser/item.h