mirror of
https://github.com/moritzruth/node-enttec-open-dmx-usb.git
synced 2025-04-21 07:41:22 +02:00
Compare commits
123 commits
Author | SHA1 | Date | |
---|---|---|---|
708fa71a03 | |||
e16af171a7 | |||
e1a78c6044 | |||
36956cee74 | |||
a565e9e5b7 | |||
|
065d48d8fe | ||
|
0a2da2673e | ||
|
806cdc1c59 | ||
1d0227b757 | |||
7d42a5a6a9 | |||
|
e987fa02ea | ||
|
22975dc0c5 | ||
|
eeffd69156 | ||
|
3c17d5bc11 | ||
8aedd57de1 | |||
|
d5d67a5fcd | ||
|
dad0b8e264 | ||
|
0c98b4c402 | ||
|
57b193b44d | ||
|
c105fdb999 | ||
|
85b18db307 | ||
|
0835a8bc1d | ||
|
41d3869431 | ||
|
136b2311e0 | ||
|
aa0195bd62 | ||
|
0e6ab6e7ac | ||
|
1615d740cb | ||
|
35f55c9419 | ||
|
6ac5eaf7d4 | ||
|
13bbd3a792 | ||
|
a263604cef | ||
|
31bafcf95c | ||
|
fc30393b8e | ||
|
f8e64435e8 | ||
|
9684fb12bf | ||
|
6a8c1c8ddf | ||
|
71e31e595b | ||
|
f035c20487 | ||
|
70452644ed | ||
|
1a87ddfdb6 | ||
|
d88b0ce406 | ||
|
02eb46a0a3 | ||
8797cc4ecd | |||
15406a9bbb | |||
dc0e83c14c | |||
|
8c0eefb9a4 | ||
|
bcabd91b52 | ||
|
0efaa05b8a | ||
|
6aa20473c2 | ||
|
a0994e32d2 | ||
|
cfa5d99b83 | ||
|
dacdca60f8 | ||
|
bb51d85f7e | ||
|
f35a7a1a97 | ||
|
f5507eec80 | ||
|
2d17c5f505 | ||
|
bd7e963ce8 | ||
|
cad4d13a35 | ||
|
6b8bff4f13 | ||
|
a4bf66fd44 | ||
|
eaac273831 | ||
|
623b24a631 | ||
|
2f913c099a | ||
|
6be17e849d | ||
|
6531f8ad54 | ||
|
ce43f6ad54 | ||
|
7f80b6c6ef | ||
a3630193f2 | |||
|
5037b74865 | ||
|
146a710a4c | ||
|
3ac3882994 | ||
|
26fe3d18b0 | ||
|
764beb43a2 | ||
|
c69aa97ff8 | ||
|
0ab7323603 | ||
|
0caabd999d | ||
|
e2fb726ad9 | ||
|
6c7864b6e4 | ||
|
20d1a66338 | ||
|
73b200e91d | ||
|
48ef21e991 | ||
|
584533d883 | ||
|
fd95b46197 | ||
|
90ee5b6c5f | ||
|
18f26d467f | ||
|
839edd0d70 | ||
|
c7a2ea4050 | ||
|
75eccea805 | ||
|
4bdb70036f | ||
|
d3979e6f0a | ||
|
a498556f89 | ||
|
501864aeb3 | ||
|
37e71521a0 | ||
|
778373ecf2 | ||
|
72f3b23e5c | ||
|
fa07da4765 | ||
|
a058a42faa | ||
|
4eb0de47fb | ||
|
4b54263158 | ||
|
f22a31cff2 | ||
|
48415dc6a4 | ||
|
9e0765e683 | ||
|
16c85a809c | ||
|
fa3e51f82b | ||
|
d531e6b28b | ||
|
1464019a09 | ||
|
9a678f04a6 | ||
|
b118aedc0e | ||
|
3842f25e91 | ||
|
38c55659c8 | ||
|
eb88e698b1 | ||
|
52eef4e6e3 | ||
|
693fc139a3 | ||
|
87e85990c9 | ||
|
d062ee63b1 | ||
|
f24499fa16 | ||
|
be9a0e65ee | ||
|
8c362b1aa3 | ||
|
e9ba3dd20b | ||
|
d61ea042d3 | ||
|
5e5abece1f | ||
c7778f85dc | |||
aac1d33525 |
10 changed files with 747 additions and 4757 deletions
|
@ -1,12 +1,3 @@
|
|||
{
|
||||
"extends": "awzzm-ts",
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 10,
|
||||
"project": "tsconfig.json"
|
||||
}
|
||||
"extends": ["awzzm-ts", "awzzm-node"]
|
||||
}
|
||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
node_modules/
|
||||
pkg/
|
||||
dist/
|
||||
.idea/
|
||||
/test.mjs
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
|||
10
|
||||
18
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 Moritz Ruth
|
||||
Copyright (c) 2019-2021 Moritz Ruth
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
58
README.md
58
README.md
|
@ -1,32 +1,68 @@
|
|||
# node-enttec-open-dmx-usb
|
||||
# node-enttec-open-dmx-usb 🔌
|
||||
> A Node.js library for interacting with the
|
||||
> [Enttec Open DMX USB Interface](https://www.enttec.co.uk/en/product/controls/dmx-usb-interfaces/open-dmx-usb/)
|
||||
> [Enttec Open DMX USB interface](https://www.enttec.co.uk/en/product/controls/dmx-usb-interfaces/open-dmx-usb/)
|
||||
|
||||
## Installation
|
||||
```shell script
|
||||
As it uses `serialport` under the hood, it should also work in
|
||||
[these environments](https://serialport.io/docs/guide-platform-support#supported-platforms-and-architectures).
|
||||
|
||||
## Install
|
||||

|
||||
|
||||
The minimum required Node.js version is `v18.0.0`.
|
||||
|
||||
```sh
|
||||
yarn add enttec-open-dmx-usb
|
||||
# or
|
||||
npm install enttec-open-dmx-usb
|
||||
```
|
||||
|
||||
## Usage
|
||||
All functions are documented using JSDoc, and the code is not uglified and easy to understand, so feel free to [explore it](src/index.ts).
|
||||
[**View documentation on jsdocs.io**](https://www.jsdocs.io/package/enttec-open-dmx-usb#EnttecOpenDMXUSBDevice)
|
||||
|
||||
```js
|
||||
import { EnttecOpenDMXUSBDevice as DMXDevice } from "enttec-open-dmx-usb";
|
||||
import { EnttecOpenDMXUSBDevice as DMXDevice } from "enttec-open-dmx-usb"
|
||||
|
||||
(async () => {
|
||||
const device = new DMXDevice(await DMXDevice.getFirstAvailableDevice());
|
||||
const device = new DMXDevice(await DMXDevice.getFirstAvailableDevice())
|
||||
|
||||
device.setChannels({
|
||||
1: 0xFF,
|
||||
2: 0x44
|
||||
});
|
||||
})
|
||||
|
||||
// same as
|
||||
device.setChannels([0xFF, 0x44]);
|
||||
device.setChannels([0xFF, 0x44])
|
||||
|
||||
// same as
|
||||
device.setChannels(Buffer.from([0xFF, 0x44]));
|
||||
})();
|
||||
device.setChannels(Buffer.from([0xFF, 0x44]))
|
||||
})()
|
||||
```
|
||||
|
||||
### What to do when this doesn’t work
|
||||
|
||||
TLDR: Because `setTimeout` is imprecise, install [`easy-sleep`](https://github.com/qufei1993/easy-sleep) and
|
||||
pass the `usleep` function provided by it as the third parameter to the constructor of `EnttecOpenDMXUSBDevice`.
|
||||
See the example below.
|
||||
|
||||
From [the Node.js documentation](https://nodejs.org/api/timers.html#settimeoutcallback-delay-args) regarding `setTimeout`:
|
||||
> Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering.
|
||||
> The callback will be called as close as possible to the time specified.
|
||||
|
||||
Because of this and the passive nature of the Enttec Open DMX USB interface, sometimes the timing requirements of the DMX specification are not met.
|
||||
Using a library such as [`easy-sleep`](https://github.com/qufei1993/easy-sleep) which allows sleeping (i. e. blocking the event loop) for a precise
|
||||
amount of microseconds is a possible workaround.
|
||||
|
||||
You may pass a function sleeping for `n` *micro*seconds as the third parameter to the constructor of `EnttecOpenDMXUSBDevice`.
|
||||
|
||||
For example, using `easy-sleep`:
|
||||
```js
|
||||
import { EnttecOpenDMXUSBDevice as DMXDevice } from "enttec-open-dmx-usb"
|
||||
import easySleep from "easy-sleep"
|
||||
|
||||
new DMXDevice(await DMXDevice.getFirstAvailableDevice(), true, easySleep.Thread.usleep)
|
||||
```
|
||||
|
||||
## Events
|
||||
`ready` - `startSending` may be called.
|
||||
|
||||
`error` - An error occurred. `error` events from `serialport` are passed through.
|
||||
|
|
46
package.json
46
package.json
|
@ -1,37 +1,33 @@
|
|||
{
|
||||
"name": "enttec-open-dmx-usb",
|
||||
"version": "2.0.0",
|
||||
"description": "A Node.js library for interacting with the Enttec Open DMX USB Interface",
|
||||
"version": "4.0.1",
|
||||
"description": "A Node.js library for interacting with the Enttec Open DMX USB interface",
|
||||
"repository": "https://github.com/moritzruth/node-enttec-open-dmx-usb.git",
|
||||
"author": "Moritz Ruth <dev@moritzruth.de>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "pika build",
|
||||
"lint": "eslint src",
|
||||
"version": "yarn build",
|
||||
"test": "echo There are no tests"
|
||||
},
|
||||
"@pika/pack": {
|
||||
"pipeline": [
|
||||
[
|
||||
"@pika/plugin-ts-standard-pkg"
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"keywords": [
|
||||
"dmx",
|
||||
"enttec",
|
||||
"usb"
|
||||
],
|
||||
[
|
||||
"@pika/plugin-build-node"
|
||||
]
|
||||
]
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.9.2",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.2",
|
||||
"@types/node": "^14.0.27",
|
||||
"@types/serialport": "^8.0.1",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-config-awzzm-ts": "^1.0.1",
|
||||
"typescript": "^3.9.7"
|
||||
"@types/node": "^18.16.10",
|
||||
"@types/serialport": "^8.0.2",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"serialport": "^9.0.0"
|
||||
"eventemitter3": "^5.0.1",
|
||||
"serialport": "^11.0.0"
|
||||
}
|
||||
}
|
||||
|
|
613
pnpm-lock.yaml
generated
Normal file
613
pnpm-lock.yaml
generated
Normal file
|
@ -0,0 +1,613 @@
|
|||
lockfileVersion: '6.0'
|
||||
|
||||
dependencies:
|
||||
easy-sleep:
|
||||
specifier: ^1.2.2
|
||||
version: 1.2.2
|
||||
eventemitter3:
|
||||
specifier: ^5.0.1
|
||||
version: 5.0.1
|
||||
serialport:
|
||||
specifier: ^11.0.0
|
||||
version: 11.0.0
|
||||
|
||||
devDependencies:
|
||||
'@types/node':
|
||||
specifier: ^18.16.10
|
||||
version: 18.16.10
|
||||
'@types/serialport':
|
||||
specifier: ^8.0.2
|
||||
version: 8.0.2
|
||||
typescript:
|
||||
specifier: ^5.0.4
|
||||
version: 5.0.4
|
||||
|
||||
packages:
|
||||
|
||||
/@serialport/binding-mock@10.2.2:
|
||||
resolution: {integrity: sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
'@serialport/bindings-interface': 1.2.2
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@serialport/bindings-cpp@11.0.1:
|
||||
resolution: {integrity: sha512-3I1mniVg3osYuIUXxU0jB5AHPsxWmErmc3JC3WfUSlfXsjWMHkHfFzbW9Scuv/z/6DLCJIDyltabRa2FoW2qsQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@serialport/bindings-interface': 1.2.2
|
||||
'@serialport/parser-readline': 10.5.0
|
||||
debug: 4.3.4
|
||||
node-addon-api: 6.1.0
|
||||
node-gyp-build: 4.6.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@serialport/bindings-interface@1.2.2:
|
||||
resolution: {integrity: sha512-CJaUd5bLvtM9c5dmO9rPBHPXTa9R2UwpkJ0wdh9JCYcbrPWsKz+ErvR0hBLeo7NPeiFdjFO4sonRljiw4d2XiA==}
|
||||
engines: {node: ^12.22 || ^14.13 || >=16}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-byte-length@11.0.0:
|
||||
resolution: {integrity: sha512-rExsdFKdzOIHOBqTwzxUF1A9nrluVIZKZOtvMq5i0Hc3euooGdmkx0VXYNRlI2rd6kJLTL2P+uIR+ZtCTRyT+w==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-cctalk@11.0.0:
|
||||
resolution: {integrity: sha512-eN1MvEIFwI4GedWJhte6eWF+NZtrjchZbMf0CE6NV9TRzJI1KLnFf90ZOj/mhGuANojX4sqWfJKQXwN6E8VSHQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-delimiter@10.5.0:
|
||||
resolution: {integrity: sha512-/uR/yT3jmrcwnl2FJU/2ySvwgo5+XpksDUR4NF/nwTS5i3CcuKS+FKi/tLzy1k8F+rCx5JzpiK+koqPqOUWArA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-delimiter@11.0.0:
|
||||
resolution: {integrity: sha512-aZLJhlRTjSmEwllLG7S4J8s8ctRAS0cbvCpO87smLvl3e4BgzbVgF6Z6zaJd3Aji2uSiYgfedCdNc4L6W+1E2g==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-inter-byte-timeout@11.0.0:
|
||||
resolution: {integrity: sha512-RLgqZC50IET6FtEIt6Oi0vdRsesSBWLNwB7ldzR9OzyXKgK0XHRzqKqbB0u5Q+tC5OScdWeiQ2AO6jooKUZtsw==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-packet-length@11.0.0:
|
||||
resolution: {integrity: sha512-6ZkOiaCooabpV/EM7ttSRbisbDWpGEf7Yxyr13t28LicYR43THRdjdMZcRnWxEM/jpwfskkLLXAR6wziVpKrlw==}
|
||||
engines: {node: '>=8.6.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-readline@10.5.0:
|
||||
resolution: {integrity: sha512-0aXJknodcl94W9zSjvU+sLdXiyEG2rqjQmvBWZCr8wJZjWEtv3RgrnYiWq4i2OTOyC8C/oPK8ZjpBjQptRsoJQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
'@serialport/parser-delimiter': 10.5.0
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-readline@11.0.0:
|
||||
resolution: {integrity: sha512-rRAivhRkT3YO28WjmmG4FQX6L+KMb5/ikhyylRfzWPw0nSXy97+u07peS9CbHqaNvJkMhH1locp2H36aGMOEIA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
'@serialport/parser-delimiter': 11.0.0
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-ready@11.0.0:
|
||||
resolution: {integrity: sha512-lSsCPIctoc5kADCKnZDYBz1j69TsFqtnaWUicBzUAIAoUXpYKeYld8YX5NrvjViuVfIJeiqLZeGjxOWe5fqQqQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-regex@11.0.0:
|
||||
resolution: {integrity: sha512-aKuc/+/KE9swahTbYpSuOsQa7LggPx7jhfobJLPVVbAic80OpfCIY+MKr6Ax4R6UtQwF90O5Yk6OEmbbvtEmiA==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-slip-encoder@11.0.0:
|
||||
resolution: {integrity: sha512-3ZI/swd2it20vmu2tzqDbkyE4dqy+kExEDY6T33YQ210HDKPVhqj7FAVGo5P++MZ3dup1of11t4P9UPBNkuJnQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/parser-spacepacket@11.0.0:
|
||||
resolution: {integrity: sha512-+hqRckrTEqz+/uAUZY0Tq6YIRyCl4oQOH1MeVzKiFiGNjZP7hDJCDoY7LTr9CeJhxvcT0ItTbtjGBqGumV8fxg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dev: false
|
||||
|
||||
/@serialport/stream@11.0.0:
|
||||
resolution: {integrity: sha512-Zty7B8C1H2XRnay2mVmW1ygEHXRHXQDcaC5wAVvOZMbQSc7ye03rMlPvviDS+pGxU2t2A2bMo34CUrRduSBong==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
'@serialport/bindings-interface': 1.2.2
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@types/node@18.16.10:
|
||||
resolution: {integrity: sha512-sMo3EngB6QkMBlB9rBe1lFdKSLqljyWPPWv6/FzSxh/IDlyVWSzE9RiF4eAuerQHybrWdqBgAGb03PM89qOasA==}
|
||||
dev: true
|
||||
|
||||
/@types/serialport@8.0.2:
|
||||
resolution: {integrity: sha512-z4b1I8/vdZE3upgCcAL9VAWlVVFUVn5uo3faAHavkVfK/Hb1LUxKwp9YCtA5AZqEUCWoSWl20SRTOvAI/5fQWQ==}
|
||||
dependencies:
|
||||
'@types/node': 18.16.10
|
||||
dev: true
|
||||
|
||||
/abbrev@1.1.1:
|
||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
||||
dev: false
|
||||
|
||||
/ansi-regex@2.1.1:
|
||||
resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/aproba@1.2.0:
|
||||
resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==}
|
||||
dev: false
|
||||
|
||||
/are-we-there-yet@1.1.7:
|
||||
resolution: {integrity: sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==}
|
||||
dependencies:
|
||||
delegates: 1.0.0
|
||||
readable-stream: 2.3.8
|
||||
dev: false
|
||||
|
||||
/balanced-match@1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
dev: false
|
||||
|
||||
/brace-expansion@1.1.11:
|
||||
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
dev: false
|
||||
|
||||
/chownr@1.1.4:
|
||||
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
|
||||
dev: false
|
||||
|
||||
/code-point-at@1.1.0:
|
||||
resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/concat-map@0.0.1:
|
||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
dev: false
|
||||
|
||||
/console-control-strings@1.1.0:
|
||||
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
|
||||
dev: false
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
dev: false
|
||||
|
||||
/debug@3.2.7:
|
||||
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
peerDependenciesMeta:
|
||||
supports-color:
|
||||
optional: true
|
||||
dependencies:
|
||||
ms: 2.1.2
|
||||
dev: false
|
||||
|
||||
/debug@4.3.4:
|
||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
||||
engines: {node: '>=6.0'}
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
peerDependenciesMeta:
|
||||
supports-color:
|
||||
optional: true
|
||||
dependencies:
|
||||
ms: 2.1.2
|
||||
dev: false
|
||||
|
||||
/deep-extend@0.6.0:
|
||||
resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}
|
||||
engines: {node: '>=4.0.0'}
|
||||
dev: false
|
||||
|
||||
/delegates@1.0.0:
|
||||
resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}
|
||||
dev: false
|
||||
|
||||
/detect-libc@1.0.3:
|
||||
resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==}
|
||||
engines: {node: '>=0.10'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/easy-sleep@1.2.2:
|
||||
resolution: {integrity: sha512-mn+XCd6xKQWkLKnFFyg/3QZ2QvXqIFgUZNo/gWUYRilYHYdg9BdxPO0fPVWm+rhx3wzDaKJePK5tYC8x5aKIKg==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-pre-gyp: 0.17.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eventemitter3@5.0.1:
|
||||
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
||||
dev: false
|
||||
|
||||
/fs-minipass@1.2.7:
|
||||
resolution: {integrity: sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==}
|
||||
dependencies:
|
||||
minipass: 2.9.0
|
||||
dev: false
|
||||
|
||||
/fs.realpath@1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
dev: false
|
||||
|
||||
/gauge@2.7.4:
|
||||
resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==}
|
||||
dependencies:
|
||||
aproba: 1.2.0
|
||||
console-control-strings: 1.1.0
|
||||
has-unicode: 2.0.1
|
||||
object-assign: 4.1.1
|
||||
signal-exit: 3.0.7
|
||||
string-width: 1.0.2
|
||||
strip-ansi: 3.0.1
|
||||
wide-align: 1.1.5
|
||||
dev: false
|
||||
|
||||
/glob@7.2.3:
|
||||
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 3.1.2
|
||||
once: 1.4.0
|
||||
path-is-absolute: 1.0.1
|
||||
dev: false
|
||||
|
||||
/has-unicode@2.0.1:
|
||||
resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==}
|
||||
dev: false
|
||||
|
||||
/iconv-lite@0.4.24:
|
||||
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
dev: false
|
||||
|
||||
/ignore-walk@3.0.4:
|
||||
resolution: {integrity: sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==}
|
||||
dependencies:
|
||||
minimatch: 3.1.2
|
||||
dev: false
|
||||
|
||||
/inflight@1.0.6:
|
||||
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
wrappy: 1.0.2
|
||||
dev: false
|
||||
|
||||
/inherits@2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: false
|
||||
|
||||
/ini@1.3.8:
|
||||
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
|
||||
dev: false
|
||||
|
||||
/is-fullwidth-code-point@1.0.0:
|
||||
resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dependencies:
|
||||
number-is-nan: 1.0.1
|
||||
dev: false
|
||||
|
||||
/isarray@1.0.0:
|
||||
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
|
||||
dev: false
|
||||
|
||||
/minimatch@3.1.2:
|
||||
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
dev: false
|
||||
|
||||
/minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
dev: false
|
||||
|
||||
/minipass@2.9.0:
|
||||
resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==}
|
||||
dependencies:
|
||||
safe-buffer: 5.2.1
|
||||
yallist: 3.1.1
|
||||
dev: false
|
||||
|
||||
/minizlib@1.3.3:
|
||||
resolution: {integrity: sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==}
|
||||
dependencies:
|
||||
minipass: 2.9.0
|
||||
dev: false
|
||||
|
||||
/mkdirp@0.5.6:
|
||||
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
minimist: 1.2.8
|
||||
dev: false
|
||||
|
||||
/ms@2.1.2:
|
||||
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
|
||||
dev: false
|
||||
|
||||
/needle@2.9.1:
|
||||
resolution: {integrity: sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==}
|
||||
engines: {node: '>= 4.4.x'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
debug: 3.2.7
|
||||
iconv-lite: 0.4.24
|
||||
sax: 1.2.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/node-addon-api@6.1.0:
|
||||
resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==}
|
||||
dev: false
|
||||
|
||||
/node-gyp-build@4.6.0:
|
||||
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/node-pre-gyp@0.17.0:
|
||||
resolution: {integrity: sha512-abzZt1hmOjkZez29ppg+5gGqdPLUuJeAEwVPtHYEJgx0qzttCbcKFpxrCQn2HYbwCv2c+7JwH4BgEzFkUGpn4A==}
|
||||
deprecated: 'Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future'
|
||||
hasBin: true
|
||||
dependencies:
|
||||
detect-libc: 1.0.3
|
||||
mkdirp: 0.5.6
|
||||
needle: 2.9.1
|
||||
nopt: 4.0.3
|
||||
npm-packlist: 1.4.8
|
||||
npmlog: 4.1.2
|
||||
rc: 1.2.8
|
||||
rimraf: 2.7.1
|
||||
semver: 5.7.1
|
||||
tar: 4.4.19
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/nopt@4.0.3:
|
||||
resolution: {integrity: sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
abbrev: 1.1.1
|
||||
osenv: 0.1.5
|
||||
dev: false
|
||||
|
||||
/npm-bundled@1.1.2:
|
||||
resolution: {integrity: sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==}
|
||||
dependencies:
|
||||
npm-normalize-package-bin: 1.0.1
|
||||
dev: false
|
||||
|
||||
/npm-normalize-package-bin@1.0.1:
|
||||
resolution: {integrity: sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==}
|
||||
dev: false
|
||||
|
||||
/npm-packlist@1.4.8:
|
||||
resolution: {integrity: sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==}
|
||||
dependencies:
|
||||
ignore-walk: 3.0.4
|
||||
npm-bundled: 1.1.2
|
||||
npm-normalize-package-bin: 1.0.1
|
||||
dev: false
|
||||
|
||||
/npmlog@4.1.2:
|
||||
resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==}
|
||||
dependencies:
|
||||
are-we-there-yet: 1.1.7
|
||||
console-control-strings: 1.1.0
|
||||
gauge: 2.7.4
|
||||
set-blocking: 2.0.0
|
||||
dev: false
|
||||
|
||||
/number-is-nan@1.0.1:
|
||||
resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/object-assign@4.1.1:
|
||||
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/once@1.4.0:
|
||||
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
dev: false
|
||||
|
||||
/os-homedir@1.0.2:
|
||||
resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/os-tmpdir@1.0.2:
|
||||
resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/osenv@0.1.5:
|
||||
resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==}
|
||||
dependencies:
|
||||
os-homedir: 1.0.2
|
||||
os-tmpdir: 1.0.2
|
||||
dev: false
|
||||
|
||||
/path-is-absolute@1.0.1:
|
||||
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/process-nextick-args@2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
dev: false
|
||||
|
||||
/rc@1.2.8:
|
||||
resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
deep-extend: 0.6.0
|
||||
ini: 1.3.8
|
||||
minimist: 1.2.8
|
||||
strip-json-comments: 2.0.1
|
||||
dev: false
|
||||
|
||||
/readable-stream@2.3.8:
|
||||
resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
|
||||
dependencies:
|
||||
core-util-is: 1.0.3
|
||||
inherits: 2.0.4
|
||||
isarray: 1.0.0
|
||||
process-nextick-args: 2.0.1
|
||||
safe-buffer: 5.1.2
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
dev: false
|
||||
|
||||
/rimraf@2.7.1:
|
||||
resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
glob: 7.2.3
|
||||
dev: false
|
||||
|
||||
/safe-buffer@5.1.2:
|
||||
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
|
||||
dev: false
|
||||
|
||||
/safe-buffer@5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
dev: false
|
||||
|
||||
/safer-buffer@2.1.2:
|
||||
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
|
||||
dev: false
|
||||
|
||||
/sax@1.2.4:
|
||||
resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==}
|
||||
dev: false
|
||||
|
||||
/semver@5.7.1:
|
||||
resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/serialport@11.0.0:
|
||||
resolution: {integrity: sha512-bxs3XejQcOHWpzPAaXMhxVRlbem6fjNUrux3ToqrGvFR6BcjOYhqE5CsHOuutv37kmhmnuHrn+/hN+1BpTmaFg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
dependencies:
|
||||
'@serialport/binding-mock': 10.2.2
|
||||
'@serialport/bindings-cpp': 11.0.1
|
||||
'@serialport/parser-byte-length': 11.0.0
|
||||
'@serialport/parser-cctalk': 11.0.0
|
||||
'@serialport/parser-delimiter': 11.0.0
|
||||
'@serialport/parser-inter-byte-timeout': 11.0.0
|
||||
'@serialport/parser-packet-length': 11.0.0
|
||||
'@serialport/parser-readline': 11.0.0
|
||||
'@serialport/parser-ready': 11.0.0
|
||||
'@serialport/parser-regex': 11.0.0
|
||||
'@serialport/parser-slip-encoder': 11.0.0
|
||||
'@serialport/parser-spacepacket': 11.0.0
|
||||
'@serialport/stream': 11.0.0
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/set-blocking@2.0.0:
|
||||
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
|
||||
dev: false
|
||||
|
||||
/signal-exit@3.0.7:
|
||||
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
|
||||
dev: false
|
||||
|
||||
/string-width@1.0.2:
|
||||
resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dependencies:
|
||||
code-point-at: 1.1.0
|
||||
is-fullwidth-code-point: 1.0.0
|
||||
strip-ansi: 3.0.1
|
||||
dev: false
|
||||
|
||||
/string_decoder@1.1.1:
|
||||
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
dev: false
|
||||
|
||||
/strip-ansi@3.0.1:
|
||||
resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dependencies:
|
||||
ansi-regex: 2.1.1
|
||||
dev: false
|
||||
|
||||
/strip-json-comments@2.0.1:
|
||||
resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/tar@4.4.19:
|
||||
resolution: {integrity: sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==}
|
||||
engines: {node: '>=4.5'}
|
||||
dependencies:
|
||||
chownr: 1.1.4
|
||||
fs-minipass: 1.2.7
|
||||
minipass: 2.9.0
|
||||
minizlib: 1.3.3
|
||||
mkdirp: 0.5.6
|
||||
safe-buffer: 5.2.1
|
||||
yallist: 3.1.1
|
||||
dev: false
|
||||
|
||||
/typescript@5.0.4:
|
||||
resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==}
|
||||
engines: {node: '>=12.20'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: false
|
||||
|
||||
/wide-align@1.1.5:
|
||||
resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}
|
||||
dependencies:
|
||||
string-width: 1.0.2
|
||||
dev: false
|
||||
|
||||
/wrappy@1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
dev: false
|
||||
|
||||
/yallist@3.1.1:
|
||||
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
|
||||
dev: false
|
78
src/index.ts
78
src/index.ts
|
@ -1,24 +1,34 @@
|
|||
import { EventEmitter } from "events"
|
||||
import SerialPort from "serialport"
|
||||
import { EventEmitter } from "eventemitter3"
|
||||
import { SerialPort } from "serialport"
|
||||
|
||||
export const VENDOR_ID = "0403" // Enttec
|
||||
export const PRODUCT_ID = "6001" // Open DMX USB
|
||||
|
||||
export class EnttecOpenDMXUSBDevice extends EventEmitter {
|
||||
interface Events {
|
||||
ready: []
|
||||
error: [Error]
|
||||
}
|
||||
|
||||
type Usleep = (microSeconds: number) => unknown
|
||||
|
||||
export class EnttecOpenDMXUSBDevice extends EventEmitter<Events> {
|
||||
private shouldBeSending = false
|
||||
private sendTimeout: NodeJS.Timeout | null = null
|
||||
private sendTimeout: ReturnType<typeof setTimeout> | null = null
|
||||
private buffer = Buffer.alloc(513)
|
||||
private readonly port: SerialPort
|
||||
private readonly usleep: Usleep | null
|
||||
|
||||
/**
|
||||
* @param {string} path A path returned by {@link EnttecOpenDMXUSBDevice.listDevices} or
|
||||
* @param path A path returned by {@link EnttecOpenDMXUSBDevice.listDevices} or
|
||||
* {@link EnttecOpenDMXUSBDevice.getFirstAvailableDevice}.
|
||||
* @param {boolean} [startSending=true] If the device should start sending as soon as it is ready.
|
||||
* @param [startSending=true] Whether the device should start sending as soon as it is ready.
|
||||
* @param [usleep=null] A function blocking the event loop for `n` microseconds. See the README.md for more information.
|
||||
*/
|
||||
constructor(path: string, startSending = true) {
|
||||
constructor(path: string, startSending = true, usleep: Usleep | null = null) {
|
||||
super()
|
||||
|
||||
this.port = new SerialPort(path, {
|
||||
this.port = new SerialPort({
|
||||
path,
|
||||
baudRate: 250000,
|
||||
dataBits: 8,
|
||||
stopBits: 2,
|
||||
|
@ -30,22 +40,28 @@ export class EnttecOpenDMXUSBDevice extends EventEmitter {
|
|||
this.emit("ready")
|
||||
if (startSending) this.startSending(0)
|
||||
})
|
||||
|
||||
// Without this, errors would be uncaught.
|
||||
this.port.on("error", (error: Error) => {
|
||||
this.emit("error", error)
|
||||
})
|
||||
|
||||
this.usleep = usleep
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts sending.
|
||||
* @param {number} [interval=0] The time between each attempt to send.
|
||||
* @throws Error If the device is not ready yet.
|
||||
* Start sending.
|
||||
* @param [interval=0] The milliseconds between each attempt to send. Most of the time `0` works fine.
|
||||
* @throws When the device is not ready yet.
|
||||
*/
|
||||
startSending(interval = 0) {
|
||||
if (!this.port.isOpen) throw new Error("The device is not ready yet. Wait for the 'ready' event.")
|
||||
|
||||
this.emit("sending-started", interval)
|
||||
this.shouldBeSending = true
|
||||
|
||||
// eslint-disable-next-line unicorn/consistent-function-scoping
|
||||
const send = () => {
|
||||
this.sendUniverse()
|
||||
this._sendUniverse()
|
||||
.then(() => {
|
||||
if (this.shouldBeSending)
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
|
@ -58,23 +74,22 @@ export class EnttecOpenDMXUSBDevice extends EventEmitter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Stops sending.
|
||||
* Stop sending.
|
||||
*/
|
||||
stopSending() {
|
||||
this.emit("sending-stopped")
|
||||
this.shouldBeSending = false
|
||||
|
||||
if (this.sendTimeout !== null) clearTimeout(this.sendTimeout)
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the channel values.
|
||||
* Set channel values.
|
||||
* If channels is an Object, the keys are the channel numbers.
|
||||
*
|
||||
* @param {Buffer|Object|Array} channels
|
||||
* @param {boolean} [clear=false] Whether all previously assigned channels should be set to 0
|
||||
* @param channels
|
||||
* @param [clear=false] Whether all previously assigned channels should be set to `0`
|
||||
*/
|
||||
setChannels(channels: Buffer | number[] | { [key: number]: number }, clear = false) {
|
||||
setChannels(channels: Buffer | number[] | Record<number, number>, clear = false) {
|
||||
if (clear) {
|
||||
this.buffer = Buffer.alloc(513)
|
||||
this.buffer[0] = 0
|
||||
|
@ -111,26 +126,34 @@ export class EnttecOpenDMXUSBDevice extends EventEmitter {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise} Resolves when the whole universe was send.
|
||||
* @returns A Promise resolved when the whole universe was sent.
|
||||
* @private
|
||||
*/
|
||||
private async sendUniverse(): Promise<void> {
|
||||
async _sendUniverse(): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
this.port.set({ brk: true, rts: false }, () => {
|
||||
if (this.usleep === null) {
|
||||
setTimeout(() => {
|
||||
this.port.set({ brk: false, rts: false }, () => {
|
||||
setTimeout(() => {
|
||||
this.port.write(this.buffer, () => resolve())
|
||||
}, 0)
|
||||
}, 1)
|
||||
})
|
||||
}, 0)
|
||||
}, 1)
|
||||
} else {
|
||||
this.usleep(92)
|
||||
|
||||
this.port.set({ brk: false, rts: false }, () => {
|
||||
this.usleep!(12)
|
||||
this.port.write(this.buffer, () => resolve())
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the paths of all available devices.
|
||||
* @returns {Promise<string[]>}
|
||||
* Get the paths of all available devices.
|
||||
*/
|
||||
static async listDevices(): Promise<string[]> {
|
||||
const allPorts = await SerialPort.list()
|
||||
|
@ -140,9 +163,8 @@ export class EnttecOpenDMXUSBDevice extends EventEmitter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets the path of the first available device found.
|
||||
* @throws Error when no device is found.
|
||||
* @returns {Promise<string>}
|
||||
* Get the path of the first available device.
|
||||
* @throws When no device is found.
|
||||
*/
|
||||
static async getFirstAvailableDevice(): Promise<string> {
|
||||
const devices = await EnttecOpenDMXUSBDevice.listDevices()
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"target": "es2019",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"esModuleInterop": true
|
||||
"esModuleInterop": true,
|
||||
"outDir": "dist",
|
||||
"declaration": true,
|
||||
"types": ["@types/node"],
|
||||
"lib": ["es2019"]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue