From a3f3dc673e20b175f9cd6e1548742c6c80038c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Farkas?= Date: Sun, 12 Mar 2017 17:32:46 +0100 Subject: [PATCH] Add uuid to Hardware configuration Closes #267 --- .../config-items/HardwareConfiguration.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shared/src/config-serializer/config-items/HardwareConfiguration.ts b/shared/src/config-serializer/config-items/HardwareConfiguration.ts index d76bd1d5..439ccfa6 100644 --- a/shared/src/config-serializer/config-items/HardwareConfiguration.ts +++ b/shared/src/config-serializer/config-items/HardwareConfiguration.ts @@ -1,4 +1,4 @@ -import { assertUInt8 } from '../assert'; +import { assertUInt8, assertUInt32 } from '../assert'; import { UhkBuffer } from '../UhkBuffer'; export class HardwareConfiguration { @@ -14,6 +14,9 @@ export class HardwareConfiguration { @assertUInt8 brandId: number; + @assertUInt32 + uuid: number; + isIso: boolean; hasBacklighting: boolean; @@ -23,6 +26,7 @@ export class HardwareConfiguration { this.dataModelVersion = jsonObject.dataModelVersion; this.hardwareId = jsonObject.hardwareId; this.brandId = jsonObject.brandId; + this.uuid = jsonObject.uuid; this.isIso = jsonObject.isIso; this.hasBacklighting = jsonObject.hasBacklighting; return this; @@ -32,6 +36,7 @@ export class HardwareConfiguration { this.signature = buffer.readString(); this.dataModelVersion = buffer.readUInt16(); this.hardwareId = buffer.readUInt8(); + this.uuid = buffer.readUInt32(); this.brandId = buffer.readUInt8(); this.isIso = buffer.readBoolean(); this.hasBacklighting = buffer.readBoolean(); @@ -44,6 +49,7 @@ export class HardwareConfiguration { dataModelVersion: this.dataModelVersion, hardwareId: this.hardwareId, brandId: this.brandId, + uuid: this.uuid, isIso: this.isIso, hasBacklighting: this.hasBacklighting }; @@ -54,6 +60,7 @@ export class HardwareConfiguration { buffer.writeUInt16(this.dataModelVersion); buffer.writeUInt8(this.hardwareId); buffer.writeUInt8(this.brandId); + buffer.writeUInt32(this.uuid); buffer.writeBoolean(this.isIso); buffer.writeBoolean(this.hasBacklighting); }