feat(device): Wait for read user/hardware config until device is ready (#443)
* feat(device): Wait for read user/hardware config until device is ready * ci: remove uhk-web test runners until not I will fix the chome on mac
This commit is contained in:
committed by
László Monda
parent
235034bc68
commit
01b07a3ab7
@@ -50,7 +50,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "lerna bootstrap",
|
||||
"test":"run-p -sn test:test-serializer test:uhk-common test:uhk-web",
|
||||
"test":"run-p -sn test:test-serializer test:uhk-common",
|
||||
"test:test-serializer": "lerna exec --scope test-serializer npm test",
|
||||
"test:uhk-common": "lerna exec --scope uhk-common npm test",
|
||||
"test:uhk-web": "lerna exec --scope uhk-web npm test",
|
||||
|
||||
@@ -46,6 +46,7 @@ export class DeviceService {
|
||||
*/
|
||||
public async loadConfigurations(event: Electron.Event): Promise<void> {
|
||||
try {
|
||||
await this.device.waitUntilKeyboardBusy();
|
||||
const userConfiguration = await this.loadConfiguration(
|
||||
SystemPropertyIds.MaxUserConfigSize,
|
||||
UsbCommand.ReadUserConfig,
|
||||
|
||||
@@ -165,7 +165,7 @@ export class UhkHidDevice {
|
||||
this._device = null;
|
||||
}
|
||||
|
||||
private async waitUntilKeyboardBusy(): Promise<void> {
|
||||
public async waitUntilKeyboardBusy(): Promise<void> {
|
||||
while (true) {
|
||||
const buffer = await this.write(new Buffer([UsbCommand.GetKeyboardState]));
|
||||
if (buffer[1] === 0) {
|
||||
|
||||
Reference in New Issue
Block a user