diff --git a/package-lock.json b/package-lock.json index d68d164..0cf97fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,134 +1,209 @@ { "name": "@utopian/visca", - "version": "0.0.15", + "version": "0.0.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@utopian/visca", - "version": "0.0.15", + "version": "0.0.16", "license": "ISC", "dependencies": { "node-hid": "^2.1.1", - "serialport": "^9.0.3", - "uuid": "^8.3.2" + "serialport": "^10.4.0", + "uuid": "^9.0.0" }, "devDependencies": { "@types/events": "^3.0.0", - "@types/node": "^14.14.20", - "@types/serialport": "^8.0.1", - "@types/uuid": "^8.3.0", - "typescript": "^4.1.3" + "@types/node": "^18.7.18", + "@types/serialport": "^8.0.2", + "@types/uuid": "^8.3.4", + "typescript": "^4.8.3" } }, - "node_modules/@serialport/binding-abstract": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-9.0.2.tgz", - "integrity": "sha512-kyMX6usn+VLpidt0YsDq5JwztIan9TPCX6skr0XcalOxI8I7w+/2qVZJzjgo2fSqDnPRcU2jMWTytwzEXFODvQ==", + "node_modules/@serialport/binding-mock": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-10.2.2.tgz", + "integrity": "sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==", "dependencies": { - "debug": "^4.1.1" + "@serialport/bindings-interface": "^1.2.1", + "debug": "^4.3.3" }, "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" } }, - "node_modules/@serialport/binding-mock": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-9.0.2.tgz", - "integrity": "sha512-HfrvJ/LXULHk8w63CGxwDNiDidFgDX8BnadY+cgVS6yHMHikbhLCLjCmUKsKBWaGKRqOznl0w+iUl7TMi1lkXQ==", + "node_modules/@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==", + "hasInstallScript": true, "dependencies": { - "@serialport/binding-abstract": "^9.0.2", - "debug": "^4.1.1" + "@serialport/bindings-interface": "1.2.1", + "@serialport/parser-readline": "^10.2.1", + "debug": "^4.3.2", + "node-addon-api": "^4.3.0", + "node-gyp-build": "^4.3.0" }, "engines": { - "node": ">=8.6.0" + "node": ">=12.17.0 <13.0 || >=14.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, - "node_modules/@serialport/bindings": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-9.0.4.tgz", - "integrity": "sha512-6dlE1vm5c1xk667f1Zm7D+msbHJ9jdnUr9l8DResKpj2iCBzbCNsW+yCYq26WxzXWc1L2HUaS3/aL+k0wm5amg==", - "hasInstallScript": true, - "dependencies": { - "@serialport/binding-abstract": "^9.0.2", - "@serialport/parser-readline": "^9.0.1", - "bindings": "^1.5.0", - "debug": "^4.3.1", - "nan": "^2.14.2", - "prebuild-install": "^6.0.0" - }, + "node_modules/@serialport/bindings-cpp/node_modules/@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==", "engines": { - "node": ">=8.6.0" + "node": "^12.22 || ^14.13 || >=16" + } + }, + "node_modules/@serialport/bindings-cpp/node_modules/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_modules/@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==", + "engines": { + "node": "^12.22 || ^14.13 || >=16" } }, "node_modules/@serialport/parser-byte-length": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-9.0.1.tgz", - "integrity": "sha512-1Ikv4lgCNw8OMf35yCpgzjHwkpgBEkhBuXFXIdWZk+ixaHFLlAtp03QxGPZBmzHMK58WDmEQoBHC1V5BkkAKSQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-10.3.0.tgz", + "integrity": "sha512-pJ/VoFemzKRRNDHLhFfPThwP40QrGaEnm9TtwL7o2GihEPwzBg3T0bN13ew5TpbbUYZdMpUtpm3CGfl6av9rUQ==", "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/parser-cctalk": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-9.0.1.tgz", - "integrity": "sha512-GtMda2DeJ+23bNqOc79JYV06dax2n3FLLFM3zA7nfReCOi98QbuDj4TUbFESMOnp4DB0oMO0GYHCR9gHOedTkg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-10.3.0.tgz", + "integrity": "sha512-8ujmk8EvVbDPrNF4mM33bWvUYJOZ0wXbY3WCRazHRWvyCdL0VO0DQvW81ZqgoTpiDQZm5r8wQu9rmuemahF6vQ==", "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/parser-delimiter": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-9.0.1.tgz", - "integrity": "sha512-+oaSl5zEu47OlrRiF5p5tn2qgGqYuhVcE+NI+Pv4E1xsNB/A0fFxxMv/8XUw466CRLEJ5IESIB9qbFvKE6ltaQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-10.3.0.tgz", + "integrity": "sha512-9E4Vj6s0UbbcCCTclwegHGPYjJhdm9qLCS0lowXQDEQC5naZnbsELemMHs93nD9jHPcyx1B4oXkMnVZLxX5TYw==", "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/parser-inter-byte-timeout": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-9.0.1.tgz", - "integrity": "sha512-lFflcUflcP5SF4vLIixAKs1xUI/wfOzCv1Xq78VbPOBlIjZ6ny9lQ6g7cMPR/sB/M1BHwGcdX7CEr90pe3kkog==", + "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==", + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@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==", "engines": { "node": ">=8.6.0" } }, "node_modules/@serialport/parser-readline": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-9.0.1.tgz", - "integrity": "sha512-38058gxvyfgdeLpg3aUyD98NuWkVB9yyTLpcSdeQ3GYiupivwH6Tdy/SKPmxlHIw3Ml2qil5MR2mtW2fLPB5CQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-10.3.0.tgz", + "integrity": "sha512-ki3ATZ3/RAqnqGROBKE7k+OeZ0DZXZ53GTca4q71OU5RazbbNhTOBQLKLXD3v9QZXCMJdg4hGW/2Y0DuMUqMQg==", "dependencies": { - "@serialport/parser-delimiter": "^9.0.1" + "@serialport/parser-delimiter": "10.3.0" }, "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/parser-ready": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-9.0.1.tgz", - "integrity": "sha512-lgzGkVJaaV1rJVx26WwI2UKyPxc0vu1rsOeldzA3VVbF+ABrblUQA06+cRPpT6k96GY+X4+1fB1rWuPpt8HbgQ==", + "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==", "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/parser-regex": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-9.0.1.tgz", - "integrity": "sha512-BHTV+Lkl+J8hSecFtDRENaR4fgA6tw44J+dmA1vEKEyum0iDN4bihbu8yvztYyo4PhBGUKDfm/PnD5EkJm0dPA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-10.3.0.tgz", + "integrity": "sha512-tIogTs7CvTH+UUFnsvE7i33MSISyTPTGPWlglWYH2/5coipXY503jlaYS1YGe818wWNcSx6YAjMZRdhTWwM39w==", "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@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==", + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@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==", + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/@serialport/stream": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-9.0.2.tgz", - "integrity": "sha512-0RkVe+gvwZu/PPfbb7ExQ+euGoCTGKD/B8TQ5fuhe+eKk1sh73RwjKmu9gp6veSNqx9Zljnh1dF6mhdEKWZpSA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-10.3.0.tgz", + "integrity": "sha512-7sooi5fHogYNVEJwxVdg872xO6TuMgQd2E9iRmv+o8pk/1dbBnPkmH6Ka3st1mVE+0KnIJqVlgei+ncSsqXIGw==", "dependencies": { - "debug": "^4.1.1" + "@serialport/bindings-interface": "1.2.1", + "debug": "^4.3.2" }, "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/stream/node_modules/@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==", + "engines": { + "node": "^12.22 || ^14.13 || >=16" } }, "node_modules/@types/events": { @@ -138,24 +213,24 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz", - "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==", + "version": "18.7.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", + "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, "node_modules/@types/serialport": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.1.tgz", - "integrity": "sha512-IcKHq6b/ynKSF/x4al/Ce8+a0hpbYIEaIcK9Z3l4koLvQqAPSODZ37/hgemQx8dTu7fPZDMHN4bKmu89B3UaGA==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.2.tgz", + "integrity": "sha512-z4b1I8/vdZE3upgCcAL9VAWlVVFUVn5uo3faAHavkVfK/Hb1LUxKwp9YCtA5AZqEUCWoSWl20SRTOvAI/5fQWQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/uuid": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", - "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", "dev": true }, "node_modules/ansi-regex": { @@ -277,9 +352,9 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -449,11 +524,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" - }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -472,6 +542,16 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.1.0.tgz", "integrity": "sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw==" }, + "node_modules/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==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, "node_modules/node-hid": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", @@ -613,25 +693,30 @@ } }, "node_modules/serialport": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-9.0.6.tgz", - "integrity": "sha512-T9eY4HFzQij0Hd/RsPcZySdeuAqzV5iGICHz8FXUSKVn2SvGT5zjfz/H+pRwI86k+3iFVOyddEyy8gbVNVbW7A==", - "hasInstallScript": true, + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/serialport/-/serialport-10.4.0.tgz", + "integrity": "sha512-PszPM5SnFMgSXom60PkKS2A9nMlNbHkuoyRBlzdSWw9rmgOn258+V0dYbWMrETJMM+TJV32vqBzjg5MmmUMwMw==", "dependencies": { - "@serialport/binding-mock": "^9.0.2", - "@serialport/bindings": "^9.0.4", - "@serialport/parser-byte-length": "^9.0.1", - "@serialport/parser-cctalk": "^9.0.1", - "@serialport/parser-delimiter": "^9.0.1", - "@serialport/parser-inter-byte-timeout": "^9.0.1", - "@serialport/parser-readline": "^9.0.1", - "@serialport/parser-ready": "^9.0.1", - "@serialport/parser-regex": "^9.0.1", - "@serialport/stream": "^9.0.2", - "debug": "^4.1.1" + "@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" }, "engines": { - "node": ">=8.6.0" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" } }, "node_modules/set-blocking": { @@ -764,9 +849,9 @@ } }, "node_modules/typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", + "integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -782,9 +867,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", "bin": { "uuid": "dist/bin/uuid" } @@ -809,80 +894,111 @@ } }, "dependencies": { - "@serialport/binding-abstract": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-9.0.2.tgz", - "integrity": "sha512-kyMX6usn+VLpidt0YsDq5JwztIan9TPCX6skr0XcalOxI8I7w+/2qVZJzjgo2fSqDnPRcU2jMWTytwzEXFODvQ==", - "requires": { - "debug": "^4.1.1" - } - }, "@serialport/binding-mock": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-9.0.2.tgz", - "integrity": "sha512-HfrvJ/LXULHk8w63CGxwDNiDidFgDX8BnadY+cgVS6yHMHikbhLCLjCmUKsKBWaGKRqOznl0w+iUl7TMi1lkXQ==", + "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.0.2", - "debug": "^4.1.1" + "@serialport/bindings-interface": "^1.2.1", + "debug": "^4.3.3" } }, - "@serialport/bindings": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-9.0.4.tgz", - "integrity": "sha512-6dlE1vm5c1xk667f1Zm7D+msbHJ9jdnUr9l8DResKpj2iCBzbCNsW+yCYq26WxzXWc1L2HUaS3/aL+k0wm5amg==", + "@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.0.2", - "@serialport/parser-readline": "^9.0.1", - "bindings": "^1.5.0", - "debug": "^4.3.1", - "nan": "^2.14.2", - "prebuild-install": "^6.0.0" + "@serialport/bindings-interface": "1.2.1", + "@serialport/parser-readline": "^10.2.1", + "debug": "^4.3.2", + "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==" + }, + "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==" + } } }, + "@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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-9.0.1.tgz", - "integrity": "sha512-1Ikv4lgCNw8OMf35yCpgzjHwkpgBEkhBuXFXIdWZk+ixaHFLlAtp03QxGPZBmzHMK58WDmEQoBHC1V5BkkAKSQ==" + "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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-9.0.1.tgz", - "integrity": "sha512-GtMda2DeJ+23bNqOc79JYV06dax2n3FLLFM3zA7nfReCOi98QbuDj4TUbFESMOnp4DB0oMO0GYHCR9gHOedTkg==" + "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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-9.0.1.tgz", - "integrity": "sha512-+oaSl5zEu47OlrRiF5p5tn2qgGqYuhVcE+NI+Pv4E1xsNB/A0fFxxMv/8XUw466CRLEJ5IESIB9qbFvKE6ltaQ==" + "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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-9.0.1.tgz", - "integrity": "sha512-lFflcUflcP5SF4vLIixAKs1xUI/wfOzCv1Xq78VbPOBlIjZ6ny9lQ6g7cMPR/sB/M1BHwGcdX7CEr90pe3kkog==" + "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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-9.0.1.tgz", - "integrity": "sha512-38058gxvyfgdeLpg3aUyD98NuWkVB9yyTLpcSdeQ3GYiupivwH6Tdy/SKPmxlHIw3Ml2qil5MR2mtW2fLPB5CQ==", + "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.0.1" + "@serialport/parser-delimiter": "10.3.0" } }, "@serialport/parser-ready": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-9.0.1.tgz", - "integrity": "sha512-lgzGkVJaaV1rJVx26WwI2UKyPxc0vu1rsOeldzA3VVbF+ABrblUQA06+cRPpT6k96GY+X4+1fB1rWuPpt8HbgQ==" + "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.0.1", - "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-9.0.1.tgz", - "integrity": "sha512-BHTV+Lkl+J8hSecFtDRENaR4fgA6tw44J+dmA1vEKEyum0iDN4bihbu8yvztYyo4PhBGUKDfm/PnD5EkJm0dPA==" + "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.0.2", - "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-9.0.2.tgz", - "integrity": "sha512-0RkVe+gvwZu/PPfbb7ExQ+euGoCTGKD/B8TQ5fuhe+eKk1sh73RwjKmu9gp6veSNqx9Zljnh1dF6mhdEKWZpSA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-10.3.0.tgz", + "integrity": "sha512-7sooi5fHogYNVEJwxVdg872xO6TuMgQd2E9iRmv+o8pk/1dbBnPkmH6Ka3st1mVE+0KnIJqVlgei+ncSsqXIGw==", "requires": { - "debug": "^4.1.1" + "@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==" + } } }, "@types/events": { @@ -892,24 +1008,24 @@ "dev": true }, "@types/node": { - "version": "14.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz", - "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==", + "version": "18.7.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.18.tgz", + "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, "@types/serialport": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.1.tgz", - "integrity": "sha512-IcKHq6b/ynKSF/x4al/Ce8+a0hpbYIEaIcK9Z3l4koLvQqAPSODZ37/hgemQx8dTu7fPZDMHN4bKmu89B3UaGA==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@types/serialport/-/serialport-8.0.2.tgz", + "integrity": "sha512-z4b1I8/vdZE3upgCcAL9VAWlVVFUVn5uo3faAHavkVfK/Hb1LUxKwp9YCtA5AZqEUCWoSWl20SRTOvAI/5fQWQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/uuid": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", - "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", "dev": true }, "ansi-regex": { @@ -996,9 +1112,9 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } @@ -1122,11 +1238,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" - }, "napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -1145,6 +1256,11 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.1.0.tgz", "integrity": "sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw==" }, + "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-hid": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", @@ -1261,21 +1377,24 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "serialport": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/serialport/-/serialport-9.0.6.tgz", - "integrity": "sha512-T9eY4HFzQij0Hd/RsPcZySdeuAqzV5iGICHz8FXUSKVn2SvGT5zjfz/H+pRwI86k+3iFVOyddEyy8gbVNVbW7A==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/serialport/-/serialport-10.4.0.tgz", + "integrity": "sha512-PszPM5SnFMgSXom60PkKS2A9nMlNbHkuoyRBlzdSWw9rmgOn258+V0dYbWMrETJMM+TJV32vqBzjg5MmmUMwMw==", "requires": { - "@serialport/binding-mock": "^9.0.2", - "@serialport/bindings": "^9.0.4", - "@serialport/parser-byte-length": "^9.0.1", - "@serialport/parser-cctalk": "^9.0.1", - "@serialport/parser-delimiter": "^9.0.1", - "@serialport/parser-inter-byte-timeout": "^9.0.1", - "@serialport/parser-readline": "^9.0.1", - "@serialport/parser-ready": "^9.0.1", - "@serialport/parser-regex": "^9.0.1", - "@serialport/stream": "^9.0.2", - "debug": "^4.1.1" + "@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" } }, "set-blocking": { @@ -1378,9 +1497,9 @@ } }, "typescript": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.3.tgz", + "integrity": "sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==", "dev": true }, "util-deprecate": { @@ -1389,9 +1508,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "which-pm-runs": { "version": "1.0.0", diff --git a/package.json b/package.json index 0f78efc..7945ff0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "https://medium.com/cameron-nokes/the-30-second-guide-to-publishing-a-typescript-package-to-npm-89d93ff7bccd" ], "name": "@utopian/visca", - "version": "0.0.15", + "version": "0.0.16", "description": "Advanced nodejs library for working with VISCA-based PTZ cameras over IP and over serial connections.", "main": "dist/visca.js", "types": "dist/visca.d.ts", @@ -35,15 +35,15 @@ "license": "ISC", "dependencies": { "node-hid": "^2.1.1", - "serialport": "^9.0.3", - "uuid": "^8.3.2" + "serialport": "^10.4.0", + "uuid": "^9.0.0" }, "devDependencies": { "@types/events": "^3.0.0", - "@types/node": "^14.14.20", - "@types/serialport": "^8.0.1", - "@types/uuid": "^8.3.0", - "typescript": "^4.1.3" + "@types/node": "^18.7.18", + "@types/serialport": "^8.0.2", + "@types/uuid": "^8.3.4", + "typescript": "^4.8.3" }, "bugs": { "url": "https://github.com/utopiantools/node-visca/issues" diff --git a/src/visca/parsers.ts b/src/visca/parsers.ts index 5dc4881..9cd577e 100644 --- a/src/visca/parsers.ts +++ b/src/visca/parsers.ts @@ -21,7 +21,7 @@ export class v2siParser implements BaseParser { } export class IsOnParser implements BaseParser { - static parse = ( data: number[] ): boolean => data == [ C.DATA_ONVAL ]; + static parse = ( data: number[] ): boolean => data?.[0] == C.DATA_ONVAL; } export class AFIntervalParser implements BaseParser { static parse = ( data: number[] ) => Object.freeze( { diff --git a/src/visca/visca-ip.ts b/src/visca/visca-ip.ts index cdb0399..1ad92e6 100644 --- a/src/visca/visca-ip.ts +++ b/src/visca/visca-ip.ts @@ -36,13 +36,13 @@ export class ViscaServer extends EventEmitter implements ViscaTransport { let socket = udp.createSocket( 'udp4' ); // emits when any error occurs - socket.on( 'error', function ( error ) { + socket.on( 'error', ( error ) => { console.log( 'Error: ' + error ); socket.close(); } ); // emits on new datagram msg - socket.on( 'message', function ( msg, info ) { + socket.on( 'message', ( msg, info ) => { console.log( 'Data received from client : ' + msg.toString() ); console.log( 'Received %d bytes from %s:%d\n', msg.length, info.address, info.port ); @@ -52,7 +52,7 @@ export class ViscaServer extends EventEmitter implements ViscaTransport { } ); //emits when socket is ready and listening for datagram msgs - socket.on( 'listening', function () { + socket.on( 'listening', () => { let address = socket.address(); let port = address.port; let family = address.family; @@ -63,7 +63,7 @@ export class ViscaServer extends EventEmitter implements ViscaTransport { } ); //emits after the socket is closed using socket.close(); - socket.on( 'close', function () { + socket.on( 'close', () => { console.log( 'Socket is closed !' ); } ); @@ -99,7 +99,7 @@ export class UDPTransport extends EventEmitter { this.socket = udp.createSocket( 'udp4' ); // handle replies - this.socket.on( 'message', function ( msg, info ) { + this.socket.on( 'message', ( msg, info ) => { console.log( 'Data received from client : ' + msg.toString() ); console.log( 'Received %d bytes from %s:%d\n', msg.length, info.address, info.port ); this.onData( [...msg] ); @@ -154,7 +154,7 @@ export class TCPTransport extends EventEmitter { this.socket = new net.Socket(); this.socket.connect(this.port, this.host); // handle replies - this.socket.on( 'data', function ( msg ) { + this.socket.on( 'data', ( msg ) => { console.log( 'Received %d bytes from %s:%d\n', msg.length ); this.onData( [...msg] ); }); diff --git a/src/visca/visca-serial.ts b/src/visca/visca-serial.ts index fbbc3a1..91bb167 100644 --- a/src/visca/visca-serial.ts +++ b/src/visca/visca-serial.ts @@ -1,8 +1,6 @@ -// import {SerialPort} from "serialport" import {EventEmitter} from 'events' import { v4 as uuid } from 'uuid' -// import SerialPort = require("serialport") -import SerialPort from 'serialport'; +import { SerialPort } from 'serialport'; import { ViscaCommand } from './command'; import { ViscaTransport } from './transport' const Delimiter = require( '@serialport/parser-delimiter' ); @@ -26,7 +24,7 @@ export class SerialTransport extends EventEmitter implements ViscaTransport { // open the serial port try { - this.serialport = new SerialPort( this.portname, { baudRate: this.baudRate } ); + this.serialport = new SerialPort( { path: this.portname, baudRate: this.baudRate } ); this.serialport.on( 'open', this.onOpen ); // provides error object this.serialport.on( 'close', this.onClose ); // if disconnected, err.disconnected == true this.serialport.on( 'error', this.onError ); // provides error object