Fix script to display the correct firmware version.
This commit is contained in:
@@ -2,14 +2,14 @@
|
|||||||
const uhk = require('./uhk');
|
const uhk = require('./uhk');
|
||||||
|
|
||||||
const device = uhk.getUhkDevice();
|
const device = uhk.getUhkDevice();
|
||||||
const sendData = new Buffer([uhk.usbCommands.getModuleProperty, uhk.modulePropertyIds.protocolVersions]);
|
const sendData = new Buffer([uhk.usbCommands.getModuleProperty, uhk.moduleSlotToId.leftHalf, uhk.modulePropertyIds.protocolVersions]);
|
||||||
console.log(sendData)
|
console.log(sendData)
|
||||||
device.write(uhk.getTransferData(sendData));
|
device.write(uhk.getTransferData(sendData));
|
||||||
const response = Buffer.from(device.readSync());
|
const response = Buffer.from(device.readSync());
|
||||||
console.log(response)
|
console.log(response)
|
||||||
const firmwareMajorVersion = response[7] + (response[8]<<8);
|
const firmwareMajorVersion = uhk.getUint16(response, 8);
|
||||||
const firmwareMinorVersion = response[9] + (response[10]<<8);
|
const firmwareMinorVersion = uhk.getUint16(response, 10);
|
||||||
const firmwarePatchVersion = response[11] + (response[12]<<8);
|
const firmwarePatchVersion = uhk.getUint16(response, 12);
|
||||||
|
|
||||||
console.log(`firmwareMajorVersion: ${firmwareMajorVersion}`);
|
console.log(`firmwareMajorVersion: ${firmwareMajorVersion}`);
|
||||||
console.log(`firmwareMinorVersion: ${firmwareMinorVersion}`);
|
console.log(`firmwareMinorVersion: ${firmwareMinorVersion}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user