Skip to content

Commit

Permalink
chore: release v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinLoeper committed Apr 27, 2021
1 parent 0d8c9ed commit 6383c3d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.4
0.1.0
2 changes: 1 addition & 1 deletion nodejs-client/delimiter_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const sock = new zmq.Subscriber;
let desired = [0x1d, 0x56, 0x31]; // toshiba is set, epson would be: [0x1b, 0x6d]
for await (const [msg] of sock) {
for(const c of msg) {
// console.log(c); // uncomment if you do not know the sequence, otherwise nothing is shown
console.log(c); // uncomment if you do not know the sequence, otherwise nothing is shown
buf.push(c);
const expected = desired[matched];
if(expected == c) {
Expand Down
25 changes: 21 additions & 4 deletions nodejs-client/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
const zmq = require("zeromq");
const msgpack = require('msgpack5')();

const sock = new zmq.Subscriber;

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

for await (const [msg] of sock) {
const msg_decoded = msgpack.decode(msg);
console.log(msg_decoded.d);
for (const c of msg) {
buf.push(c);
console.log(c);
const expected = desired[matched];
if (expected == c) {
matched++;
} else {
matched = 0;
}

if (matched == desired.length) {
console.log("CUT found. Receipt:\n");
console.log(buf.map(s => String.fromCharCode(s)).join(""));
matched = 0;
buf = [];
}
}
}
})();
})();
6 changes: 6 additions & 0 deletions src/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
nesto-usbproxy (0.1.0) main; urgency=medium

* hotpluggin, mweal fixes, greengrass binary

-- Martin Löper <martin.loeper@nesto-software.de> Tue, 27 Apr 2021 11:13:27 +0200

nesto-usbproxy (0.0.4) main; urgency=medium

* Link libzmq dynamically
Expand Down

0 comments on commit 6383c3d

Please sign in to comment.