Merge branch 'finalize-usb-protocol'
This commit is contained in:
@@ -82,12 +82,8 @@ export class UhkHidDevice {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async writeUserConfigToEeprom(): Promise<void> {
|
public async writeConfigToEeprom(configBufferId: ConfigBufferId): Promise<void> {
|
||||||
await this.write(new Buffer([
|
await this.write(new Buffer([UsbCommand.LaunchEepromTransfer, EepromOperation.write, configBufferId]));
|
||||||
UsbCommand.LaunchEepromTransfer,
|
|
||||||
EepromOperation.write,
|
|
||||||
ConfigBufferId.validatedUserConfig
|
|
||||||
]));
|
|
||||||
await this.waitUntilKeyboardBusy();
|
await this.waitUntilKeyboardBusy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export class UhkOperations {
|
|||||||
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to keyboard');
|
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to keyboard');
|
||||||
await this.sendUserConfigToKeyboard(json);
|
await this.sendUserConfigToKeyboard(json);
|
||||||
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to EEPROM');
|
this.logService.debug('[DeviceOperation] USB[T]: Write user configuration to EEPROM');
|
||||||
await this.device.writeUserConfigToEeprom();
|
await this.device.writeConfigToEeprom(ConfigBufferId.validatedUserConfig);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
this.logService.error('[DeviceOperation] Transferring error', error);
|
this.logService.error('[DeviceOperation] Transferring error', error);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
const {HardwareConfiguration, UhkBuffer} = require('uhk-common');
|
const {HardwareConfiguration, UhkBuffer} = require('uhk-common');
|
||||||
const {EepromTransfer, getTransferBuffers, UhkHidDevice, UsbCommand} = require('uhk-usb');
|
const {EepromTransfer, getTransferBuffers, ConfigBufferId, UhkHidDevice, UsbCommand} = require('uhk-usb');
|
||||||
const Logger = require('./logger');
|
const Logger = require('./logger');
|
||||||
|
|
||||||
if (process.argv.length < 2) {
|
if (process.argv.length < 2) {
|
||||||
@@ -40,7 +40,7 @@ async function writeHca() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.debug('USB[T]: Write hardware configuration to EEPROM');
|
logger.debug('USB[T]: Write hardware configuration to EEPROM');
|
||||||
await device.writeConfigToEeprom(EepromTransfer.WriteHardwareConfig);
|
await device.writeConfigToEeprom(ConfigBufferId.hardwareConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeHca()
|
writeHca()
|
||||||
|
|||||||
Reference in New Issue
Block a user