UNPKG

@blackmagic-controller/core

Version:

An npm module for interfacing with the Blackmagic usb/bluetooth controllers

26 lines 990 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultPropertiesService = void 0; const util_js_1 = require("../../util.js"); class DefaultPropertiesService { #device; constructor(device) { this.#device = device; } async getBatteryLevel() { const val = await this.#device.getFeatureReport(6, 3); return val[2] / 100; } async getFirmwareVersion() { const val = await this.#device.getFeatureReport(1, 9); const view = (0, util_js_1.uint8ArrayToDataView)(val); // Generate a semver format string return `${view.getUint8(5)}.${view.getUint8(6)}.${view.getUint8(7)}+${view.getUint32(1, true).toString(16)}`; } async getSerialNumber() { const val = await this.#device.getFeatureReport(7, 33); return new TextDecoder('ascii').decode(val.subarray(1)); } } exports.DefaultPropertiesService = DefaultPropertiesService; //# sourceMappingURL=default.js.map