-
Notifications
You must be signed in to change notification settings - Fork 22
/
lib.js
703 lines (669 loc) · 22.3 KB
/
lib.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
'use strict';
/* eslint-env node, mocha */
var dgram = require('dgram');
var EventEmitter = require('events');
var jspack = require('jspack').jspack;
const os = require('os');
const Netmask = require('netmask').Netmask;
const winston = require('winston');
const swap16 = (val) => { return ((val & 0xFF) << 8) | ((val >> 8) & 0xFF); };
// ArtDMX Header for jspack
var ArtDmxHeaderFormat = '!7sBHHBBBBH';
// ArtDMX Payload for jspack
var ArtDmxPayloadFormat = '512B';
/** Class representing the core dmxnet structure */
class dmxnet {
/**
* Creates a new dmxnet instance
*
* @param {object} options - Options for the whole instance
*/
constructor(options = {}) {
// Parse all options and set defaults
this.oem = options.oem || 0x2908; // OEM code hex
this.esta = options.esta || 0x0000; // ESTA code hex
this.port = options.listen || 6454; // Port listening for incoming data
this.sName = options.sName || 'dmxnet'; // Shortname
this.lName = options.lName ||
'dmxnet - OpenSource ArtNet Transceiver'; // Longname
// Init Logger
this.logOptions = Object.assign(
{
level: 'info',
format: winston.format.combine(
winston.format.splat(),
winston.format.timestamp(),
winston.format.label({ label: 'dmxnet' }),
winston.format.printf(({ level, message, label, timestamp }) => {
return `${timestamp} [${label}] ${level}: ${message}`;
})
),
transports: [new winston.transports.Console()]
},
options.log
);
this.logger = new winston.createLogger(this.logOptions);
this.hosts = options.hosts || [];
// Log started information
this.logger.info('started with options: %o', options);
// error function to call on error to avoid unhandled exeptions e.g. in Node-RED
this.errFunc = typeof options.errFunc === 'function' ? options.errFunc : undefined;
// Get all network interfaces
this.interfaces = os.networkInterfaces();
this.ip4 = [];
this.ip6 = [];
// Iterate over interfaces and insert sorted IPs
Object.keys(this.interfaces).forEach((key) => {
this.interfaces[key].forEach((val) => {
if (val.family === 'IPv4') {
var netmask = new Netmask(val.cidr);
if (this.hosts.length === 0 || (this.hosts.indexOf(val.address) !== -1)) {
this.ip4.push({
ip: val.address,
netmask: val.netmask,
mac: val.mac,
broadcast: netmask.broadcast,
});
}
}
});
});
this.logger.verbose('Interfaces: %o', this.ip4);
// init artPollReplyCount
this.artPollReplyCount = 0;
// Array containing reference to foreign controllers
this.controllers = [];
// Array containing reference to foreign node's
this.nodes = [];
// Array containing reference to senders
this.senders = [];
// Array containing reference to receiver objects
this.receivers = [];
// Object containing reference to receivers by SubnetUniverseNet
this.receiversSubUni = {};
// Timestamp of last Art-Poll send
this.last_poll;
// Create listener for incoming data
if (!Number.isInteger(this.port)) this.handleError(new Error('Invalid Port'));
this.listener4 = dgram.createSocket({
type: 'udp4',
reuseAddr: true,
});
// ToDo: IPv6
// ToDo: Multicast
// Catch Socket errors
this.listener4.on('error', function (err) {
this.handleError(new Error('Socket error: ', err));
});
// Register listening object
this.listener4.on('message', (msg, rinfo) => {
dataParser(msg, rinfo, this);
});
// Start listening
this.listener4.bind(this.port);
this.logger.info('Listening on port ' + this.port);
// Open Socket for sending broadcast data
this.socket = dgram.createSocket('udp4');
this.socket.bind(() => {
this.socket.setBroadcast(true);
this.socket_ready = true;
});
// Periodically check Controllers
setInterval(() => {
if (this.controllers) {
this.logger.verbose('Check controller alive, count ' + this.controllers.length);
for (var index = 0; index < this.controllers.length; index++) {
if ((new Date().getTime() -
new Date(this.controllers[index].last_poll).getTime()) >
60000) {
this.controllers[index].alive = false;
}
}
}
}, 30000);
return this;
}
/**
* function to handle the errors an throw them or lead to errFunc
*
* @param {object} err - The error to handle
*/
handleError(err) {
if (typeof this.errFunc === 'function') {
// give the error to the function and back to the parent object
this.errFunc(err);
} else {
// if none, trow as before
throw err;
}
}
/**
* Returns a new sender instance
*
* @param {object} options - Options for the new sender
* @returns {sender} - Instance of Sender
*/
newSender(options) {
var s = new sender(options, this);
this.senders.push(s);
this.ArtPollReply();
return s;
}
/**
* Returns a new receiver instance
*
* @param {object} options - Options for the new receiver
* @returns {receiver} - Instance of Receiver
*/
newReceiver(options) {
var r = new receiver(options, this);
this.receivers.push(r);
this.ArtPollReply();
return r;
}
/**
* Builds and sends an ArtPollReply-Packet
*/
ArtPollReply() {
this.logger.silly('Send ArtPollReply');
this.ip4.forEach((ip) => {
// BindIndex handles all the different "instance".
var bindIndex = 1;
var ArtPollReplyFormat = '!7sBHBBBBHHBBHBBH18s64s64sH4B4B4B4B4B3HB6B4BBB';
var netSwitch = 0x01;
var subSwitch = 0x01;
var status = 0b11010000;
var stateString = '#0001 [' + ('000' + this.artPollReplyCount).slice(-4) +
'] dmxnet ArtNet-Transceiver running';
var sourceip = ip.ip;
var broadcastip = ip.broadcast;
// one packet for each sender
this.senders.forEach((s) => {
var portType = 0b01000000;
var udppacket = Buffer.from(jspack.Pack(
ArtPollReplyFormat,
['Art-Net', 0, 0x0021,
// 4 bytes source ip + 2 bytes port
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3], this.port,
// 2 bytes Firmware version, netSwitch, subSwitch, OEM-Code
0x0001, s.net, s.subnet, this.oem,
// Ubea, status1, 2 bytes ESTA
0, status, swap16(this.esta),
// short name (18), long name (63), stateString (63)
this.sName.substring(0, 16), this.lName.substring(0, 63), stateString,
// 2 bytes num ports, 4*portTypes
1, portType, 0, 0, 0,
// 4*goodInput, 4*goodOutput
0b10000000, 0, 0, 0, 0, 0, 0, 0,
// 4*SW IN, 4*SW OUT
s.universe, 0, 0, 0, 0, 0, 0, 0,
// 5* deprecated/spare, style
0, 0, 0, 0x01,
// MAC address
parseInt(ip.mac.split(':')[0], 16),
parseInt(ip.mac.split(':')[1], 16),
parseInt(ip.mac.split(':')[2], 16),
parseInt(ip.mac.split(':')[3], 16),
parseInt(ip.mac.split(':')[4], 16),
parseInt(ip.mac.split(':')[5], 16),
// BindIP
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3],
// BindIndex, Status2
bindIndex, 0b00001110,
]));
// Increase bindIndex
bindIndex++;
if (bindIndex > 255) {
bindIndex = 1;
}
// Send UDP
var client = this.socket;
client.send(udppacket, 0, udppacket.length, 6454, broadcastip,
(err) => {
if (err) this.handleError(err);
this.logger.debug('ArtPollReply frame sent');
});
});
// Send one package for every receiver
this.receivers.forEach((r) => {
var portType = 0b10000000;
var udppacket = Buffer.from(jspack.Pack(
ArtPollReplyFormat,
['Art-Net', 0, 0x0021,
// 4 bytes source ip + 2 bytes port
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3], this.port,
// 2 bytes Firmware version, netSwitch, subSwitch, OEM-Code
0x0001, r.net, r.subnet, this.oem,
// Ubea, status1, 2 bytes ESTA
0, status, swap16(this.esta),
// short name (18), long name (63), stateString (63)
this.sName.substring(0, 16), this.lName.substring(0, 63), stateString,
// 2 bytes num ports, 4*portTypes
1, portType, 0, 0, 0,
// 4*goodInput, 4*goodOutput
0, 0, 0, 0, 0b10000000, 0, 0, 0,
// 4*SW IN, 4*SW OUT
0, 0, 0, 0, r.universe, 0, 0, 0,
// 5* deprecated/spare, style
0, 0, 0, 0x01,
// MAC address
parseInt(ip.mac.split(':')[0], 16),
parseInt(ip.mac.split(':')[1], 16),
parseInt(ip.mac.split(':')[2], 16),
parseInt(ip.mac.split(':')[3], 16),
parseInt(ip.mac.split(':')[4], 16),
parseInt(ip.mac.split(':')[5], 16),
// BindIP
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3],
// BindIndex, Status2
bindIndex, 0b00001110,
]));
// Increase bindIndex
bindIndex++;
if (bindIndex > 255) {
bindIndex = 1;
}
// Send UDP
var client = this.socket;
client.send(udppacket, 0, udppacket.length, 6454, broadcastip,
(err) => {
if (err) this.parent.handleError(err);
this.logger.debug('ArtPollReply frame sent');
});
});
if ((this.senders.length + this.receivers.length) < 1) {
// No senders and receivers available, propagate as "empty"
var udppacket = Buffer.from(jspack.Pack(
ArtPollReplyFormat,
['Art-Net', 0, 0x0021,
// 4 bytes source ip + 2 bytes port
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3], this.port,
// 2 bytes Firmware version, netSwitch, subSwitch, OEM-Code
0x0001, netSwitch, subSwitch, this.oem,
// Ubea, status1, 2 bytes ESTA
0, status, swap16(this.esta),
// short name (18), long name (63), stateString (63)
this.sName.substring(0, 16), this.lName.substring(0, 63), stateString,
// 2 bytes num ports, 4*portTypes
0, 0, 0, 0, 0,
// 4*goodInput, 4*goodOutput
0, 0, 0, 0, 0, 0, 0, 0,
// 4*SW IN, 4*SW OUT
0, 0, 0, 0, 0, 0, 0, 0,
// 5* deprecated/spare, style
0, 0, 0, 0x01,
// MAC address
parseInt(ip.mac.split(':')[0], 16),
parseInt(ip.mac.split(':')[1], 16),
parseInt(ip.mac.split(':')[2], 16),
parseInt(ip.mac.split(':')[3], 16),
parseInt(ip.mac.split(':')[4], 16),
parseInt(ip.mac.split(':')[5], 16),
// BindIP
sourceip.split('.')[0], sourceip.split('.')[1],
sourceip.split('.')[2], sourceip.split('.')[3],
// BindIndex, Status2
1, 0b00001110,
]));
this.logger.debug('Packet content: ' + udppacket.toString('hex'));
// Send UDP
var client = this.socket;
client.send(udppacket, 0, udppacket.length, 6454, broadcastip,
(err) => {
if (err) this.parent.handleError(err);
this.logger.debug('ArtPollReply frame sent');
});
}
});
this.artPollReplyCount++;
if (this.artPollReplyCount > 9999) {
this.artPollReplyCount = 0;
}
}
}
/**
* Class representing a sender
*/
class sender {
/**
* Creates a new sender, usually called trough factory in dmxnet
*
* @param {object} opt - Options for the sender
* @param {dmxnet} parent - Instance of the dmxnet parent
*/
constructor(opt, parent) {
// save parent object
this.parent = parent;
this.socket_ready = false;
// set options
var options = opt || {};
this.net = options.net || 0;
this.subnet = options.subnet || 0;
this.universe = options.universe || 0;
this.subuni = options.subuni;
this.ip = options.ip || '255.255.255.255';
this.port = options.port || 6454;
this.base_refresh_interval = options.base_refresh_interval || 1000;
// Validate Input
if (this.net > 127) {
this.handleError(new Error('Invalid Net, must be smaller than 128'));
}
if (this.universe > 15) {
this.handleError(new Error('Invalid Universe, must be smaller than 16'));
}
if (this.subnet > 15) {
this.handleError(new Error('Invalid subnet, must be smaller than 16'));
}
if ((this.net < 0) || (this.subnet < 0) || (this.universe < 0)) {
this.handleError(new Error('Subnet, Net or Universe must be 0 or bigger!'));
}
this.parent.logger.info('new dmxnet sender started with params: %o', options);
// init dmx-value array
this.values = [];
// fill all 512 channels
for (var i = 0; i < 512; i++) {
this.values[i] = 0;
}
// Build Subnet/Universe/Net Int16
if (!this.subuni) {
this.subuni = (this.subnet << 4) | (this.universe);
}
// ArtDmxSeq
this.ArtDmxSeq = 1;
// Create Socket
this.socket = dgram.createSocket('udp4');
// Check IP and Broadcast
if (isBroadcast(this.ip)) {
this.socket.bind(() => {
this.socket.setBroadcast(true);
this.socket_ready = true;
});
} else {
this.socket_ready = true;
}
// Transmit first Frame
this.transmit();
// Send Frame every base_refresh_interval ms - even if no channel was changed
this.interval = setInterval(() => {
this.transmit();
}, this.base_refresh_interval);
}
/**
* Transmits the current values
*/
transmit() {
// Only transmit if socket is ready
if (this.socket_ready) {
if (this.ArtDmxSeq > 255) {
this.ArtDmxSeq = 1;
}
// Build packet: ID Int8[8], OpCode Int16 0x5000 (conv. to 0x0050),
// ProtVer Int16, Sequence Int8, PhysicalPort Int8,
// SubnetUniverseNet Int16, Length Int16
var udppacket = Buffer.from(jspack.Pack(ArtDmxHeaderFormat +
ArtDmxPayloadFormat,
['Art-Net', 0, 0x0050, 14, this.ArtDmxSeq, 0, this.subuni,
this.net, 512,
].concat(this.values)));
// Increase Sequence Counter
this.ArtDmxSeq++;
this.parent.logger.debug('Packet content: ' + udppacket.toString('hex'));
// Send UDP
var client = this.socket;
client.send(udppacket, 0, udppacket.length, this.port, this.ip,
(err) => {
if (err) this.parent.handleError(err);
this.parent.logger.silly('ArtDMX frame sent to ' + this.ip + ':' + this.port);
});
}
}
/**
* Sets a single channel to a value and transmits the change
*
* @param {number} channel - channel (0-511)
* @param {number} value - value (0-255)
*/
setChannel(channel, value) {
if ((channel > 511) || (channel < 0)) {
this.handleError(new Error('Channel must be between 0 and 512'));
}
if ((value > 255) || (value < 0)) {
this.handleError(new Error('Value must be between 0 and 255'));
}
this.values[channel] = value;
this.transmit();
}
/**
* Prepares a single channel (without transmitting)
*
* @param {number} channel - channel (0-511)
* @param {number} value - value (0-255)
*/
prepChannel(channel, value) {
if ((channel > 511) || (channel < 0)) {
this.handleError(new Error('Channel must be between 0 and 512'));
}
if ((value > 255) || (value < 0)) {
this.handleError(new Error('Value must be between 0 and 255'));
}
this.values[channel] = value;
}
/**
* Fills channel block with a value and transmits the change
*
* @param {number} start - start of the block
* @param {number} stop - end of the block (inclusive)
* @param {number} value - value
*/
fillChannels(start, stop, value) {
if ((start > 511) || (start < 0)) {
this.handleError(new Error('Channel must be between 0 and 512'));
}
if ((stop > 511) || (stop < 0)) {
this.handleError(new Error('Channel must be between 0 and 512'));
}
if ((value > 255) || (value < 0)) {
this.handleError(new Error('Value must be between 0 and 255'));
}
for (var i = start; i <= stop; i++) {
this.values[i] = value;
}
this.transmit();
}
/**
* Resets all channels to zero and Transmits
*/
reset() {
// Reset all 512 channels of the sender to zero
for (var i = 0; i < 512; i++) {
this.values[i] = 0;
}
this.transmit();
}
/**
* Stops the sender and destroys it
*/
stop() {
clearInterval(this.interval);
this.parent.senders = this.parent.senders.filter(function (value) {
if (value === this) {
return false;
}
return true;
});
this.socket.close();
}
}
// ToDo: Improve method
/**
* Checks if IPv4 address given is a broadcast address - only used internally
*
* @param {string} ipaddress - IP address to check
* @returns {boolean} - result, true: broadcast
*/
function isBroadcast(ipaddress) {
var oct = ipaddress.split('.');
if (oct.length !== 4) {
throw new Error('Wrong IPv4 lenght');
}
for (var i = 0; i < 4; i++) {
if ((parseInt(oct[i], 10) > 255) || (parseInt(oct[i], 10) < 0)) {
throw new Error('Invalid IP (Octet ' + (i + 1) + ')');
}
}
if (oct[3] === '255') {
return true;
}
return false;
}
/**
* Object representing a receiver-instance
*/
class receiver extends EventEmitter {
/**
* Creates a new receiver, usually called trough factory in dmxnet
*
* @param {object} opt - Options for the receiver
* @param {dmxnet} parent - Instance of the dmxnet parent
*/
constructor(opt, parent) {
super();
// save parent object
this.parent = parent;
// set options
var options = opt || {};
this.net = options.net || 0;
this.subnet = options.subnet || 0;
this.universe = options.universe || 0;
this.subuni = options.subuni;
// Validate Input
if (this.net > 127) {
this.parent.handleError( new Error('Invalid Net, must be smaller than 128'));
}
if (this.universe > 15) {
this.parent.handleError(new Error('Invalid Universe, must be smaller than 16'));
}
if (this.subnet > 15) {
this.parent.handleError(new Error('Invalid subnet, must be smaller than 16'));
}
if ((this.net < 0) || (this.subnet < 0) || (this.universe < 0)) {
this.parent.handleError(new Error('Subnet, Net or Universe must be 0 or bigger!'));
}
this.parent.logger.info('new dmxnet receiver started with params %o', options);
// init dmx-value array
this.values = [];
// fill all 512 channels
for (var i = 0; i < 512; i++) {
this.values[i] = 0;
}
// Build Subnet/Universe/Net Int16
if (!this.subuni) {
this.subuni = (this.subnet << 4) | (this.universe);
}
this.subuninet = (this.subuni << 8) | this.net;
// Insert this object into the map
parent.receiversSubUni[this.subuninet] = this;
}
/**
* Handles received data
*
* @param {Array} data - Data from received ArtDMX
*/
receive(data) {
this.values = data;
this.emit('data', data);
}
}
// Parser & receiver
/**
* @param {Buffer} msg - Message buffer to parse
* @param {dgram.RemoteInfo} rinfo - Remote info
* @param {dmxnet} parent - Instance of the dmxnet parent
*/
var dataParser = function (msg, rinfo, parent) {
parent.logger.silly(`got UDP from ${rinfo.address}:${rinfo.port}`);
if (rinfo.size < 10) {
parent.logger.silly('Payload to short');
return;
}
// Check first 8 bytes for the "Art-Net" - String
if (String(jspack.Unpack('!8s', msg)) !== 'Art-Net\u0000') {
parent.logger.silly('Invalid header');
return;
}
var opcode = parseInt(jspack.Unpack('B', msg, 8), 10);
opcode += parseInt(jspack.Unpack('B', msg, 9), 10) * 256;
if (!opcode || opcode === 0) {
parent.logger.silly('Invalid OpCode');
return;
}
switch (opcode) {
case 0x5000:
parent.logger.debug('detected ArtDMX');
var universe = parseInt(jspack.Unpack('H', msg, 14), 10);
var data = [];
for (var ch = 1; ch <= msg.length - 18; ch++) {
data.push(msg.readUInt8(ch + 17, true));
}
parent.logger.debug('Received frame for SubUniNet 0x' + universe.toString(16));
if (parent.receiversSubUni[universe]) {
parent.receiversSubUni[universe].receive(data);
}
break;
case 0x2000:
if (rinfo.size < 14) {
parent.logger.silly('ArtPoll to small');
return;
}
parent.logger.debug('detected ArtPoll');
// Parse Protocol version
var proto = parseInt(jspack.Unpack('B', msg, 10), 10);
proto += parseInt(jspack.Unpack('B', msg, 11), 10) * 256;
if (!proto || proto < 14) {
parent.logger.silly('Invalid OpCode');
return;
}
// Parse TalkToMe
var ctrl = {
ip: rinfo.address,
family: rinfo.family,
last_poll: Date(),
alive: true,
};
var ttm_raw = parseInt(jspack.Unpack('B', msg, 12), 10);
ctrl.diagnostic_unicast = ((ttm_raw & 0b00001000) > 0);
ctrl.diagnostic_enable = ((ttm_raw & 0b00000100) > 0);
ctrl.unilateral = ((ttm_raw & 0b00000010) > 0);
// Priority
ctrl.priority = parseInt(jspack.Unpack('B', msg, 13), 10);
// Insert into controller's reference
var done = false;
for (var index = 0; index < parent.controllers.length; ++index) {
if (parent.controllers[index].ip === rinfo.address) {
done = true;
parent.controllers[index] = ctrl;
}
}
if (done !== true) {
parent.controllers.push(ctrl);
}
parent.ArtPollReply();
parent.logger.debug('Controllers: %o', parent.controllers);
break;
case 0x2100:
// ToDo
parent.logger.debug('detected ArtPollReply');
break;
default:
parent.logger.silly('OpCode not implemented');
}
};
// Export dmxnet
module.exports = {
dmxnet,
};