Change the value of UsbCommandId_{GetDeviceState,SetTestLed,GetDebugBuffer,GetAdcValue,SetLedPwmBrightness}.
This commit is contained in:
@@ -17,7 +17,11 @@ export enum UsbCommand {
|
||||
WriteStagingUserConfig = 0x06,
|
||||
ApplyConfig = 0x07,
|
||||
LaunchEepromTransfer = 0x08,
|
||||
GetKeyboardState = 16
|
||||
GetDeviceState = 0x09,
|
||||
SetTestLed = 0x0a,
|
||||
GetDebugBuffer = 0x0b,
|
||||
GetAdcValue = 0x0c,
|
||||
SetLedPwmBrightness = 0x0d
|
||||
}
|
||||
|
||||
export enum EepromOperation {
|
||||
|
||||
@@ -106,7 +106,7 @@ export class UhkHidDevice {
|
||||
|
||||
public async waitUntilKeyboardBusy(): Promise<void> {
|
||||
while (true) {
|
||||
const buffer = await this.write(new Buffer([UsbCommand.GetKeyboardState]));
|
||||
const buffer = await this.write(new Buffer([UsbCommand.GetDeviceState]));
|
||||
if (buffer[1] === 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user