UNPKG

zigbee-herdsman-zigate

Version:

An open source ZigBee gateway solution with node.js.

37 lines 1.28 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ZGDeviceAnnounceMessage = void 0; const message_1 = require("../message"); const debug_1 = require("../../debug"); const buffer_reader_1 = __importDefault(require("../buffer-reader")); const debug = debug_1.Debug('driver:messages'); class ZGDeviceAnnounceMessage { constructor(payload) { this.label = 'device-announce'; this.code = message_1.ZGMessageCode.DeviceAnnounce; this.payload = this.fromBuffer(payload); debug.log.extend(`${this.getLabel()}`)(this.payload); } getCode() { return this.code; } getLabel() { return this.label; } getPayload() { return this.payload; } fromBuffer(payload) { const reader = new buffer_reader_1.default(payload); return { shortAddress: reader.nextUInt16BE().toString(16), MACIEEAddress: reader.nextBigUInt64BE().toString(16), MACCapability: reader.nextUInt8(), }; } } exports.ZGDeviceAnnounceMessage = ZGDeviceAnnounceMessage; //# sourceMappingURL=device-announce.js.map