collections

package
v0.0.0-...-f2919f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HidUnitSystem_None = iota
	HidUnitSystem_SiLinear
	HidUnitSystem_SiRotation
	HidUnitSystem_EnglishLinear
	HidUnitSystem_EnglishRotation
	HidUnitSystem_VendorDefined
	HidUnitSystem_Reserved
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HIDCollectionInfo

type HIDCollectionInfo struct {
	UsagePage      uint16
	Usage          uint16
	Type           HidType
	Children       []*HIDCollectionInfo
	InputReports   []*HIDReportInfo
	OutputReports  []*HIDReportInfo
	FeatureReports []*HIDReportInfo
}

HIDCollectionInfo provides details about reports in this device by mimicking WebHID collection info object

func Get

func Get(dev *hid.Device) (collection *HIDCollectionInfo, err error)

Get returns the top level collection of the device. This collection and its link collections describe the functionality and available reports exposed by the device.

func (*HIDCollectionInfo) HasUsage

func (c *HIDCollectionInfo) HasUsage(usagePage, usage uint16) bool

func (*HIDCollectionInfo) String

func (c *HIDCollectionInfo) String() string

type HIDReportInfo

type HIDReportInfo struct {
	ReportId byte
	Items    []*HIDReportItem // fields of this report
	// contains filtered or unexported fields
}

func (*HIDReportInfo) String

func (r *HIDReportInfo) String() string

type HIDReportItem

type HIDReportItem struct {
	IsAbsolute bool // Indicates whether the data is absolute (based on a fixed origin) or relative (indicating the change in value from the last report)
	// Indicates whether the item creates variable or array data fields in reports
	//   Variable: For example, a bank of eight on/off switches could be reported in 1 byte declared by a variable Input item where each bit represents one switch, on (1) or off (0) (Report Size = 1, Report Count = 8).
	//   Array: A keyboard could report up to three simultaneous keys using an array with three 8-bit fields (Report Size = 8, Report Count = 3).Logical Minimum specifies the lowest index value returned by the array and Logical Maximum specifies the largest. The number of elements in the array can be deduced by examining the difference between Logical Minimum and Logical Maximum (number of elements = Logical Maximum - Logical Minimum + 1)
	IsArray                       bool
	IsBufferedBytes               bool // Indicates that the control emits a fixed-sizestream of bytes
	IsConstant                    bool // Constant indicates the item is a static read-only field in a report and cannot be modified
	IsLinear                      bool // Nonlinear indicates whether the raw data from the device has been processed in some way, and no longer represents a linear relationship between what is measured and the data that is reported
	IsRange                       bool // Specifies, if TRUE, that the structure describes a usage range. Otherwise, if IsRange is FALSE, the structure describes a single usage
	IsVolatile                    bool // Indicates whether the Feature or Output control's value should be changed by the host or not. Volatile output can change with or without host interaction
	HasNull                       bool // Indicates whether the control has a state in which it is not sending meaningful data
	HasPreferredState             bool // Indicates whether the control has a preferred state to which it will return when the user is not physically interacting with the control
	Wrap                          bool // Indicates whether the data “rolls over” when reaching either the extreme high or low value
	Usages                        []UsagePage
	UsageMinimum                  UsagePage
	UsageMaximum                  UsagePage
	ReportSize                    uint16
	ReportCount                   uint16
	UnitExponent                  int8
	UnitSystem                    int8 // NOTE: enum
	UnitFactorLengthExponent      int8
	UnitFactorMassExponent        int8
	UnitFactorTimeExponent        int8
	UnitFactorTemperatureExponent int8
	UnitFactorCurrentExponent     int8
	UnitFactorLuminousExponent    int8
	LogicalMinimum                int32
	LogicalMaximum                int32
	PhysicalMinimum               int32
	PhysicalMaximum               int32
	Strings                       []string
	// contains filtered or unexported fields
}

https://docs.microsoft.com/en-us/uwp/api/windows.devices.humaninterfacedevice.hidnumericcontroldescription?view=winrt-22621 https://github.com/microsoft/hidtools HidFeatureReport -> HidNumericControl GetNumericControl(ushort usagePage, ushort usageId);

HidNumericControl.ControlDescription.HidNumericControlDescription
	https://docs.microsoft.com/en-us/uwp/api/windows.devices.humaninterfacedevice.hidnumericcontroldescription?view=winrt-22621

func (*HIDReportItem) String

func (r *HIDReportItem) String() string

type HidType

type HidType uint8
const (
	HidTypePhysical HidType = iota
	HidTypeApplication
	HidTypeLogical
	HidTypeReport
	HidTypeNamedArray
	HidTypeUsageSwitch
	HidTypeUsageModified
)

func (HidType) String

func (t HidType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL