Namespaces

Enumerations

enum ReportType : uint32_t
Name Value
kReportInput 1
kReportOutput 2
kReportFeature 3

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

enum class CollectionType : uint32_t
Name Value
kPhysical 0
kApplication 1
kLogical 2
kReport 3
kNamedArray 4
kUsageSwitch 5
kUsageModifier 6
kReserved 7
kVendor 8

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

enum NodeType : uint32_t
Name Value
kInput 0
kOutput 1
kFeature 2

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

enum FieldTypeFlags : uint32_t
Name Value Comments
kData 1 << 0

Indicates if field can be modified. Constant often means is padding.

kConstant 1 << 1

Indicates if field can be modified. Constant often means is padding.

kArray 1 << 2

The field is either an array or scalar. If it is an array only
the kData|kConstant and kAbsolute|kRelative flags are valid.

kScalar 1 << 3

The field is either an array or scalar. If it is an array only
the kData|kConstant and kAbsolute|kRelative flags are valid.

kAbsolute 1 << 4

Value is absolute wrt to a fixed origin or not.

kRelative 1 << 5

Value is absolute wrt to a fixed origin or not.

kNoWrap 1 << 6

Whether the data rolls over wrt to the logical min/max.

kWrap 1 << 7

Whether the data rolls over wrt to the logical min/max.

kLinear 1 << 8

Data has been pre-processed, for example dead-zone.

kNonLinear 1 << 9

Data has been pre-processed, for example dead-zone.

kPreferredState 1 << 10

Value returns to a preset value when the user is not interacting with control.

kNoPreferred 1 << 11

Value returns to a preset value when the user is not interacting with control.

kNoNullPosition 1 << 12

If the control can enter a state when it does not report data.

kNullState 1 << 13

If the control can enter a state when it does not report data.

kNonVolatile 1 << 14

Output-only: can the value be modified without host interaction.

kVolatile 1 << 15

Output-only: can the value be modified without host interaction.

kBitField 1 << 16

Data is a fixed size stream.

kBufferedBytes 1 << 17

Data is a fixed size stream.

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

enum ParseResult : uint32_t
Name Value
kParseOk 0
kParseNoMemory 1
kParseMoreNeeded 2
kParseUnsuported 3
kParseInvalidTag 4
kParseInvalidItemType 5
kParseInvalidItemValue 6
kParseUsageLimit 7
kParseInvalidRange 8
kParseOverflow 9
kParseLeftovers 10
kParseUnexpectedCol 11
kParseUnexpectedItem 12
kParseInvalidUsage 13
kParseMissingUsage 14
kParserMissingPage 15
kParserUnexpectedPop 16
kParserInvalidID 17
kParserMissingID 18

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

Records

Functions

  • template <typename T>
    bool ExtractUint (const uint8_t * report, size_t report_len, const hid::Attributes & attr, T * value_out)

    Defined at line 53 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractAsUnitType (const uint8_t * report, size_t report_len, const hid::Attributes & attr, double * value_out)

    Extracts |value_out| from |report| as the closest unit type to |attr.unit|. The unit type

    can be gotten from the |GetUnitTypeFromUnit| function. This is the recommended

    extraction function for the users of this library.

    Defined at line 238 of file ../../src/ui/input/lib/hid-parser/report.cc

  • size_t GetReportSizeFromFirstByte (const DeviceDescriptor & desc, ReportType type, uint8_t byte)

    Gets the size of the report from the first byte of the report.

    Defined at line 10 of file ../../src/ui/input/lib/hid-parser/descriptor.cc

  • bool InsertAsUnitType (uint8_t * report, size_t report_len, const hid::Attributes & attr, double value_in)

    Inserts |value_in| into |report|. This function assumes that |value_in| is in the

    unit type closest to |attr.unit|.

    Defined at line 227 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractAsUnit (const uint8_t * report, size_t report_len, const hid::Attributes & attr, double * value_out)

    Extracts |value_out| from |report| and ensures that is in the units

    specified by |attr|.

    Defined at line 97 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool InsertAsUnit (uint8_t * report, size_t report_len, const hid::Attributes & attr, double value_in)

    Inserts |value_in| into |report| after it has been translated into

    the logical units described by |attr|.

    Defined at line 185 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractWithUnit (const uint8_t * report, size_t report_len, const hid::Attributes & attr, const Unit & unit_out, double * value_out)

    Extracts |value_out| from |report| and converts it into the units

    specified by |unit_out|.

    Defined at line 137 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool InsertWithUnit (uint8_t * report, size_t report_len, const hid::Attributes & attr, const Unit & unit_in, double value_in)

    Given |value_in| with units |unit_in|, it converts it to |attr.unit| and

    then inserts it into |report|.

    Defined at line 217 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractUint (const uint8_t * report, size_t report_len, const hid::Attributes & attr, uint8_t * value_out)

    Helper functions that extracts the raw byte data from a report. This is only

    recommended for users that know what they are doing and are willing to

    use raw data or do their own conversion between logical and physical values.

    Defined at line 82 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractUint (const uint8_t * report, size_t report_len, const hid::Attributes & attr, uint16_t * value_out)

    Defined at line 87 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool ExtractUint (const uint8_t * report, size_t report_len, const hid::Attributes & attr, uint32_t * value_out)

    Defined at line 92 of file ../../src/ui/input/lib/hid-parser/report.cc

  • bool InsertUint (uint8_t * report, size_t report_len, const hid::Attributes & attr, uint32_t value_in)

    Defined at line 147 of file ../../src/ui/input/lib/hid-parser/report.cc

  • template <typename T>
    T bit_cast (const uint32_t * data)

    Type punning beyond the magic 'char' type is no longer tolerated

    for example the simpler "return *reinterpret_cast<T*>(data);"

    generates a warning even on gcc.

    Defined at line 155 of file ../../src/ui/input/lib/hid-parser/item.cc

  • template <typename P, typename U>
    Usage USAGE (P page, U usage)

    Helper for creating Usage constants.

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

  • ParseResult ParseReportDescriptor (const uint8_t * rpt_desc, size_t desc_len, DeviceDescriptor ** dev_desc)

    Defined at line 812 of file ../../src/ui/input/lib/hid-parser/parser.cc

  • void FreeDeviceDescriptor (DeviceDescriptor * dev_desc)

    Defined at line 843 of file ../../src/ui/input/lib/hid-parser/parser.cc

  • Collection * GetAppCollection (const ReportField * field)

    Defined at line 848 of file ../../src/ui/input/lib/hid-parser/parser.cc