Skip to content

Commit 6383c3d

Browse files
committed
chore: release v0.1.0
1 parent 0d8c9ed commit 6383c3d

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.4
1+
0.1.0

nodejs-client/delimiter_example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const sock = new zmq.Subscriber;
1212
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-
// console.log(c); // uncomment if you do not know the sequence, otherwise nothing is shown
15+
console.log(c); // uncomment if you do not know the sequence, otherwise nothing is shown
1616
buf.push(c);
1717
const expected = desired[matched];
1818
if(expected == c) {

nodejs-client/index.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
const zmq = require("zeromq");
2-
const msgpack = require('msgpack5')();
32

43
const sock = new zmq.Subscriber;
54

65
(async function() {
76
sock.connect("tcp://127.0.0.1:5678");
87
sock.subscribe();
98
console.log("Subscriber connected to port 5678");
9+
let buf = [];
10+
let matched = 0;
11+
let desired = [0x1b, 0x6d]; // ESC/P cut sequence
1012

1113
for await (const [msg] of sock) {
12-
const msg_decoded = msgpack.decode(msg);
13-
console.log(msg_decoded.d);
14+
for (const c of msg) {
15+
buf.push(c);
16+
console.log(c);
17+
const expected = desired[matched];
18+
if (expected == c) {
19+
matched++;
20+
} else {
21+
matched = 0;
22+
}
23+
24+
if (matched == desired.length) {
25+
console.log("CUT found. Receipt:\n");
26+
console.log(buf.map(s => String.fromCharCode(s)).join(""));
27+
matched = 0;
28+
buf = [];
29+
}
30+
}
1431
}
15-
})();
32+
})();

src/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
nesto-usbproxy (0.1.0) main; urgency=medium
2+
3+
* hotpluggin, mweal fixes, greengrass binary
4+
5+
-- Martin Löper <[email protected]> Tue, 27 Apr 2021 11:13:27 +0200
6+
17
nesto-usbproxy (0.0.4) main; urgency=medium
28

39
* Link libzmq dynamically

0 commit comments

Comments
 (0)