This interface is implemented by HID Session object and allows you to parse the HID report received from the device.
interface IHIDParser {
// Methods
${getData}(reportType: ${HID.ReportType}, reportData: Uint8Array): ${IHIDData}[];
${getUsages}(reportType: ${HID.ReportType},
usagePage: number,
linkCollection: number,
reportData: Uint8Array): number[];
${getUsagesEx}(reportType: ${HID.ReportType}, linkCollection: number, reportData: Uint8Array): ${IHIDUsageAndPage}[];
${getButtons}(reportType: ${HID.ReportType}, usagePage: number, linkCollection: number, reportData: Uint8Array): number[];
${getButtonsEx}(reportType: ${HID.ReportType}, linkCollection: number, reportData: Uint8Array): ${IHIDUsageAndPage}[];
${getUsageValue}(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): number;
${getScaledUsageValue}(reportType: ${HID.ReportType},
usagePage: number,
usage: number,
linkCollection: number,
reportData: Uint8Array): number;
${getUsageValueArray}(reportType: ${HID.ReportType},
usagePage: number,
usage: number,
linkCollection: number,
reportData: Uint8Array): Uint8Array;
}
// This interface is not available in managed environment
// This interface is not available in native environment
getData(reportType: ${HID.ReportType}, reportData: Uint8Array): ${IHIDData}[];
// This method is not available in managed environment
// This method is not available in native environment
reportType
reportData
Returns, for a specified report, an array of data objects that identify the data indices of all HID control buttons that are currently set to ON (1), and the data indices and data associated with all HID control values.
getUsages(reportType: ${HID.ReportType},
usagePage: number,
linkCollection: number,
reportData: Uint8Array): number[];
// This method is not available in managed environment
// This method is not available in native environment
reportType
usagePage
linkCollection
linkCollection
is nonzero, the routine only returns information about the buttons that this link collection contains; otherwise, if linkCollection
is zero, the routine returns information about all the buttons in the top-level collection.reportData
Returns a value capability array that describes all HID control values that meet a specified selection criteria.
getUsagesEx(reportType: ${HID.ReportType}, linkCollection: number, reportData: Uint8Array): ${IHIDUsageAndPage}[];
// This method is not available in managed environment
// This method is not available in native environment
reportType
linkCollection
linkCollection
is nonzero, the routine only returns information about the buttons that this link collection contains; otherwise, if linkCollection
is zero, the routine returns information about all the buttons in the top-level collection.reportData
Returns a list of the all the HID control button usages that are set to ON in a HID report.
getButtons(reportType: ${HID.ReportType}, usagePage: number, linkCollection: number, reportData: Uint8Array): number[];
// This method is not available in managed environment
// This method is not available in native environment
reportType
usagePage
linkCollection
linkCollection
is nonzero, the routine only returns information about the buttons that this link collection contains; otherwise, if linkCollection
is zero, the routine returns information about all the buttons in the top-level collection.reportData
Returns a value capability array that describes all HID control values that meet a specified selection criteria.
getButtonsEx(reportType: ${HID.ReportType}, linkCollection: number, reportData: Uint8Array): ${IHIDUsageAndPage}[];
// This method is not available in managed environment
// This method is not available in native environment
reportType
linkCollection
linkCollection
is nonzero, the routine only returns information about the buttons that this link collection contains; otherwise, if linkCollection
is zero, the routine returns information about all the buttons in the top-level collection.reportData
Returns a list of the all the HID control button usages that are set to ON in a HID report.
getUsageValue(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): number;
// This method is not available in managed environment
// This method is not available in native environment
reportType
usagePage
usage
linkCollection
linkCollection
is nonzero, the routine only searches for the usage in this link collection; otherwise, if linkCollection
is zero, the routine searches for the usage in the top-level collection. reportData: Uint8ArrayRaw HID report bytes.Extracts the data associated with a HID control value that matches the selection criteria in a HID report.
getScaledUsageValue(reportType: ${HID.ReportType},
usagePage: number,
usage: number,
linkCollection: number,
reportData: Uint8Array): number;
// This method is not available in managed environment
// This method is not available in native environment
reportType
usagePage
usage
linkCollection
linkCollection
value of zero identifies the top-level collection.reportData
Returns the signed and scaled result of a HID control value extracted from a HID report.
getUsageValueArray(reportType: ${HID.ReportType},
usagePage: number,
usage: number,
linkCollection: number,
reportData: Uint8Array): Uint8Array;
// This method is not available in managed environment
// This method is not available in native environment
reportType
usagePage
usage
linkCollection
linkCollection
is nonzero, the routine only searches for a usage value array in this link collection; otherwise, if linkCollection
is zero, the routine searches for a usage value array in the top-level collection.reportData
Extracts the data associated with a HID control usage value array from a HID report.