checkpoint gx util

This commit is contained in:
Stewart Allen 2017-10-12 13:43:24 -04:00
commit 073be5ae61
2 changed files with 29 additions and 32 deletions

View file

@ -224,18 +224,13 @@ class GXSender {
if (len < 4096) {
chunk = Buffer.concat([chunk, new Buffer(4096-len).fill(0)]);
}
// let crc = crc32.unsigned(chunk);
let block = Buffer.concat([
preamble,
uint32b(slice),
uint32b(len),
// length,
uint32b(crc),
chunk
]);
// console.log(block);
// console.log(block.slice(4080));
// console.log(block.length);
ctrl.sendBuffer(block, lines => { console.log(lines) });
}
ctrl.sendCommand("M29", lines => { console.log(lines) }); // end of send
@ -327,6 +322,7 @@ const crc32 = require('buffer-crc32');
const net = require('net');
const fs = require('fs');
if (!module.parent) {
const arg = process.argv.slice(2);
const cmd = arg.shift();
@ -355,3 +351,4 @@ switch (cmd) {
].join("\n"));
break;
}
}

View file

@ -21,7 +21,7 @@
<div class="print-sel">
<table><tr><th>
<button id="print-download">download gcode file</button>
<button id="print-download">download .gcode</button>
<button id="print-serial">use gcode sender</button>
</th></tr></table>
</div>