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

View File

@@ -2,7 +2,7 @@
const uhk = require('./uhk'); const uhk = require('./uhk');
const device = uhk.getUhkDevice(); 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)); device.write(uhk.getTransferData(sendData));
const response = Buffer.from(device.readSync()); const response = Buffer.from(device.readSync());

View File

@@ -3,7 +3,7 @@ const uhk = require('./uhk');
const device = uhk.getUhkDevice(); const device = uhk.getUhkDevice();
function getModuleState() { function getModuleState() {
const payload = new Buffer([uhk.usbCommands.getModuleProperties, 1]); const payload = new Buffer([uhk.usbCommands.getModuleProperty, 1]);
console.log('Sending ', uhk.bufferToString(payload)); console.log('Sending ', uhk.bufferToString(payload));
device.write(uhk.getTransferData(payload)); device.write(uhk.getTransferData(payload));
const receivedBuffer = device.readSync(); const receivedBuffer = device.readSync();

View File

@@ -6,7 +6,7 @@ let counter = 1;
while (true) { while (true) {
console.log(`hidapi sync test ${counter++}`); 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.write(uhk.getTransferData(sendData));
device.readSync() device.readSync()
} }

View File

@@ -10,7 +10,7 @@ let offset = 0;
let configBuffer = new Buffer(0); let configBuffer = new Buffer(0);
let chunkSizeToRead; 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)); device.write(uhk.getTransferData(payload));
let buffer = Buffer.from(device.readSync()); let buffer = Buffer.from(device.readSync());
const hardwareConfigMaxSize = buffer[1] + (buffer[2]<<8); const hardwareConfigMaxSize = buffer[1] + (buffer[2]<<8);

View File

@@ -62,7 +62,7 @@ exports = module.exports = moduleExports = {
getTransferData, getTransferData,
checkModuleSlot, checkModuleSlot,
usbCommands: { usbCommands: {
getProperty : 0x00, getDeviceProperty : 0x00,
reenumerate : 0x01, reenumerate : 0x01,
jumpToModuleBootloader : 0x02, jumpToModuleBootloader : 0x02,
sendKbootCommandToModule: 0x03, sendKbootCommandToModule: 0x03,
@@ -76,7 +76,7 @@ exports = module.exports = moduleExports = {
getDebugBuffer : 0x0b, getDebugBuffer : 0x0b,
getAdcValue : 0x0c, getAdcValue : 0x0c,
setLedPwmBrightness : 0x0d, setLedPwmBrightness : 0x0d,
getModuleProperties : 0x0e, getModuleProperty : 0x0e,
}, },
enumerationModes: { enumerationModes: {
bootloader: 0, bootloader: 0,

View File

@@ -23,7 +23,7 @@ let offset = 0;
let configBuffer = fs.readFileSync(configBin); let configBuffer = fs.readFileSync(configBin);
let chunkSizeToRead; 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)); device.write(uhk.getTransferData(payload));
let buffer = Buffer.from(device.readSync()); let buffer = Buffer.from(device.readSync());