This interface is implemented by HID Session Object.
interface IHIDSession {
// Properties
${vendorId}: number;
${productId}: number;
${device}: ${IHIDDevice};
${inputBuffersCount}: number;
// Methods
${start}(): void;
${stop}(): void;
${setFeature}(reportId: number, v: number[] | ArrayBuffer | DataView | Uint8Array): void;
${getFeature}(reportId: number): Uint8Array;
${send#send1}(byte: number): Promise<void>;
${send#send2}(bytes: number [] | Uint8Array | Uint16Array | Uint32Array | ArrayBuffer | DataView): Promise<void>;
${send#send2#send#send21}(text: string): Promise<void>;
${receive}(): Promise<Uint8Array>;
${getReport}(reportId: number): Uint8Array;
${setReport}(reportId: number, v: number[] | ArrayBuffer | DataView | Uint8Array): void;
${getLinkCollectionNodes}(): ${IHIDNode}[];
${getValueCaps}(reportType: ${HID.ReportType}): ${IHIDValueCaps}[];
${getSpecificValueCaps}(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): ${IHIDValueCaps}[];
${getButtonCaps}(reportType: ${HID.ReportType}): ${IHIDButtonCaps}[];
${getSpecificButtonCaps}(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): ${IHIDButtonCaps}[];
${createBuilder}(): ${IHIDBuilder};
${createParser}(): ${IHIDParser};
}
// This interface is not available in managed environment
// This interface is not available in native environment
vendorId: number;
// This property is not available in managed environment
// This property is not available in native environment
HID device vendor identifier.
productId: number;
// This property is not available in managed environment
// This property is not available in native environment
HID device product identifier.
device: ${IHIDDevice};
// This property is not available in managed environment
// This property is not available in native environment
Reference to the HID device object.
inputBuffersCount: number;
// This property is not available in managed environment
// This property is not available in native environment
Number of input buffers.
start(): void;
// This method is not available in managed environment
// This method is not available in native environment
Starts a HID session.
stop(): void;
// This method is not available in managed environment
// This method is not available in native environment
Stops a HID session.
setFeature(reportId: number, v: number[] | ArrayBuffer | DataView | Uint8Array): void;
// This method is not available in managed environment
// This method is not available in native environment
reportIdvSends feature report.
getFeature(reportId: number): Uint8Array;
// This method is not available in managed environment
// This method is not available in native environment
reportIdRaw feature report bytes.
Receive feature report.
send(byte: number): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
byteSend data to a HID session.
send(bytes: number [] | Uint8Array | Uint16Array | Uint32Array | ArrayBuffer | DataView): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
bytesSend data to a HID session.
send(text: string): Promise<void>;
// This method is not available in managed environment
// This method is not available in native environment
textSend data to a HID session.
receive(): Promise<Uint8Array>;
// This method is not available in managed environment
// This method is not available in native environment
Receive (read) data from the session. This function returns a promise that produces a byte array when ready.
getReport(reportId: number): Uint8Array;
// This method is not available in managed environment
// This method is not available in native environment
reportIdRaw input report bytes.
Receive input report.
setReport(reportId: number, v: number[] | ArrayBuffer | DataView | Uint8Array): void;
// This method is not available in managed environment
// This method is not available in native environment
reportIdvSends output report.
getLinkCollectionNodes(): ${IHIDNode}[];
// This method is not available in managed environment
// This method is not available in native environment
Returns a top-level collection's link collection array.
getValueCaps(reportType: ${HID.ReportType}): ${IHIDValueCaps}[];
// This method is not available in managed environment
// This method is not available in native environment
reportTypeReturns a value capability array that describes all the HID control values in a top-level collection for a specified type of HID report.
getSpecificValueCaps(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): ${IHIDValueCaps}[];
// This method is not available in managed environment
// This method is not available in native environment
reportTypeusagePageusagePage is nonzero, only buttons that specify this usage page are returned.usageusage is nonzero, only buttons that specify this usage will be returned.linkCollectionlinkCollection is nonzero, only buttons that are part of this link collection are returned.Returns a value capability array that describes all HID control values that meet a specified selection criteria.
getButtonCaps(reportType: ${HID.ReportType}): ${IHIDButtonCaps}[];
// This method is not available in managed environment
// This method is not available in native environment
reportTypeReturns a button capability array that describes all the HID control buttons in a top-level collection for a specified type of HID report.
getSpecificButtonCaps(reportType: ${HID.ReportType}, usagePage: number, usage: number, linkCollection: number): ${IHIDButtonCaps}[];
// This method is not available in managed environment
// This method is not available in native environment
reportTypeusagePageusagePage is nonzero, only buttons that specify this usage page are returned.usageusage is nonzero, only buttons that specify this usage will be returned.linkCollectionlinkCollection is nonzero, only buttons that are part of this link collection are returned.Returns a button capability array that describes all HID control buttons in a top-level collection that meet a specified selection criteria.
createBuilder(): ${IHIDBuilder};
// This method is not available in managed environment
// This method is not available in native environment
Create a HID report builder object. This object implements IHIDBuilder interface and allows you to construct HID reports given the required parameters.
createParser(): ${IHIDParser};
// This method is not available in managed environment
// This method is not available in native environment
Create a HID report parser object. This object implements IHIDParser interface and allows you to parse reports received from the device.