@neurodevs/node-lsl 18.0.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +54 -58
- package/.vscode/settings.json +61 -66
- package/.vscode/tasks.json +98 -129
- package/README.md +14 -12
- package/build/__tests__/AbstractPackageTest.d.ts +16 -12
- package/build/__tests__/AbstractPackageTest.js +48 -20
- package/build/__tests__/AbstractPackageTest.js.map +1 -1
- package/build/__tests__/impl/BleDeviceController.test.d.ts +59 -0
- package/build/__tests__/impl/BleDeviceController.test.js +364 -0
- package/build/__tests__/impl/BleDeviceController.test.js.map +1 -0
- package/build/__tests__/impl/LslEventMarkerEmitter.test.js +1 -1
- package/build/__tests__/impl/LslEventMarkerEmitter.test.js.map +1 -1
- package/build/__tests__/impl/LslStreamInlet.test.js +2 -2
- package/build/__tests__/impl/LslStreamInlet.test.js.map +1 -1
- package/build/__tests__/impl/LslStreamOutlet.test.js +11 -13
- package/build/__tests__/impl/LslStreamOutlet.test.js.map +1 -1
- package/build/__tests__/impl/LslWebSocketBridge.test.js +3 -3
- package/build/__tests__/impl/LslWebSocketBridge.test.js.map +1 -1
- package/build/__tests__/impl/UsbDeviceController.test.d.ts +17 -0
- package/build/__tests__/impl/UsbDeviceController.test.js +81 -0
- package/build/__tests__/impl/UsbDeviceController.test.js.map +1 -0
- package/build/__tests__/impl/WindowedClockRegressor.test.d.ts +19 -0
- package/build/__tests__/impl/WindowedClockRegressor.test.js +172 -0
- package/build/__tests__/impl/WindowedClockRegressor.test.js.map +1 -0
- package/build/impl/LslStreamInlet.d.ts +1 -0
- package/build/impl/LslStreamInlet.js +2 -1
- package/build/impl/LslStreamInlet.js.map +1 -1
- package/build/impl/LslStreamOutlet.d.ts +3 -2
- package/build/impl/LslStreamOutlet.js +4 -3
- package/build/impl/LslStreamOutlet.js.map +1 -1
- package/build/impl/LslWebSocketBridge.js +2 -2
- package/build/impl/LslWebSocketBridge.js.map +1 -1
- package/build/impl/WindowedClockRegressor.d.ts +24 -0
- package/build/impl/WindowedClockRegressor.js +73 -0
- package/build/impl/WindowedClockRegressor.js.map +1 -0
- package/build/impl/controllers/BleDeviceController.d.ts +60 -0
- package/build/impl/controllers/BleDeviceController.js +153 -0
- package/build/impl/controllers/BleDeviceController.js.map +1 -0
- package/build/impl/controllers/UsbDeviceController.d.ts +23 -0
- package/build/impl/controllers/UsbDeviceController.js +40 -0
- package/build/impl/controllers/UsbDeviceController.js.map +1 -0
- package/build/impl/workers/inlet/StreamInletWorker.d.ts +4 -4
- package/build/impl/workers/inlet/StreamInletWorker.js +12 -12
- package/build/impl/workers/inlet/StreamInletWorker.js.map +1 -1
- package/build/impl/workers/outlet/LslStreamOutlet.worker.d.ts +3 -3
- package/build/impl/workers/outlet/LslStreamOutlet.worker.js +7 -7
- package/build/impl/workers/outlet/LslStreamOutlet.worker.js.map +1 -1
- package/build/index.d.ts +14 -4
- package/build/index.js +17 -5
- package/build/index.js.map +1 -1
- package/build/scripts/discoverMuse.d.ts +1 -0
- package/build/scripts/discoverMuse.js +40 -0
- package/build/scripts/discoverMuse.js.map +1 -0
- package/build/scripts/runMuse.d.ts +1 -0
- package/build/scripts/runMuse.js +40 -0
- package/build/scripts/runMuse.js.map +1 -0
- package/build/scripts/runUsb.d.ts +1 -0
- package/build/scripts/runUsb.js +14 -0
- package/build/scripts/runUsb.js.map +1 -0
- package/build/testDoubles/BleController/FakeBleController.d.ts +26 -0
- package/build/testDoubles/BleController/FakeBleController.js +47 -0
- package/build/testDoubles/BleController/FakeBleController.js.map +1 -0
- package/build/testDoubles/BleController/SpyBleController.d.ts +14 -0
- package/build/testDoubles/BleController/SpyBleController.js +48 -0
- package/build/testDoubles/BleController/SpyBleController.js.map +1 -0
- package/build/testDoubles/ClockRegressor/FakeClockRegressor.d.ts +17 -0
- package/build/testDoubles/ClockRegressor/FakeClockRegressor.js +23 -0
- package/build/testDoubles/ClockRegressor/FakeClockRegressor.js.map +1 -0
- package/build/testDoubles/StreamOutlet/FakeStreamOutlet.d.ts +2 -2
- package/build/testDoubles/StreamOutlet/FakeStreamOutlet.js +5 -2
- package/build/testDoubles/StreamOutlet/FakeStreamOutlet.js.map +1 -1
- package/build/testDoubles/UsbController/FakeUsbController.d.ts +12 -0
- package/build/testDoubles/UsbController/FakeUsbController.js +25 -0
- package/build/testDoubles/UsbController/FakeUsbController.js.map +1 -0
- package/build/testDoubles/WebSocketBridge/FakeWebSocketBridge.js.map +1 -1
- package/build/testDoubles/generateRandomOutletOptions.js +1 -1
- package/build/testDoubles/generateRandomOutletOptions.js.map +1 -1
- package/eslint.config.js +3 -0
- package/package.json +19 -57
- package/prettier.config.js +3 -0
- package/src/__tests__/AbstractPackageTest.ts +86 -29
- package/src/__tests__/impl/BleDeviceController.test.ts +535 -0
- package/src/__tests__/impl/LslEventMarkerEmitter.test.ts +2 -1
- package/src/__tests__/impl/LslStreamInlet.test.ts +2 -2
- package/src/__tests__/impl/LslStreamOutlet.test.ts +15 -14
- package/src/__tests__/impl/LslWebSocketBridge.test.ts +4 -3
- package/src/__tests__/impl/UsbDeviceController.test.ts +109 -0
- package/src/__tests__/impl/WindowedClockRegressor.test.ts +262 -0
- package/src/impl/LslStreamInlet.ts +4 -1
- package/src/impl/LslStreamOutlet.ts +5 -4
- package/src/impl/LslWebSocketBridge.ts +2 -2
- package/src/impl/WindowedClockRegressor.ts +136 -0
- package/src/impl/controllers/BleDeviceController.ts +240 -0
- package/src/impl/controllers/UsbDeviceController.ts +65 -0
- package/src/impl/workers/inlet/StreamInletWorker.ts +12 -12
- package/src/impl/workers/outlet/LslStreamOutlet.worker.ts +8 -8
- package/src/index.ts +24 -5
- package/src/scripts/discoverMuse.ts +50 -0
- package/src/scripts/runMuse.ts +50 -0
- package/src/scripts/runUsb.ts +20 -0
- package/src/testDoubles/BleController/FakeBleController.ts +81 -0
- package/src/testDoubles/BleController/SpyBleController.ts +61 -0
- package/src/testDoubles/ClockRegressor/FakeClockRegressor.ts +46 -0
- package/src/testDoubles/StreamOutlet/FakeStreamOutlet.ts +6 -3
- package/src/testDoubles/UsbController/FakeUsbController.ts +34 -0
- package/src/testDoubles/WebSocketBridge/FakeWebSocketBridge.ts +1 -2
- package/src/testDoubles/generateRandomOutletOptions.ts +2 -1
- package/tsconfig.json +23 -27
- package/.regressionproof.json +0 -7
- package/build/.spruce/settings.json +0 -15
- package/build/__tests__/impl/LslBackpressureMonitor.test.d.ts +0 -7
- package/build/__tests__/impl/LslBackpressureMonitor.test.js +0 -26
- package/build/__tests__/impl/LslBackpressureMonitor.test.js.map +0 -1
- package/build/impl/LslBackpressureMonitor.d.ts +0 -8
- package/build/impl/LslBackpressureMonitor.js +0 -8
- package/build/impl/LslBackpressureMonitor.js.map +0 -1
- package/build/testDoubles/BackpressureMonitor/FakeBackpressureMonitor.d.ts +0 -6
- package/build/testDoubles/BackpressureMonitor/FakeBackpressureMonitor.js +0 -10
- package/build/testDoubles/BackpressureMonitor/FakeBackpressureMonitor.js.map +0 -1
- package/eslint.config.mjs +0 -3
- package/src/.spruce/settings.json +0 -15
- package/src/__tests__/impl/LslBackpressureMonitor.test.ts +0 -25
- package/src/impl/LslBackpressureMonitor.ts +0 -13
- package/src/testDoubles/BackpressureMonitor/FakeBackpressureMonitor.ts +0 -13
package/.vscode/launch.json
CHANGED
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"internalConsoleOptions": "neverOpen"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
}
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"type": "node",
|
|
6
|
+
"request": "attach",
|
|
7
|
+
"name": "attach.tests",
|
|
8
|
+
"port": 5200,
|
|
9
|
+
"restart": true,
|
|
10
|
+
"timeout": 10000
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "node",
|
|
14
|
+
"request": "launch",
|
|
15
|
+
"name": "test.file",
|
|
16
|
+
"runtimeExecutable": "node",
|
|
17
|
+
"runtimeArgs": [
|
|
18
|
+
"--inspect-brk",
|
|
19
|
+
"--trace-warnings",
|
|
20
|
+
"--experimental-vm-modules",
|
|
21
|
+
"${workspaceFolder}/node_modules/.bin/jest",
|
|
22
|
+
"${fileBasenameNoExtension}",
|
|
23
|
+
"--detectOpenHandles"
|
|
24
|
+
],
|
|
25
|
+
"cwd": "${workspaceFolder}",
|
|
26
|
+
"console": "integratedTerminal",
|
|
27
|
+
"internalConsoleOptions": "neverOpen"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "node",
|
|
31
|
+
"request": "launch",
|
|
32
|
+
"name": "test.all",
|
|
33
|
+
"runtimeExecutable": "node",
|
|
34
|
+
"runtimeArgs": [
|
|
35
|
+
"--inspect-brk",
|
|
36
|
+
"--trace-warnings",
|
|
37
|
+
"--experimental-vm-modules",
|
|
38
|
+
"${workspaceFolder}/node_modules/.bin/jest"
|
|
39
|
+
],
|
|
40
|
+
"cwd": "${workspaceFolder}",
|
|
41
|
+
"console": "integratedTerminal",
|
|
42
|
+
"internalConsoleOptions": "neverOpen"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "node",
|
|
46
|
+
"request": "launch",
|
|
47
|
+
"name": "boot",
|
|
48
|
+
"runtimeExecutable": "yarn",
|
|
49
|
+
"runtimeArgs": ["run", "--inspect-brk", "--trace-warnings", "boot"],
|
|
50
|
+
"cwd": "${workspaceFolder}",
|
|
51
|
+
"console": "integratedTerminal",
|
|
52
|
+
"internalConsoleOptions": "neverOpen"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
package/.vscode/settings.json
CHANGED
|
@@ -1,67 +1,62 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"editor.formatOnSave": false,
|
|
64
|
-
"editor.codeActionsOnSave": {
|
|
65
|
-
"source.fixAll.eslint": "always"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
2
|
+
"debug.node.autoAttach": "on",
|
|
3
|
+
"git.ignoreLimitWarning": true,
|
|
4
|
+
"javascript.validate.enable": false,
|
|
5
|
+
"files.watcherExclude": {
|
|
6
|
+
"**/.git/objects/**": true,
|
|
7
|
+
"**/.git/subtree-cache/**": true,
|
|
8
|
+
"**/build/**": true,
|
|
9
|
+
"**/node_modules/**": true
|
|
10
|
+
},
|
|
11
|
+
"search.exclude": {
|
|
12
|
+
"**/build/**": true,
|
|
13
|
+
"**/node_modules/**": true,
|
|
14
|
+
"**/.next/**": true
|
|
15
|
+
},
|
|
16
|
+
"editor.codeActionsOnSave": {
|
|
17
|
+
"source.fixAll.eslint": "always"
|
|
18
|
+
},
|
|
19
|
+
"editor.formatOnSave": true,
|
|
20
|
+
"editor.formatOnSaveMode": "file",
|
|
21
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
22
|
+
"editor.maxTokenizationLineLength": 20000000,
|
|
23
|
+
"[javascript]": {
|
|
24
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
25
|
+
"editor.formatOnSave": true
|
|
26
|
+
},
|
|
27
|
+
"[javascriptreact]": {
|
|
28
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
29
|
+
"editor.formatOnSave": true
|
|
30
|
+
},
|
|
31
|
+
"[typescript]": {
|
|
32
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
33
|
+
"editor.formatOnSave": true
|
|
34
|
+
},
|
|
35
|
+
"[typescriptreact]": {
|
|
36
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
37
|
+
"editor.formatOnSave": true
|
|
38
|
+
},
|
|
39
|
+
"eslint.enable": true,
|
|
40
|
+
"eslint.useFlatConfig": true,
|
|
41
|
+
"eslint.validate": [
|
|
42
|
+
"javascript",
|
|
43
|
+
"javascriptreact",
|
|
44
|
+
"typescript",
|
|
45
|
+
"typescriptreact"
|
|
46
|
+
],
|
|
47
|
+
"eslint.workingDirectories": ["./"],
|
|
48
|
+
"debug.javascript.unmapMissingSources": true,
|
|
49
|
+
"javascript.preferences.importModuleSpecifier": "relative",
|
|
50
|
+
"typescript.preferences.importModuleSpecifier": "relative",
|
|
51
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
52
|
+
"typescript.validate.enable": true,
|
|
53
|
+
"cSpell.ignorePaths": [
|
|
54
|
+
"**/package-lock.json",
|
|
55
|
+
"**/node_modules/**",
|
|
56
|
+
"**/build/**",
|
|
57
|
+
"**/vscode-extension/**",
|
|
58
|
+
"**/.git/objects/**",
|
|
59
|
+
".vscode"
|
|
60
|
+
],
|
|
61
|
+
"cSpell.words": ["arkit", "autogenerated", "scrollable", "serializable"]
|
|
62
|
+
}
|
package/.vscode/tasks.json
CHANGED
|
@@ -1,130 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"clear": false
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"inputs": [
|
|
105
|
-
{
|
|
106
|
-
"id": "spruceCommand",
|
|
107
|
-
"description": "spruce command",
|
|
108
|
-
"default": "create.test",
|
|
109
|
-
"type": "promptString"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"id": "command",
|
|
113
|
-
"description": "command",
|
|
114
|
-
"default": "yarn",
|
|
115
|
-
"type": "promptString"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"id": "optionsCommand",
|
|
119
|
-
"description": "optionsCommand",
|
|
120
|
-
"default": "add",
|
|
121
|
-
"type": "promptString"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"id": "ndxCommand",
|
|
125
|
-
"description": "ndx command",
|
|
126
|
-
"default": "create.module",
|
|
127
|
-
"type": "promptString"
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"type": "npm",
|
|
6
|
+
"script": "watch.build.dev",
|
|
7
|
+
"group": "build",
|
|
8
|
+
"label": "watch.build.dev & problem.watcher",
|
|
9
|
+
"isBackground": true,
|
|
10
|
+
"runOptions": {
|
|
11
|
+
"runOn": "folderOpen"
|
|
12
|
+
},
|
|
13
|
+
"promptOnClose": false,
|
|
14
|
+
"presentation": {
|
|
15
|
+
"focus": false,
|
|
16
|
+
"reveal": "never"
|
|
17
|
+
},
|
|
18
|
+
"problemMatcher": {
|
|
19
|
+
"base": "$tsc-watch",
|
|
20
|
+
"applyTo": "allDocuments"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"label": "test.file",
|
|
25
|
+
"type": "shell",
|
|
26
|
+
"command": "node node_modules/@neurodevs/node-tdd/build/workspace/testRunner.cli.js --pattern \"${fileBasenameNoExtension}\" --watchMode standard --inspect 5200",
|
|
27
|
+
"promptOnClose": false,
|
|
28
|
+
"group": {
|
|
29
|
+
"kind": "test",
|
|
30
|
+
"isDefault": true
|
|
31
|
+
},
|
|
32
|
+
"presentation": {
|
|
33
|
+
"reveal": "always",
|
|
34
|
+
"panel": "dedicated"
|
|
35
|
+
},
|
|
36
|
+
"problemMatcher": []
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"label": "test.reporter",
|
|
40
|
+
"type": "shell",
|
|
41
|
+
"command": "node node_modules/@neurodevs/node-tdd/build/workspace/testRunner.cli.js --watchMode standard",
|
|
42
|
+
"promptOnClose": false,
|
|
43
|
+
"group": "test",
|
|
44
|
+
"runOptions": {
|
|
45
|
+
"runOn": "folderOpen"
|
|
46
|
+
},
|
|
47
|
+
"presentation": {
|
|
48
|
+
"panel": "shared",
|
|
49
|
+
"focus": true,
|
|
50
|
+
"reveal": "always"
|
|
51
|
+
},
|
|
52
|
+
"problemMatcher": []
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"label": "shell",
|
|
56
|
+
"type": "shell",
|
|
57
|
+
"command": "${input:command} ${input:optionsCommand}",
|
|
58
|
+
"problemMatcher": [],
|
|
59
|
+
"presentation": {
|
|
60
|
+
"reveal": "always",
|
|
61
|
+
"focus": true,
|
|
62
|
+
"panel": "new",
|
|
63
|
+
"clear": false
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"label": "ndx",
|
|
68
|
+
"type": "shell",
|
|
69
|
+
"command": "ndx ${input:ndxCommand}",
|
|
70
|
+
"problemMatcher": [],
|
|
71
|
+
"presentation": {
|
|
72
|
+
"reveal": "always",
|
|
73
|
+
"focus": true,
|
|
74
|
+
"panel": "new",
|
|
75
|
+
"clear": false
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"id": "command",
|
|
82
|
+
"description": "command",
|
|
83
|
+
"default": "yarn",
|
|
84
|
+
"type": "promptString"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "optionsCommand",
|
|
88
|
+
"description": "optionsCommand",
|
|
89
|
+
"default": "add",
|
|
90
|
+
"type": "promptString"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "ndxCommand",
|
|
94
|
+
"description": "ndx command",
|
|
95
|
+
"default": "create.module",
|
|
96
|
+
"type": "promptString"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# node-lsl
|
|
2
|
+
|
|
2
3
|
Lab Streaming Layer (LSL) for synchronized streaming of multi-modal, time-series data over a network.
|
|
3
4
|
|
|
4
5
|
## Table of Contents
|
|
6
|
+
|
|
5
7
|
- [Overview](#overview)
|
|
6
8
|
- [Installation](#installation)
|
|
7
9
|
- [Usage](#usage)
|
|
8
10
|
- [LslStreamOutlet](#lslstreamoutlet)
|
|
9
|
-
- [LslEventMarkerEmitter](#LslEventMarkerEmitter)
|
|
11
|
+
- [LslEventMarkerEmitter](#LslEventMarkerEmitter)
|
|
10
12
|
- [Test Doubles](#test-doubles)
|
|
11
13
|
|
|
12
14
|
## Overview
|
|
@@ -23,9 +25,9 @@ First, you need to install the C++ [liblsl](https://github.com/sccn/liblsl) libr
|
|
|
23
25
|
|
|
24
26
|
Then, install the package with your preferred package manager (make sure to be in the right directory for your Node project):
|
|
25
27
|
|
|
26
|
-
`npm install @neurodevs/node-lsl`
|
|
28
|
+
`npm install @neurodevs/node-lsl`
|
|
27
29
|
|
|
28
|
-
or
|
|
30
|
+
or
|
|
29
31
|
|
|
30
32
|
`yarn add @neurodevs/node-lsl`
|
|
31
33
|
|
|
@@ -45,13 +47,13 @@ LSL is often used to stream EEG data over a network. For example, to instantiate
|
|
|
45
47
|
import { LslStreamOutlet } from '@neurodevs/node-lsl'
|
|
46
48
|
|
|
47
49
|
const outlet = await LslStreamOutlet.Create({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
name: 'Muse S (2nd gen)',
|
|
51
|
+
type: 'EEG',
|
|
52
|
+
sourceId: 'muse-s-eeg',
|
|
53
|
+
channelNames: ['TP9', 'AF7', 'AF8', 'TP10', 'AUX'],
|
|
54
|
+
channelFormat: 'float32',
|
|
55
|
+
sampleRateHz: 256,
|
|
56
|
+
chunkSize: 12,
|
|
55
57
|
})
|
|
56
58
|
|
|
57
59
|
outlet.pushSample([1, 2, 3, 4, 5])
|
|
@@ -67,8 +69,8 @@ import { LslEventMarkerEmitter } from '@neurodevs/node-lsl'
|
|
|
67
69
|
const emitter = await LslEventMarkerEmitter.Create()
|
|
68
70
|
|
|
69
71
|
const markers = [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
{ name: 'phase-1-begin', waitAfterMs: 5000 },
|
|
73
|
+
{ name: 'phase-1-end', waitAfterMs: 100 },
|
|
72
74
|
]
|
|
73
75
|
|
|
74
76
|
const promise = emitter.emitMany(markers)
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import { FakeLiblsl } from '@neurodevs/ndx-native';
|
|
1
|
+
import { FakeLiblsl, FakeLibndx } from '@neurodevs/ndx-native';
|
|
2
2
|
import AbstractModuleTest from '@neurodevs/node-tdd';
|
|
3
|
-
import { OnDataCallback, StreamInletOptions } from '../impl/LslStreamInlet.js';
|
|
4
3
|
import FakeStreamInfo from '../testDoubles/StreamInfo/FakeStreamInfo.js';
|
|
4
|
+
import { OnDataCallback, StreamInletOptions } from '../impl/LslStreamInlet.js';
|
|
5
5
|
export default class AbstractPackageTest extends AbstractModuleTest {
|
|
6
6
|
protected static fakeLiblsl: FakeLiblsl;
|
|
7
|
+
protected static fakeLibndx: FakeLibndx;
|
|
8
|
+
protected static readonly fakeStreamInfo: FakeStreamInfo;
|
|
9
|
+
protected static readonly name_: string;
|
|
10
|
+
protected static readonly type: string;
|
|
11
|
+
protected static readonly sourceId: string;
|
|
12
|
+
protected static readonly units: string;
|
|
13
|
+
protected static readonly channelNames: string[];
|
|
14
|
+
protected static readonly channelCount: number;
|
|
15
|
+
protected static readonly chunkSize: number;
|
|
16
|
+
protected static readonly sampleRateHz: number;
|
|
17
|
+
protected static readonly maxBufferedMs: number;
|
|
7
18
|
protected static beforeEach(): Promise<void>;
|
|
8
19
|
protected static setFakeLiblsl(): void;
|
|
20
|
+
protected static callsToSetTimeout: number[];
|
|
21
|
+
protected static setImmediateTimeouts(): void;
|
|
22
|
+
protected static setFakeLibndx(): void;
|
|
9
23
|
protected static setSpyStreamInfo(): void;
|
|
10
24
|
protected static setFakeStreamInfo(): void;
|
|
11
25
|
protected static setSpyStreamInlet(): void;
|
|
@@ -15,15 +29,5 @@ export default class AbstractPackageTest extends AbstractModuleTest {
|
|
|
15
29
|
protected static setSpyLslWebSocketBridge(): void;
|
|
16
30
|
protected static setFakeWebSocket(): void;
|
|
17
31
|
protected static setFakeWebSocketServer(): void;
|
|
18
|
-
protected static readonly fakeStreamInfo: FakeStreamInfo;
|
|
19
|
-
protected static readonly name_: string;
|
|
20
|
-
protected static readonly type: string;
|
|
21
|
-
protected static readonly sourceId: string;
|
|
22
|
-
protected static readonly units: string;
|
|
23
|
-
protected static readonly channelNames: string[];
|
|
24
|
-
protected static readonly channelCount: number;
|
|
25
|
-
protected static readonly chunkSize = 2;
|
|
26
|
-
protected static readonly sampleRateHz: number;
|
|
27
|
-
protected static readonly maxBufferedMs: number;
|
|
28
32
|
protected static LslStreamInlet(options: Partial<StreamInletOptions>, onData: OnDataCallback): Promise<import("../impl/LslStreamInlet.js").StreamInlet>;
|
|
29
33
|
}
|