1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.objectify = exports.multicastGroup = void 0;
|
4 | function multicastGroup(universe) {
|
5 | if ((universe > 0 && universe <= 63999) || universe === 64214) {
|
6 |
|
7 | return `239.255.${universe >> 8}.${universe & 255}`;
|
8 | }
|
9 | throw new RangeError('universe must be between 1-63999');
|
10 | }
|
11 | exports.multicastGroup = multicastGroup;
|
12 | function objectify(buf) {
|
13 | const data = {};
|
14 | buf.forEach((val, ch) => {
|
15 | if (val > 0)
|
16 | data[ch + 1] = Math.round(val / 2.55);
|
17 | });
|
18 | return data;
|
19 | }
|
20 | exports.objectify = objectify;
|