UNPKG

@ginden/blinkstick-v2

Version:
30 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeHidSyncTransport = void 0; const as_buffer_1 = require("../utils/as-buffer"); const usb_transport_1 = require("./usb-transport"); /** * @summary UsbTransport implementation using the 'node-hid' library with synchronous methods. * @category Adapters */ class NodeHidSyncTransport extends usb_transport_1.UsbTransport { constructor(device) { super(); this.device = device; } async sendFeatureReport(data) { return this.device.sendFeatureReport(data); } async getFeatureReport(reportId, reportLength) { const report = this.device.getFeatureReport(reportId, reportLength); return (0, as_buffer_1.asBuffer)(report); } getDeviceInfo() { return this.device.getDeviceInfo(); } async close() { return this.device.close(); } } exports.NodeHidSyncTransport = NodeHidSyncTransport; //# sourceMappingURL=node-hid-sync-transport.js.map