UNPKG

neramirez-broadlink-ts

Version:

A TypeScript-enhanced Node.JS fork of broadlinkjs, designed for interacting with RM devices in homebridge-broadlink-rm. Now includes a feature for handling multiple requests to the same device, with a specific focus on supporting homebridge-broadlink-wind

30 lines 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RFDevice = void 0; const device_1 = require("./device"); class RFDevice extends device_1.Device { constructor(host, macAddress, deviceType, port) { super(host, macAddress, deviceType, port); this.enterRFSweep = () => { let packet = Buffer.from([0x19]); packet = Buffer.concat([this.request_header, packet]); //command: number, payload: Buffer, macAddress: Buffer, requestCounter: number, deviceType: number const packetToSend = this.packetHandler.createPacket(0x6a, packet, this.macAddress, this.requestCounter, this.deviceType); return this.dispatchCommandAndIncrementCounter(0x6a, packetToSend); }; this.checkRFData = () => { let packet = Buffer.from([0x1a]); packet = Buffer.concat([this.request_header, packet]); const packetToSend = this.packetHandler.createPacket(0x6a, packet, this.macAddress, this.requestCounter, this.deviceType); return this.dispatchCommandAndIncrementCounter(0x6a, packetToSend); }; this.checkRFData2 = () => { let packet = Buffer.from([0x1b]); packet = Buffer.concat([this.request_header, packet]); const packetToSend = this.packetHandler.createPacket(0x6a, packet, this.macAddress, this.requestCounter, this.deviceType); return this.dispatchCommandAndIncrementCounter(0x6a, packetToSend); }; } } exports.RFDevice = RFDevice; //# sourceMappingURL=rfdevice.js.map