Class HIDParser
Turns binary HID descriptors into HID.HIDDeviceDescriptor instances.
Inheritance
System.Object
HIDParser
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: UnityEngine.Experimental.Input.Plugins.HID
Syntax
public static class HIDParser
Remarks
For information about the format, see the Device Class Definition for Human Interface Devices section 6.2.2.
Methods
ParseReportDescriptor(Byte*, Int32, ref HID.HIDDeviceDescriptor)
Declaration
public static bool ParseReportDescriptor(byte *bufferPtr, int bufferLength, ref HID.HIDDeviceDescriptor deviceDescriptor)
Parameters
Type | Name | Description |
---|---|---|
System.Byte* | bufferPtr | |
System.Int32 | bufferLength | |
HID.HIDDeviceDescriptor | deviceDescriptor |
Returns
Type | Description |
---|---|
System.Boolean |
ParseReportDescriptor(Byte[], ref HID.HIDDeviceDescriptor)
Parse a HID report descriptor as defined by section 6.2.2 of the HID specification and add the elements and collections from the descriptor to the given deviceDescriptor.
Declaration
public static bool ParseReportDescriptor(byte[] buffer, ref HID.HIDDeviceDescriptor deviceDescriptor)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | Buffer containing raw HID report descriptor. |
HID.HIDDeviceDescriptor | deviceDescriptor | HID device descriptor to complete with the information from the report descriptor. Elements and collections will get added to this descriptor. |
Returns
Type | Description |
---|---|
System.Boolean | True if the report descriptor was successfully parsed. |
Remarks
Will also set inputReportSize, outputReportSize, and featureReportSize.