|
@@ -1,7 +1,6 @@
|
|
|
"use strict";
|
|
|
|
|
|
const SerialPort = require("serialport").SerialPort;
|
|
|
-const bufferpack = require("bufferpack");
|
|
|
const slip = require("./streams/slip");
|
|
|
|
|
|
|
|
@@ -9,12 +8,6 @@ const slip = require("./streams/slip");
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-const BOOTLOADER_HEADER_SIZE = 8;
|
|
|
-const formats = {
|
|
|
- bootloader_packet_header: "<B(direction)B(command)H(size)I(checksum)"
|
|
|
-};
|
|
|
-
|
|
|
const commands = {
|
|
|
CMD0: 0x00,
|
|
|
CMD1: 0x01,
|
|
@@ -36,10 +29,6 @@ function commandToKey(command) {
|
|
|
return Object.keys(commands).find((key) => commands[key] === command);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
const SYNC_FRAME = new Buffer([0x07, 0x07, 0x12, 0x20,
|
|
|
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|
|
|
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
|