From cb43ee81cbd9aae79d68cb3dc248808a694fa1d9 Mon Sep 17 00:00:00 2001 From: Russell Goldin Date: Sat, 6 Aug 2022 06:48:02 -0700 Subject: [PATCH] pull master updates --- app.ts | 1 - controller/comms/Comms.ts | 110 ++-- controller/comms/messages/Messages.ts | 1 - .../comms/messages/mock/MessagesMock.ts | 50 ++ .../messages/mock/status/MockChlorinator.ts | 82 +++ .../comms/messages/mock/status/MockPump.ts | 82 +++ defaultConfig.json | 2 +- package-lock.json | 477 ++++-------------- package.json | 2 +- web/services/config/Config.ts | 5 +- 10 files changed, 390 insertions(+), 422 deletions(-) create mode 100644 controller/comms/messages/mock/MessagesMock.ts create mode 100644 controller/comms/messages/mock/status/MockChlorinator.ts create mode 100644 controller/comms/messages/mock/status/MockPump.ts diff --git a/app.ts b/app.ts index d99e631a..aaad7a20 100755 --- a/app.ts +++ b/app.ts @@ -70,7 +70,6 @@ export async function stopPacketCaptureAsync() { export async function stopAsync(): Promise { try { console.log('Shutting down open processes'); - // await sys.board.virtualPumpControllers.stopAsync(); await webApp.stopAutoBackup(); await sys.stopAsync(); await state.stopAsync(); diff --git a/controller/comms/Comms.ts b/controller/comms/Comms.ts index 5cc0225a..160325e7 100755 --- a/controller/comms/Comms.ts +++ b/controller/comms/Comms.ts @@ -15,17 +15,18 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import { EventEmitter } from 'events'; -import * as SerialPort from 'serialport'; -import * as MockBinding from '@serialport/binding-mock'; +import { SerialPort, SerialPortMock, SerialPortOpenOptions } from 'serialport' +import { AutoDetectTypes } from '@serialport/bindings-cpp'; import { config } from '../../config/Config'; import { logger } from '../../logger/Logger'; import * as net from 'net'; -import { setTimeout, setInterval } from 'timers'; +import { setTimeout } from 'timers'; import { Message, Outbound, Inbound, Response } from './messages/Messages'; -import { InvalidEquipmentDataError, InvalidOperationError, MessageError, OutboundMessageError } from '../Errors'; +import { InvalidEquipmentDataError, InvalidOperationError, OutboundMessageError } from '../Errors'; import { utils } from "../Constants"; import { sys } from "../Equipment"; import { webApp } from "../../web/Server"; +import { messagesMock } from './messages/mock/MessagesMock' const extend = require("extend"); export class Connection { constructor() { } @@ -87,6 +88,7 @@ export class Connection { pdata.netConnect = typeof data.netConnect !== 'undefined' ? utils.makeBool(data.netConnect) : utils.makeBool(pdata.netConnect); pdata.rs485Port = typeof data.rs485Port !== 'undefined' ? data.rs485Port : pdata.rs485Port; pdata.inactivityRetry = typeof data.inactivityRetry === 'number' ? data.inactivityRetry : pdata.inactivityRetry; + pdata.mockPort = typeof data.mockPort !== 'undefined' ? utils.makeBool(data.mockPort) : utils.makeBool(pdata.mockPort); if (pdata.netConnect) { pdata.netHost = typeof data.netHost !== 'undefined' ? data.netHost : pdata.netHost; pdata.netPort = typeof data.netPort === 'number' ? data.netPort : pdata.netPort; @@ -262,7 +264,7 @@ export class RS485Port { public isOpen: boolean = false; public closing: boolean = false; private _cfg: any; - private _port: any; + private _port: SerialPort | SerialPortMock | net.Socket; public mockPort: boolean = false; private isPaused: boolean = false; private connTimer: NodeJS.Timeout; @@ -282,7 +284,7 @@ export class RS485Port { if (this.isOpen) await this.closeAsync(); if (typeof cfg !== 'undefined') this._cfg = cfg; if (!this._cfg.enabled) return true; - if (this._cfg.netConnect && !this._cfg.mockPort) { + if (this._cfg.netConnect) { let sock: net.Socket = this._port as net.Socket; if (typeof this._port !== 'undefined' && this.isOpen) { // This used to try to reconnect and recreate events even though the socket was already connected. This resulted in @@ -384,23 +386,26 @@ export class RS485Port { }); } else { - if (typeof this._port !== 'undefined' && this._port.isOpen) { + if (typeof this._port !== 'undefined' && this.isOpen) { // This used to try to reconnect even though the serial port was already connected. This resulted in // instances where an access denied error was emitted. So if the port is open we will simply return. this.resetConnTimer(); return true; } - let sp: SerialPort = null; + let sp: SerialPort | SerialPortMock = null; if (this._cfg.mockPort) { this.mockPort = true; - SerialPort.Binding = MockBinding; - let portPath = 'FAKE_PORT'; - MockBinding.createPort(portPath, { echo: false, record: true }); - sp = new SerialPort(portPath, { autoOpen: false }); + let portPath = 'MOCK_PORT'; + SerialPortMock.binding.createPort(portPath) + // SerialPortMock.binding = SerialPortMock; + // SerialPortMock.createPort(portPath, { echo: false, record: true }); + let opts: SerialPortOpenOptions = { path: portPath, autoOpen: false, baudRate: 9600 }; + sp = new SerialPortMock(opts); } else { this.mockPort = false; - sp = new SerialPort(this._cfg.rs485Port, this._cfg.portSettings); + let opts: SerialPortOpenOptions = extend(true, { path: this._cfg.rs485Port }, this._cfg.portSettings); + sp = new SerialPort(opts); } return await new Promise((resolve, _) => { // The serial port open method calls the callback just once. Unfortunately that is not the case for @@ -421,20 +426,23 @@ export class RS485Port { // for a successul connect and false otherwise. sp.on('open', () => { if (typeof this._port !== 'undefined') logger.info(`Serial Port ${this.portId}: ${this._cfg.rs485Port} recovered from lost connection.`) - else logger.info(`Serial port: ${this._cfg.rs485Port} request to open successful ${this._cfg.portSettings.baudRate}b ${this._cfg.portSettings.dataBits}-${this._cfg.portSettings.parity}-${this._cfg.portSettings.stopBits}`); + else logger.info(`Serial port: ${sp.path} request to open successful ${sp.baudRate}b ${sp.port.openOptions.dataBits}-${sp.port.openOptions.parity}-${sp.port.openOptions.stopBits}`); this._port = sp; this.isOpen = true; /// if just changing existing port, reset key flags this.isRTS = true; this.closing = false; this._processing = false; - sp.on('data', (data) => { if (!this.mockPort && !this.isPaused) this.resetConnTimer(); this.pushIn(data); }); + sp.on('data', (data) => { + if (!this.mockPort && !this.isPaused) this.resetConnTimer(); + this.pushIn(data); + }); this.resetConnTimer(); this.emitPortStats(); }); sp.on('close', (err) => { this.isOpen = false; - if (typeof err !== 'undefined' && err !== null && err.disconnected) { + if (err && err.disconnected) { logger.info(`Serial Port ${this.portId} - ${this._cfg.rs485Port} has been disconnected and closed. ${JSON.stringify(err)}`) } else { @@ -444,7 +452,7 @@ export class RS485Port { sp.on('error', (err) => { // an underlying streams error from a SP write may call the error event // instead/in leiu of the error callback - if (typeof sp.writeTimer !== 'undefined') { clearTimeout(sp.writeTimer); sp.writeTimer = null; } + if (typeof this.writeTimer !== 'undefined') { clearTimeout(this.writeTimer); this.writeTimer = null; } this.isOpen = false; if (sp.isOpen) sp.close((err) => { }); // call this with the error callback so that it doesn't emit to the error again. this.resetConnTimer(); @@ -494,7 +502,7 @@ export class RS485Port { // just call destroy and forcibly close it. this._port.destroy(); } - else if (typeof this._port.close === 'function') { + else if (!(this._port instanceof net.Socket) && typeof this._port.close === 'function') { this._port.close((err) => { if (err) { logger.error(`Error closing ${this.portId} serial port ${this._cfg.rs485Port}: ${err}`); @@ -542,52 +550,62 @@ export class RS485Port { }, this._cfg.inactivityRetry * 1000); } // Data management functions - public drain(cb: Function) { + public drain(cb: (err?: Error) => void) { if (typeof this._port === 'undefined') { logger.debug(`Serial Port ${this.portId}: Cannot perform drain function on port that is not open.`); cb(); } - if (typeof (this._port.drain) === 'function') - this._port.drain(cb); + if ((this._port instanceof SerialPort || this._port instanceof SerialPortMock) && typeof (this._port.drain) === 'function') + this._port.drain(cb as (err) => void); else // Call the method immediately as the port doesn't wait to send. cb(); } - public write(bytes: Buffer, cb: Function) { + public write(msg: Outbound, cb: (err?: Error) => void) { + let bytes = Buffer.from(msg.toPacket()); let _cb = cb; if (this._cfg.netConnect) { // SOCAT drops the connection and destroys the stream. Could be weeks or as little as a day. if (typeof this._port === 'undefined' || this._port.destroyed !== false) { this.openAsync().then(() => { - this._port.write(bytes, 'binary', cb); + (this._port as net.Socket).write(bytes, 'binary', cb); }); } else - this._port.write(bytes, 'binary', cb); + (this._port as net.Socket).write(bytes, 'binary', cb); } else { - this.writeTimer = setTimeout(() => { - // RSG - I ran into a scenario where the underlying stream - // processor was not retuning the CB and comms would - // completely stop. This timeout is a failsafe. - // Further, the underlying stream may throw an event error - // and not call the callback (per node docs) hence the - // public writeTimer. - if (typeof cb === 'function') { - cb = undefined; - _cb(new Error(`Serialport stream has not called the callback in 3s.`)); - } - }, 3000); - this._port.write(bytes, (err) => { - if (typeof this.writeTimer !== 'undefined') { - clearTimeout(this.writeTimer); - this.writeTimer = null; - // resolve(); + if (this._port instanceof SerialPortMock && this.mockPort === true) { + let m = messagesMock.process(msg); + this._port.port.emitData(Buffer.from(m)); + cb(); + } + else { + + this.writeTimer = setTimeout(() => { + // RSG - I ran into a scenario where the underlying stream + // processor was not retuning the CB and comms would + // completely stop. This timeout is a failsafe. + // Further, the underlying stream may throw an event error + // and not call the callback (per node docs) hence the + // public writeTimer. if (typeof cb === 'function') { cb = undefined; - _cb(err); + _cb(new Error(`Serialport stream has not called the callback in 3s.`)); } - } - }); + }, 3000); + this._port.write(bytes, (err) => { + if (typeof this.writeTimer !== 'undefined') { + clearTimeout(this.writeTimer); + this.writeTimer = null; + // resolve(); + if (typeof cb === 'function') { + cb = undefined; + _cb(err); + } + } + }); + } + } } private pushIn(pkt) { this._inBuffer.push.apply(this._inBuffer, pkt.toJSON().data); if (sys.isReady) setImmediate(() => { this.processPackets(); }); } @@ -690,7 +708,7 @@ export class RS485Port { // write only verifies that the buffer got ahold of it. try { let self = this; - if (!this.isRTS || this.mockPort || this.closing) return; + if (!this.isRTS || this.closing) return; var bytes = msg.toPacket(); if (this.isOpen) { this.isRTS = false; // only set if port is open, otherwise it won't be set back to true @@ -715,7 +733,7 @@ export class RS485Port { this.counter.bytesSent += bytes.length; msg.timestamp = new Date(); logger.packet(msg); - this.write(Buffer.from(bytes), (err) => { + this.write(msg, (err) => { clearTimeout(this.writeTimer); this.writeTimer = null; msg.tries++; diff --git a/controller/comms/messages/Messages.ts b/controller/comms/messages/Messages.ts index 37ce0859..8086d6c7 100755 --- a/controller/comms/messages/Messages.ts +++ b/controller/comms/messages/Messages.ts @@ -42,7 +42,6 @@ import { TouchScheduleCommands } from "controller/boards/EasyTouchBoard"; import { IntelliValveStateMessage } from "./status/IntelliValveStateMessage"; import { IntelliChemStateMessage } from "./status/IntelliChemStateMessage"; import { OutboundMessageError } from "../../Errors"; -import { prototype } from "events"; import extend = require("extend"); export enum Direction { In = 'in', diff --git a/controller/comms/messages/mock/MessagesMock.ts b/controller/comms/messages/mock/MessagesMock.ts new file mode 100644 index 00000000..f63cc743 --- /dev/null +++ b/controller/comms/messages/mock/MessagesMock.ts @@ -0,0 +1,50 @@ +import { sys } from "../../../../controller/Equipment"; +import { logger } from "../../../../logger/Logger"; +import { ControllerType } from "../../../../controller/Constants"; +import { Outbound, Protocol } from "../Messages"; +import { mockPump } from "./status/MockPump"; + + +export class MessagesMock { + constructor() { } + + public process(outboundMsg: Outbound) { + + + return this.generateInbound(outboundMsg); + + } + + private generateInbound(outboundMsg: Outbound): number[] { + switch (outboundMsg.protocol) { + /* case Protocol.Broadcast: + outboundMsg.processBroadcast(); + break; + case Protocol.IntelliValve: + IntelliValveStateMessage.process(outboundMsg); + break; + case Protocol.IntelliChem: + IntelliChemStateMessage.process(outboundMsg); + break; */ + case Protocol.Pump: + if ((outboundMsg.source >= 96 && outboundMsg.source <= 111) || (outboundMsg.dest >= 96 && outboundMsg.dest <= 111)) + return mockPump.convertOutbound(outboundMsg); + // else + // outboundMsg.processBroadcast(); + break; + /* case Protocol.Heater: + HeaterStateMessage.process(outboundMsg); + break; + case Protocol.Chlorinator: + ChlorinatorStateMessage.process(outboundMsg); + break; + case Protocol.Hayward: + PumpStateMessage.processHayward(outboundMsg); + break; */ + default: + logger.debug(`Unprocessed Message ${outboundMsg.toPacket()}`) + break; + } + } +} +export var messagesMock = new MessagesMock(); \ No newline at end of file diff --git a/controller/comms/messages/mock/status/MockChlorinator.ts b/controller/comms/messages/mock/status/MockChlorinator.ts new file mode 100644 index 00000000..c7f36ac9 --- /dev/null +++ b/controller/comms/messages/mock/status/MockChlorinator.ts @@ -0,0 +1,82 @@ +import { sys } from "../../../../Equipment"; +import { PumpState, state } from "../../../../State"; +import { Outbound } from "../../Messages"; + +export class MockPump { + constructor(){} + + public convertOutbound(outboundMsg: Outbound){ + let response: Outbound = Outbound.create({ + portId: outboundMsg.portId, + protocol: outboundMsg.protocol + }); + + switch (outboundMsg.action){ + case 7: + return this.pumpStatus(outboundMsg, response); + default: + return this.pumpAck(outboundMsg, response); + } + } + + public pumpStatus(outboundMsg: Outbound, response: Outbound){ + let pState:PumpState = state.pumps.getItemById(outboundMsg.dest - 96); + let pt = sys.board.valueMaps.pumpTypes.get(pState.type); + response.action = 7; + response.source = outboundMsg.dest; + response.dest = outboundMsg.source; + response.setPayloadBytes(0, 15); + response.setPayloadByte(0, pState.command, 2); + response.setPayloadByte(1, pState.mode, 0); + response.setPayloadByte(2, pState.driveState, 2); + let watts = 0; + if (Math.max(pState.rpm, pState.flow) > 0){ + if (pState.rpm > 0) watts = pState.rpm/pt.maxSpeed * 2000 + this.random(100); + else if (pState.flow > 0) watts = pState.flow/pt.maxFlow * 2000 + this.random(100); + else //ss, ds, etc + watts = 2000 + this.random(250); + } + response.setPayloadByte(3, Math.floor(watts / 256), 0); + response.setPayloadByte(4, watts % 256, 0); + response.setPayloadByte(5, Math.floor(pState.rpm / 256), 0); + response.setPayloadByte(6, pState.rpm % 256, 0); + response.setPayloadByte(7, pState.flow, 0); + response.setPayloadByte(8, pState.ppc, 0); + // 9, 10 = unknown + // 11, 12 = Status code; + response.setPayloadByte(11, Math.floor(pState.status / 256), 0); + response.setPayloadByte(12, pState.status % 256, 1); + let time = new Date(); + response.setPayloadByte(13, time.getHours() * 60); + response.setPayloadByte(14, time.getMinutes()); + + return response.toPacket() + } + + public pumpAck(outboundMsg: Outbound, response: Outbound){ + response.action = outboundMsg.action; + response.source = outboundMsg.dest; + response.dest = outboundMsg.source; + switch (outboundMsg.action){ + case 10: { + response.setPayloadByte(0, outboundMsg.payload[2]); + response.setPayloadByte(1, outboundMsg.payload[3]); + break; + } + default: + response.setPayloadByte(0, outboundMsg.payload[0]); + } + return response.toPacket(); + } + + private random(bounds: number, onlyPositive: boolean = false){ + let rand = Math.random() * bounds; + if (!onlyPositive) { + if (Math.random()<=.5) rand = rand * -1; + } + return rand; + } + +} + +export var mockPump: MockPump = new MockPump(); \ No newline at end of file diff --git a/controller/comms/messages/mock/status/MockPump.ts b/controller/comms/messages/mock/status/MockPump.ts new file mode 100644 index 00000000..c7f36ac9 --- /dev/null +++ b/controller/comms/messages/mock/status/MockPump.ts @@ -0,0 +1,82 @@ +import { sys } from "../../../../Equipment"; +import { PumpState, state } from "../../../../State"; +import { Outbound } from "../../Messages"; + +export class MockPump { + constructor(){} + + public convertOutbound(outboundMsg: Outbound){ + let response: Outbound = Outbound.create({ + portId: outboundMsg.portId, + protocol: outboundMsg.protocol + }); + + switch (outboundMsg.action){ + case 7: + return this.pumpStatus(outboundMsg, response); + default: + return this.pumpAck(outboundMsg, response); + } + } + + public pumpStatus(outboundMsg: Outbound, response: Outbound){ + let pState:PumpState = state.pumps.getItemById(outboundMsg.dest - 96); + let pt = sys.board.valueMaps.pumpTypes.get(pState.type); + response.action = 7; + response.source = outboundMsg.dest; + response.dest = outboundMsg.source; + response.setPayloadBytes(0, 15); + response.setPayloadByte(0, pState.command, 2); + response.setPayloadByte(1, pState.mode, 0); + response.setPayloadByte(2, pState.driveState, 2); + let watts = 0; + if (Math.max(pState.rpm, pState.flow) > 0){ + if (pState.rpm > 0) watts = pState.rpm/pt.maxSpeed * 2000 + this.random(100); + else if (pState.flow > 0) watts = pState.flow/pt.maxFlow * 2000 + this.random(100); + else //ss, ds, etc + watts = 2000 + this.random(250); + } + response.setPayloadByte(3, Math.floor(watts / 256), 0); + response.setPayloadByte(4, watts % 256, 0); + response.setPayloadByte(5, Math.floor(pState.rpm / 256), 0); + response.setPayloadByte(6, pState.rpm % 256, 0); + response.setPayloadByte(7, pState.flow, 0); + response.setPayloadByte(8, pState.ppc, 0); + // 9, 10 = unknown + // 11, 12 = Status code; + response.setPayloadByte(11, Math.floor(pState.status / 256), 0); + response.setPayloadByte(12, pState.status % 256, 1); + let time = new Date(); + response.setPayloadByte(13, time.getHours() * 60); + response.setPayloadByte(14, time.getMinutes()); + + return response.toPacket() + } + + public pumpAck(outboundMsg: Outbound, response: Outbound){ + response.action = outboundMsg.action; + response.source = outboundMsg.dest; + response.dest = outboundMsg.source; + switch (outboundMsg.action){ + case 10: { + response.setPayloadByte(0, outboundMsg.payload[2]); + response.setPayloadByte(1, outboundMsg.payload[3]); + break; + } + default: + response.setPayloadByte(0, outboundMsg.payload[0]); + } + return response.toPacket(); + } + + private random(bounds: number, onlyPositive: boolean = false){ + let rand = Math.random() * bounds; + if (!onlyPositive) { + if (Math.random()<=.5) rand = rand * -1; + } + return rand; + } + +} + +export var mockPump: MockPump = new MockPump(); \ No newline at end of file diff --git a/defaultConfig.json b/defaultConfig.json index 13f42f4a..be118ac5 100755 --- a/defaultConfig.json +++ b/defaultConfig.json @@ -14,7 +14,7 @@ "dataBits": 8, "parity": "none", "stopBits": 1, - "flowControl": false, + "rtscts": false, "autoOpen": false, "lock": false } diff --git a/package-lock.json b/package-lock.json index 60dd89bf..98e0ef6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -171,80 +171,106 @@ "fastq": "^1.6.0" } }, - "@serialport/binding-abstract": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-9.2.3.tgz", - "integrity": "sha512-cQs9tbIlG3P0IrOWyVirqlhWuJ7Ms2Zh9m2108z6Y5UW/iVj6wEOiW8EmK9QX9jmJXYllE7wgGgvVozP5oCj3w==", - "requires": { - "debug": "^4.3.2" - } - }, "@serialport/binding-mock": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-9.2.4.tgz", - "integrity": "sha512-dpEhACCs44oQhh6ajJfJdvQdK38Vq0N4W6iD/gdplglDCK7qXRQCMUjJIeKdS/HSEiWkC3bwumUhUufdsOyT4g==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-10.2.2.tgz", + "integrity": "sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==", "requires": { - "@serialport/binding-abstract": "9.2.3", - "debug": "^4.3.2" + "@serialport/bindings-interface": "^1.2.1", + "debug": "^4.3.3" } }, - "@serialport/bindings": { - "version": "9.2.8", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-9.2.8.tgz", - "integrity": "sha512-hSLxTe0tADZ3LMMGwvEJWOC/TaFQTyPeFalUCsJ1lSQ0k6bPF04JwrtB/C81GetmDBTNRY0GlD0SNtKCc7Dr5g==", + "@serialport/bindings-cpp": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/@serialport/bindings-cpp/-/bindings-cpp-10.7.0.tgz", + "integrity": "sha512-Xx1wA2UCG2loS32hxNvWJI4smCzGKhWqE85//fLRzHoGgE1lSLe3Nk7W40/ebrlGFHWRbQZmeaIF4chb2XLliA==", "requires": { - "@serialport/binding-abstract": "9.2.3", - "@serialport/parser-readline": "9.2.4", - "bindings": "^1.5.0", + "@serialport/bindings-interface": "1.2.1", + "@serialport/parser-readline": "^10.2.1", "debug": "^4.3.2", - "nan": "^2.15.0", - "prebuild-install": "^7.0.0" + "node-addon-api": "^4.3.0", + "node-gyp-build": "^4.3.0" + }, + "dependencies": { + "@serialport/bindings-interface": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@serialport/bindings-interface/-/bindings-interface-1.2.1.tgz", + "integrity": "sha512-63Dyqz2gtryRDDckFusOYqLYhR3Hq/M4sEdbF9i/VsvDb6T+tNVgoAKUZ+FMrXXKnCSu+hYbk+MTc0XQANszxw==" + } } }, + "@serialport/bindings-interface": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@serialport/bindings-interface/-/bindings-interface-1.2.2.tgz", + "integrity": "sha512-CJaUd5bLvtM9c5dmO9rPBHPXTa9R2UwpkJ0wdh9JCYcbrPWsKz+ErvR0hBLeo7NPeiFdjFO4sonRljiw4d2XiA==" + }, "@serialport/parser-byte-length": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-9.2.4.tgz", - "integrity": "sha512-sQD/iw4ZMU3xW9PLi0/GlvU6Y623jGeWecbMkO7izUo/6P7gtfv1c9ikd5h0kwL8AoAOpQA1lxdHIKox+umBUg==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-10.3.0.tgz", + "integrity": "sha512-pJ/VoFemzKRRNDHLhFfPThwP40QrGaEnm9TtwL7o2GihEPwzBg3T0bN13ew5TpbbUYZdMpUtpm3CGfl6av9rUQ==" }, "@serialport/parser-cctalk": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-9.2.4.tgz", - "integrity": "sha512-T4TU5vQMwmo9AB3gQLFDWbfJXlW5jd9guEsB/nqKjFHTv0FXPdZ7DQ2TpSp8RnHWxU3GX6kYTaDO20BKzc8GPQ==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-10.3.0.tgz", + "integrity": "sha512-8ujmk8EvVbDPrNF4mM33bWvUYJOZ0wXbY3WCRazHRWvyCdL0VO0DQvW81ZqgoTpiDQZm5r8wQu9rmuemahF6vQ==" }, "@serialport/parser-delimiter": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-9.2.4.tgz", - "integrity": "sha512-4nvTAoYAgkxFiXrkI+3CA49Yd43CODjeszh89EK+I9c8wOZ+etZduRCzINYPiy26g7zO+GRAb9FoPCsY+sYcbQ==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-10.3.0.tgz", + "integrity": "sha512-9E4Vj6s0UbbcCCTclwegHGPYjJhdm9qLCS0lowXQDEQC5naZnbsELemMHs93nD9jHPcyx1B4oXkMnVZLxX5TYw==" }, "@serialport/parser-inter-byte-timeout": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-9.2.4.tgz", - "integrity": "sha512-SOAdvr0oBQIOCXX198hiTlxs4JTKg9j5piapw5tNq52fwDOWdbYrFneT/wN04UTMKaDrJuEvXq6T4rv4j7nJ5A==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-10.3.0.tgz", + "integrity": "sha512-wKP0QK85NHgvT6BBB1qBfKBBU4pf8kespNXAZBUYmFT+P4n8r8IZE2mqigCD+AiZcfWNQoAizwOsT/Jx/qeVig==" + }, + "@serialport/parser-packet-length": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-packet-length/-/parser-packet-length-10.3.0.tgz", + "integrity": "sha512-bj0cWzt8YSQj/E5fRQVYdi4TsfTlZQrXlXrUwjyTsCONv8IPOHzsz+yY0fw5SEMiJtaLyqvPkCHLsttOd/zFsg==" }, "@serialport/parser-readline": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-9.2.4.tgz", - "integrity": "sha512-Z1/qrZTQUVhNSJP1hd9YfDvq0o7d87rNwAjjRKbVpa7Qi51tG5BnKt43IV3NFMyBlVcRe0rnIb3tJu57E0SOwg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-10.3.0.tgz", + "integrity": "sha512-ki3ATZ3/RAqnqGROBKE7k+OeZ0DZXZ53GTca4q71OU5RazbbNhTOBQLKLXD3v9QZXCMJdg4hGW/2Y0DuMUqMQg==", "requires": { - "@serialport/parser-delimiter": "9.2.4" + "@serialport/parser-delimiter": "10.3.0" } }, "@serialport/parser-ready": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-9.2.4.tgz", - "integrity": "sha512-Pyi94Itjl6qAURwIZr/gmZpMAyTmKXThm6vL5DoAWGQjcRHWB0gwv2TY2v7N+mQLJYUKU3cMnvnATXxHm7xjxw==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-10.3.0.tgz", + "integrity": "sha512-1owywJ4p592dJyVrEJZPIh6pUZ3/y/LN6kGTDH2wxdewRUITo/sGvDy0er5i2+dJD3yuowiAz0dOHSdz8tevJA==" }, "@serialport/parser-regex": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-9.2.4.tgz", - "integrity": "sha512-sI/cVvPOYz+Dbv4ZdnW16qAwvXiFf/1pGASQdbveRTlgJDdz7sRNlCBifzfTN2xljwvCTZYqiudKvDdC1TepRQ==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-10.3.0.tgz", + "integrity": "sha512-tIogTs7CvTH+UUFnsvE7i33MSISyTPTGPWlglWYH2/5coipXY503jlaYS1YGe818wWNcSx6YAjMZRdhTWwM39w==" + }, + "@serialport/parser-slip-encoder": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-slip-encoder/-/parser-slip-encoder-10.3.0.tgz", + "integrity": "sha512-JI0ILF5sylWn8f0MuMzHFBix/iMUTa79/Z95KaPZYnVaEdA7h7hh/o21Jmon/26P3RJwL1SNJCjZ81zfan+LtQ==" + }, + "@serialport/parser-spacepacket": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-spacepacket/-/parser-spacepacket-10.3.0.tgz", + "integrity": "sha512-PDF73ClEPsClD1FEJZHNuBevDKsJCkqy/XD5+S5eA6+tY5D4HLrVgSWsg+3qqB6+dlpwf2CzHe+uO8D3teuKHA==" }, "@serialport/stream": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-9.2.4.tgz", - "integrity": "sha512-bLye8Ub4vUFQGmkh8qEqehr7SE7EJs2yDs0h9jzuL5oKi+F34CFmWkEErO8GAOQ8YNn7p6b3GxUgs+0BrHHDZQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-10.3.0.tgz", + "integrity": "sha512-7sooi5fHogYNVEJwxVdg872xO6TuMgQd2E9iRmv+o8pk/1dbBnPkmH6Ka3st1mVE+0KnIJqVlgei+ncSsqXIGw==", "requires": { + "@serialport/bindings-interface": "1.2.1", "debug": "^4.3.2" + }, + "dependencies": { + "@serialport/bindings-interface": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@serialport/bindings-interface/-/bindings-interface-1.2.1.tgz", + "integrity": "sha512-63Dyqz2gtryRDDckFusOYqLYhR3Hq/M4sEdbF9i/VsvDb6T+tNVgoAKUZ+FMrXXKnCSu+hYbk+MTc0XQANszxw==" + } } }, "@socket.io/component-emitter": { @@ -577,7 +603,8 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { "version": "3.2.1", @@ -592,20 +619,6 @@ "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -689,14 +702,6 @@ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -910,11 +915,6 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -928,11 +928,6 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==" }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "color": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", @@ -1021,11 +1016,6 @@ } } }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -1112,19 +1102,6 @@ "ms": "2.1.2" } }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "requires": { - "mimic-response": "^3.1.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1139,11 +1116,6 @@ "object-keys": "^1.1.1" } }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -1160,11 +1132,6 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, - "detect-libc": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.0.tgz", - "integrity": "sha512-S55LzUl8HUav8l9E2PBTlC5PAJrHK7tkM+XXFGD+fbsbkTzhCpG6K05LxJcUOEWzMa4v6ptcMZ9s3fOdJDu0Zw==" - }, "dicer": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", @@ -1256,11 +1223,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, "enabled": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", @@ -2152,11 +2114,6 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, "expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -2306,11 +2263,6 @@ "flat-cache": "^3.0.4" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2454,11 +2406,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2490,41 +2437,6 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - } - } - }, "get-intrinsic": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", @@ -2550,11 +2462,6 @@ "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", "dev": true }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -2854,11 +2761,6 @@ "has-symbols": "^1.0.2" } }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "help-me": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/help-me/-/help-me-3.0.0.tgz", @@ -2968,7 +2870,8 @@ "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "inquirer": { "version": "6.5.2", @@ -3130,11 +3033,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3501,11 +3399,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -3527,11 +3420,6 @@ "minimist": "^1.2.5" } }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, "mqtt": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-4.3.7.tgz", @@ -3625,16 +3513,6 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" }, - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" - }, - "napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3650,13 +3528,15 @@ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, - "node-abi": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.8.0.tgz", - "integrity": "sha512-tzua9qWWi7iW4I42vUPKM+SfaF0vQSLAm4yO5J83mSwB7GeoWrDKC/K+8YCnYNwqP5duwazbw2X9l4m8SC2cUw==", - "requires": { - "semver": "^7.3.5" - } + "node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + }, + "node-gyp-build": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "node-ssdp": { "version": "4.0.1", @@ -3694,17 +3574,6 @@ "abbrev": "1" } }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "number-allocator": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.10.tgz", @@ -3714,11 +3583,6 @@ "js-sdsl": "^2.1.2" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3968,26 +3832,6 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "prebuild-install": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.0.1.tgz", - "integrity": "sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==", - "requires": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "npmlog": "^4.0.1", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - } - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4057,24 +3901,6 @@ "unpipe": "1.0.0" } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - } - } - }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -4213,6 +4039,7 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -4268,21 +4095,24 @@ } }, "serialport": { - "version": "9.2.8", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-9.2.8.tgz", - "integrity": "sha512-FsWpMQgSJxi93JgWl5xM1f9/Z8IjRJuaUEoHqLf8FPBLw7gMhInuHOBhI2onQufWIYPGTz3H3oGcu1nCaK1EfA==", - "requires": { - "@serialport/binding-mock": "9.2.4", - "@serialport/bindings": "9.2.8", - "@serialport/parser-byte-length": "9.2.4", - "@serialport/parser-cctalk": "9.2.4", - "@serialport/parser-delimiter": "9.2.4", - "@serialport/parser-inter-byte-timeout": "9.2.4", - "@serialport/parser-readline": "9.2.4", - "@serialport/parser-ready": "9.2.4", - "@serialport/parser-regex": "9.2.4", - "@serialport/stream": "9.2.4", - "debug": "^4.3.2" + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/serialport/-/serialport-10.4.0.tgz", + "integrity": "sha512-PszPM5SnFMgSXom60PkKS2A9nMlNbHkuoyRBlzdSWw9rmgOn258+V0dYbWMrETJMM+TJV32vqBzjg5MmmUMwMw==", + "requires": { + "@serialport/binding-mock": "10.2.2", + "@serialport/bindings-cpp": "10.7.0", + "@serialport/parser-byte-length": "10.3.0", + "@serialport/parser-cctalk": "10.3.0", + "@serialport/parser-delimiter": "10.3.0", + "@serialport/parser-inter-byte-timeout": "10.3.0", + "@serialport/parser-packet-length": "10.3.0", + "@serialport/parser-readline": "10.3.0", + "@serialport/parser-ready": "10.3.0", + "@serialport/parser-regex": "10.3.0", + "@serialport/parser-slip-encoder": "10.3.0", + "@serialport/parser-spacepacket": "10.3.0", + "@serialport/stream": "10.3.0", + "debug": "^4.3.3" } }, "serve-static": { @@ -4296,11 +4126,6 @@ "send": "0.18.0" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", @@ -4341,21 +4166,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "requires": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -4479,31 +4289,6 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, "string.prototype.trimend": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", @@ -4536,6 +4321,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4564,41 +4350,6 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, - "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "requires": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -4699,14 +4450,6 @@ "tslib": "^1.8.1" } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4846,14 +4589,6 @@ "is-symbol": "^1.0.3" } }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "winston": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", diff --git a/package.json b/package.json index 27dca88f..c13e4259 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "multer": "^1.4.4", "multicast-dns": "^7.2.4", "node-ssdp": "^4.0.1", - "serialport": "^9.2.8", + "serialport": "^10.4.0", "socket.io": "^4.5.0", "socket.io-client": "^4.5.0", "source-map-support": "^0.5.21", diff --git a/web/services/config/Config.ts b/web/services/config/Config.ts index 31031199..e1c2f9e6 100755 --- a/web/services/config/Config.ts +++ b/web/services/config/Config.ts @@ -68,13 +68,16 @@ export class ConfigRoute { let cfg = config.getSection('controller'); for (let section in cfg) { if (section.startsWith('comms')) { - let cport = extend(true, { enabled: false, netConnect: false }, cfg[section]); + let cport = extend(true, { enabled: false, netConnect: false, mockPort: false }, cfg[section]); let port = conn.findPortById(cport.portId || 0); if (typeof port !== 'undefined') cport.stats = port.stats; opts.ports.push(cport); } } opts.local = await conn.getLocalPortsAsync() || []; + opts.local.push({ + "path": "MOCK_PORT" + }); return res.status(200).send(opts); } catch (err) { next(err); } });