Change the value of UsbCommandId_{GetDeviceState,SetTestLed,GetDebugBuffer,GetAdcValue,SetLedPwmBrightness}.

This commit is contained in:
László Monda
2017-12-12 18:49:40 +01:00
parent 6b60241180
commit 2eb31603f1
5 changed files with 13 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ if (responseCode !== 0) {
function waitUntilKeyboardBusy() {
device.write(uhk.getTransferData(new Buffer([uhk.usbCommands.getKeyboardState])));
device.write(uhk.getTransferData(new Buffer([uhk.usbCommands.getDeviceState])));
const keyboardStateBuffer = Buffer.from(device.readSync());
if (keyboardStateBuffer[1] === 1) {

View File

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

View File

@@ -71,11 +71,11 @@ exports = module.exports = moduleExports = {
writeStagingUserConfig : 0x06,
applyConfig : 0x07,
launchEepromTransfer : 0x08,
setTestLed: 0x14,
setLedPwmBrightness: 10,
getAdcValue: 11,
getKeyboardState: 16,
getDebugInfo: 17,
getDeviceState : 0x09,
setTestLed : 0x0a,
getDebugBuffer : 0x0b,
getAdcValue : 0x0c,
setLedPwmBrightness : 0x0d,
},
enumerationModes: {
bootloader: 0,