Use uhk.writeDevice() in jump-to-module-bootloader.js

This commit is contained in:
László Monda
2018-01-31 00:09:16 +01:00
parent 482cff3d3b
commit 739b830f47

View File

@@ -9,6 +9,7 @@ program
const moduleSlot = program.args[0]; const moduleSlot = program.args[0];
const moduleSlotId = uhk.checkModuleSlot(moduleSlot, uhk.moduleSlotToId); const moduleSlotId = uhk.checkModuleSlot(moduleSlot, uhk.moduleSlotToId);
const device = uhk.getUhkDevice(); const device = uhk.getUhkDevice();
let transfer = new Buffer([uhk.usbCommands.jumpToModuleBootloader, moduleSlotId]);
device.write(uhk.getTransferData(transfer)); (async function() {
const response = Buffer.from(device.readSync()); await uhk.writeDevice(device, [uhk.usbCommands.jumpToModuleBootloader, moduleSlotId]);
})();