Change the arguments of UsbCommandId_LaunchEepromTransfer and its id to 0x08.

This commit is contained in:
László Monda
2017-12-12 03:26:57 +01:00
parent c296e6f49b
commit 6b60241180
6 changed files with 50 additions and 27 deletions
+3 -3
View File
@@ -2,15 +2,15 @@
const uhk = require('./uhk');
const eepromTransferType = process.argv[2];
const eepromTransferId = uhk.eepromTransfer[eepromTransferType];
const eepromTransfer = uhk.eepromTransfer[eepromTransferType];
if (eepromTransferId === undefined) {
if (eepromTransfer === undefined) {
console.error(`Gotta provide one of ${Object.keys(uhk.eepromTransfer).join(', ')}`);
process.exit(1);
}
const device = uhk.getUhkDevice();
device.write(uhk.getTransferData(new Buffer([uhk.usbCommands.launchEepromTransferLegacy, eepromTransferId])));
device.write(uhk.getTransferData(new Buffer([uhk.usbCommands.launchEepromTransfer, eepromTransfer.operation, eepromTransfer.configBuffer])));
const buffer = Buffer.from(device.readSync());
const responseCode = buffer[0];
if (responseCode !== 0) {