Skip to content

Commit b914b99

Browse files
committed
feat: enhance nodejs example
1 parent 6d8759f commit b914b99

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nodejs-client/delimiter_example.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const sock = new zmq.Subscriber;
99
console.log("Subscriber connected to port 5678");
1010
let buf = [];
1111
let matched = 0;
12-
let desired = [0x1b, 0x6d];
12+
let desired = [0x1d, 0x56, 0x31]; // toshiba is set, epson would be: [0x1b, 0x6d]
1313
for await (const [msg] of sock) {
1414
for(const c of msg) {
15-
buf.push(c);
15+
// console.log(c); // uncomment if you do not know the sequence, otherwise nothing is shown
16+
buf.push(c);
1617
const expected = desired[matched];
1718
if(expected == c) {
1819
matched++;

0 commit comments

Comments
 (0)