-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbci2000shell.mjs
More file actions
26 lines (26 loc) · 893 Bytes
/
bci2000shell.mjs
File metadata and controls
26 lines (26 loc) · 893 Bytes
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
const { spawn } = require("child_process");
// import { spawn } from "child_process";
// import path from "path";
let operator;
(async () => {
let spawnParams = {
cwd: path.dirname("/mnt/c/Users/Chris/Downloads/Dickens_BCI2000/prog/BCI2000Shell.exe"),
};
operator = spawn(
"/mnt/c/Users/Chris/Downloads/Dickens_BCI2000/prog/BCI2000Shell.exe",
["-i"],
spawnParams
);
operator.stdin.write("Show Window; \n");
operator.stdin.write("Startup system; \n");
operator.stdin.write("Start executable SignalGenerator; \n");
operator.stdin.write("Start executable DummySignalProcessing; \n");
operator.stdin.write("Start executable DummyApplication; \n");
operator.stdout.on("data", (data) => {
let message = data.toString();
console.log(message.slice(0, -14).trim());
});
operator.on("beforeExit", () => {
operator.stdin.write("EXIT; \n");
});
})();