switching to faster comms
parent
84d24d93a2
commit
bcb240773d
|
|
@ -235,7 +235,9 @@ window.onload = () => {
|
||||||
|
|
||||||
const header = [0xAA, 0x55];
|
const header = [0xAA, 0x55];
|
||||||
const length = payload.length;
|
const length = payload.length;
|
||||||
const message = [...header, commandCode, length, ...payload];
|
const lengthHigh = (length >> 8) & 0xFF;
|
||||||
|
const lengthLow = length & 0xFF;
|
||||||
|
const message = [...header, commandCode, lengthHigh, lengthLow, ...payload];
|
||||||
|
|
||||||
const writer = port.writable.getWriter();
|
const writer = port.writable.getWriter();
|
||||||
await writer.write(new Uint8Array(message));
|
await writer.write(new Uint8Array(message));
|
||||||
|
|
@ -426,7 +428,11 @@ window.onload = () => {
|
||||||
writer.releaseLock();
|
writer.releaseLock();
|
||||||
|
|
||||||
console.log(`Sent chunk: ${filename} offset=${offset} size=${chunkData.length}`);
|
console.log(`Sent chunk: ${filename} offset=${offset} size=${chunkData.length}`);
|
||||||
|
console.log(packet);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("Total animation size:", totalSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue