Rename getProperty to getDeviceProperty and getModuleProperties to getModuleProperty.

This commit is contained in:
László Monda
2017-12-29 13:23:58 +01:00
parent 227f8f0d2c
commit e3c65f77df
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
const uhk = require('./uhk');
const device = uhk.getUhkDevice();
const sendData = new Buffer([uhk.usbCommands.getProperty, uhk.devicePropertyIds.configSizes]);
const sendData = new Buffer([uhk.usbCommands.getDeviceProperty, uhk.devicePropertyIds.configSizes]);
device.write(uhk.getTransferData(sendData));
const response = Buffer.from(device.readSync());
+1 -1
View File
@@ -3,7 +3,7 @@ const uhk = require('./uhk');
const device = uhk.getUhkDevice();
function getModuleState() {
const payload = new Buffer([uhk.usbCommands.getModuleProperties, 1]);
const payload = new Buffer([uhk.usbCommands.getModuleProperty, 1]);
console.log('Sending ', uhk.bufferToString(payload));
device.write(uhk.getTransferData(payload));
const receivedBuffer = device.readSync();
+1 -1
View File
@@ -6,7 +6,7 @@ let counter = 1;
while (true) {
console.log(`hidapi sync test ${counter++}`);
const sendData = new Buffer([uhk.usbCommands.getProperty, uhk.devicePropertyIds.configSizes]);
const sendData = new Buffer([uhk.usbCommands.getDeviceProperty, uhk.devicePropertyIds.configSizes]);
device.write(uhk.getTransferData(sendData));
device.readSync()
}
+1 -1
View File
@@ -10,7 +10,7 @@ let offset = 0;
let configBuffer = new Buffer(0);
let chunkSizeToRead;
const payload = new Buffer([uhk.usbCommands.getProperty, uhk.devicePropertyIds.configSizes]);
const payload = new Buffer([uhk.usbCommands.getDeviceProperty, uhk.devicePropertyIds.configSizes]);
device.write(uhk.getTransferData(payload));
let buffer = Buffer.from(device.readSync());
const hardwareConfigMaxSize = buffer[1] + (buffer[2]<<8);
+2 -2
View File
@@ -62,7 +62,7 @@ exports = module.exports = moduleExports = {
getTransferData,
checkModuleSlot,
usbCommands: {
getProperty : 0x00,
getDeviceProperty : 0x00,
reenumerate : 0x01,
jumpToModuleBootloader : 0x02,
sendKbootCommandToModule: 0x03,
@@ -76,7 +76,7 @@ exports = module.exports = moduleExports = {
getDebugBuffer : 0x0b,
getAdcValue : 0x0c,
setLedPwmBrightness : 0x0d,
getModuleProperties : 0x0e,
getModuleProperty : 0x0e,
},
enumerationModes: {
bootloader: 0,
+1 -1
View File
@@ -23,7 +23,7 @@ let offset = 0;
let configBuffer = fs.readFileSync(configBin);
let chunkSizeToRead;
const payload = new Buffer([uhk.usbCommands.getProperty, uhk.devicePropertyIds.configSizes]);
const payload = new Buffer([uhk.usbCommands.getDeviceProperty, uhk.devicePropertyIds.configSizes]);
device.write(uhk.getTransferData(payload));
let buffer = Buffer.from(device.readSync());