Namespaces

Enumerations

enum ReportType
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 CollectionType
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
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
Name Value
kData 1 << 0
kConstant 1 << 1
kArray 1 << 2
kScalar 1 << 3
kAbsolute 1 << 4
kRelative 1 << 5
kNoWrap 1 << 6
kWrap 1 << 7
kLinear 1 << 8
kNonLinear 1 << 9
kPreferredState 1 << 10
kNoPreferred 1 << 11
kNoNullPosition 1 << 12
kNullState 1 << 13
kNonVolatile 1 << 14
kVolatile 1 << 15
kBitField 1 << 16
kBufferedBytes 1 << 17

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

enum ParseResult
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