Skip to content

Commit 0faee2f

Browse files
committed
Merge branch 'master' of github.com:UltimateHackingKeyboard/agent
2 parents 1c9123b + 5cc9850 commit 0faee2f

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

packages/uhk-agent/src/services/device.service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import {
1414
convertBleStringToNumberArray,
1515
CurrentlyUpdatingModuleInfo,
1616
DeviceConnectionState,
17-
disableAgentUpgradeProtection,
1817
findUhkModuleById,
1918
FIRMWARE_UPGRADE_METHODS,
20-
FirmwareUpgradeFailReason,
2119
FirmwareUpgradeIpcResponse,
2220
getHardwareConfigFromDeviceResponse,
2321
getUserConfigFromDeviceResponse,
@@ -107,7 +105,6 @@ export class DeviceService {
107105
private _pollerAllowed: boolean;
108106
private _uhkDevicePolling: boolean;
109107
private _checkStatusBuffer: boolean;
110-
private disableAgentUpgrade = false;
111108
private dongleZephyrLogService: ZephyrLogService;
112109
private leftHalfZephyrLogService: ZephyrLogService;
113110
private queueManager = new QueueManager();
@@ -123,8 +120,6 @@ export class DeviceService {
123120
private options: CommandLineArgs,
124121
private rootDir: string
125122
) {
126-
this.disableAgentUpgrade = disableAgentUpgradeProtection(this.options);
127-
128123
this.dongleZephyrLogService = new ZephyrLogService({
129124
cliArgs: this.options,
130125
currentDeviceFn: getCurrentUhkDongleHID,

packages/uhk-common/src/config-serializer/config-items/user-configuration.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ export class UserConfiguration implements MouseSpeedConfiguration {
180180
this.userConfigMinorVersion = jsonObject.userConfigMinorVersion;
181181
this.userConfigPatchVersion = jsonObject.userConfigPatchVersion;
182182

183-
if (this.userConfigMajorVersion >= 13) {
184-
this.lastSaveAgentTag = jsonObject.lastSaveAgentTag ;
185-
this.lastSaveFirmwareTag = jsonObject.lastSaveFirmwareTag;
186-
}
187-
188183
switch (this.userConfigMajorVersion) {
189184
case 1:
190185
case 2:
@@ -244,11 +239,6 @@ export class UserConfiguration implements MouseSpeedConfiguration {
244239
this.userConfigMinorVersion = buffer.readUInt16();
245240
this.userConfigPatchVersion = buffer.readUInt16();
246241

247-
if (this.userConfigMajorVersion >= 13) {
248-
this.lastSaveAgentTag = buffer.readString();
249-
this.lastSaveFirmwareTag = buffer.readString();
250-
}
251-
252242
switch (this.userConfigMajorVersion) {
253243
case 1:
254244
case 2:
@@ -415,8 +405,6 @@ export class UserConfiguration implements MouseSpeedConfiguration {
415405
buffer.writeUInt16(this.userConfigMajorVersion);
416406
buffer.writeUInt16(this.userConfigMinorVersion);
417407
buffer.writeUInt16(this.userConfigPatchVersion);
418-
buffer.writeString(this.lastSaveAgentTag);
419-
buffer.writeString(this.lastSaveFirmwareTag);
420408
buffer.writeUInt32(this.userConfigurationLength);
421409
buffer.writeString(this.deviceName);
422410
buffer.writeUInt16(this.doubleTapSwitchLayerTimeout);
@@ -476,6 +464,8 @@ export class UserConfiguration implements MouseSpeedConfiguration {
476464
buffer.writeArray(this.keymaps, (uhkBuffer: UhkBuffer, keymap: Keymap) => {
477465
keymap.toBinary(uhkBuffer, this.getSerialisationInfo(), this);
478466
});
467+
buffer.writeString(this.lastSaveAgentTag);
468+
buffer.writeString(this.lastSaveFirmwareTag);
479469
}
480470

481471
toString(): string {
@@ -819,6 +809,12 @@ export class UserConfiguration implements MouseSpeedConfiguration {
819809
return macro;
820810
});
821811
this.keymaps = buffer.readArray<Keymap>(uhkBuffer => new Keymap().fromBinary(uhkBuffer, this.macros, serialisationInfo));
812+
813+
if (this.userConfigMajorVersion >= 13) {
814+
this.lastSaveAgentTag = buffer.readString();
815+
this.lastSaveFirmwareTag = buffer.readString();
816+
}
817+
822818
ConfigSerializer.resolveSwitchKeymapActions(this.keymaps);
823819

824820
}
@@ -1096,6 +1092,11 @@ export class UserConfiguration implements MouseSpeedConfiguration {
10961092
this.keymaps = jsonObject.keymaps.map((keymap: any) => {
10971093
return new Keymap().fromJsonObject(keymap, this.macros, serialisationInfo);
10981094
});
1095+
1096+
if (this.userConfigMajorVersion >= 13) {
1097+
this.lastSaveAgentTag = jsonObject.lastSaveAgentTag ;
1098+
this.lastSaveFirmwareTag = jsonObject.lastSaveFirmwareTag;
1099+
}
10991100
}
11001101

11011102
private migrateToV5(): boolean {

0 commit comments

Comments
 (0)