UNPKG

knxultimate

Version:

KNX IP protocol implementation for Node. This is the ENGINE of Node-Red KNX-Ultimate node.

59 lines 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const KnxLog_1 = require("../KnxLog"); const logger = (0, KnxLog_1.module)('DPT12'); const config = { id: 'DPT12', formatAPDU: (value) => { if (!value || typeof value !== 'number') { logger.error('Must supply a number value'); } const apdu_data = Buffer.alloc(4); apdu_data.writeUIntBE(value, 0, 4); return apdu_data; }, fromBuffer: (buf) => { if (buf.length !== 4) { logger.warn('Buffer should be 4 bytes long, got', buf.length); return null; } return buf.readUIntBE(0, 4); }, basetype: { bitlength: 32, signedness: 'unsigned', valuetype: 'basic', desc: '4-byte unsigned value', help: `// Send 4-byte unsigned value msg.payload = 12; return msg;`, }, subtypes: { '001': { name: 'Counter pulses (unsigned)', desc: 'Counter pulses', }, 100: { name: 'Counter timesec (s)', desc: 'Counter timesec (s)', }, 101: { name: 'Counter timemin (min)', desc: 'Counter timemin (min)', }, 102: { name: 'Counter timehrs (h)', desc: 'Counter timehrs (h)', }, 1200: { name: 'Volume liquid (l)', desc: 'Volume liquid (l)', }, 1201: { name: 'Volume (m3)', desc: 'Volume m3', }, }, }; exports.default = config; //# sourceMappingURL=dpt12.js.map