Change the arguments of UsbCommandId_LaunchEepromTransfer and its id to 0x08.
This commit is contained in:
@@ -16,23 +16,21 @@ export enum UsbCommand {
|
||||
WriteHardwareConfig = 0x05,
|
||||
WriteStagingUserConfig = 0x06,
|
||||
ApplyConfig = 0x07,
|
||||
LaunchEepromTransfer = 12,
|
||||
LaunchEepromTransfer = 0x08,
|
||||
GetKeyboardState = 16
|
||||
}
|
||||
|
||||
export enum EepromOperation {
|
||||
read = 0,
|
||||
write = 1
|
||||
}
|
||||
|
||||
export enum ConfigBufferId {
|
||||
hardwareConfig = 0,
|
||||
stagingUserConfig = 1,
|
||||
validatedUserConfig = 2
|
||||
}
|
||||
|
||||
export enum EepromTransfer {
|
||||
ReadHardwareConfig = 0,
|
||||
WriteHardwareConfig = 1,
|
||||
ReadUserConfig = 2,
|
||||
WriteUserConfig = 3
|
||||
}
|
||||
|
||||
export enum SystemPropertyIds {
|
||||
UsbProtocolVersion = 0,
|
||||
BridgeProtocolVersion = 1,
|
||||
|
||||
@@ -2,8 +2,9 @@ import { Device, devices, HID } from 'node-hid';
|
||||
import { LogService } from 'uhk-common';
|
||||
|
||||
import {
|
||||
ConfigBufferId,
|
||||
Constants,
|
||||
EepromTransfer,
|
||||
EepromOperation,
|
||||
enumerationModeIdToProductId,
|
||||
EnumerationModes,
|
||||
KbootCommands,
|
||||
@@ -81,8 +82,12 @@ export class UhkHidDevice {
|
||||
});
|
||||
}
|
||||
|
||||
public async writeConfigToEeprom(transferType: EepromTransfer): Promise<void> {
|
||||
await this.write(new Buffer([UsbCommand.LaunchEepromTransfer, transferType]));
|
||||
public async writeUserConfigToEeprom(): Promise<void> {
|
||||
await this.write(new Buffer([
|
||||
UsbCommand.LaunchEepromTransfer,
|
||||
EepromOperation.write,
|
||||
ConfigBufferId.validatedUserConfig
|
||||
]));
|
||||
await this.waitUntilKeyboardBusy();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as fs from 'fs';
|
||||
import { UhkBlhost } from './uhk-blhost';
|
||||
import { UhkHidDevice } from './uhk-hid-device';
|
||||
import { snooze } from './util';
|
||||
import { convertBufferToIntArray, EepromTransfer, getTransferBuffers, SystemPropertyIds, UsbCommand, ConfigBufferId
|
||||
import { convertBufferToIntArray, getTransferBuffers, SystemPropertyIds, UsbCommand, ConfigBufferId
|
||||
} from '../index';
|
||||
import { LoadConfigurationsResult } from './models/load-configurations-result';
|
||||
|
||||
@@ -153,7 +153,7 @@ export class UhkOperations {
|
||||
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to keyboard');
|
||||
await this.sendUserConfigToKeyboard(json);
|
||||
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to EEPROM');
|
||||
await this.device.writeConfigToEeprom(EepromTransfer.WriteUserConfig);
|
||||
await this.device.writeUserConfigToEeprom();
|
||||
}
|
||||
catch (error) {
|
||||
this.logService.error('[DeviceOperation] Transferring error', error);
|
||||
|
||||
Reference in New Issue
Block a user