Extract sendKbootCommandToModule() from send-kboot-command-to-module.js to uhk.js

This commit is contained in:
László Monda
2018-01-30 23:44:25 +01:00
parent 9284ae5032
commit 482cff3d3b
2 changed files with 8 additions and 3 deletions

View File

@@ -196,6 +196,10 @@ function reenumerate(enumerationMode) {
})
};
async function sendKbootCommandToModule(device, kbootCommandId, i2cAddress) {
return await uhk.writeDevice(device, [uhk.usbCommands.sendKbootCommandToModule, kbootCommandId, parseInt(i2cAddress)])
};
uhk = exports = module.exports = moduleExports = {
bufferToString,
getUint16,
@@ -211,6 +215,7 @@ uhk = exports = module.exports = moduleExports = {
execRetry,
updateDeviceFirmware,
reenumerate,
sendKbootCommandToModule,
usbCommands: {
getDeviceProperty : 0x00,
reenumerate : 0x01,