Rename HardwareConfiguration.hardwareId to deviceId and set it to 1 by default.

This commit is contained in:
László Monda
2017-11-09 01:05:42 +01:00
parent fc7840aa24
commit 42e39375d1
2 changed files with 6 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ export class HardwareConfiguration {
dataModelVersion: number; dataModelVersion: number;
@assertUInt8 @assertUInt8
hardwareId: number; deviceId: number;
@assertUInt8 @assertUInt8
brandId: number; brandId: number;
@@ -24,7 +24,7 @@ export class HardwareConfiguration {
fromJsonObject(jsonObject: any): HardwareConfiguration { fromJsonObject(jsonObject: any): HardwareConfiguration {
this.signature = jsonObject.signature; this.signature = jsonObject.signature;
this.dataModelVersion = jsonObject.dataModelVersion; this.dataModelVersion = jsonObject.dataModelVersion;
this.hardwareId = jsonObject.hardwareId; this.deviceId = jsonObject.deviceId;
this.brandId = jsonObject.brandId; this.brandId = jsonObject.brandId;
this.uuid = jsonObject.uuid; this.uuid = jsonObject.uuid;
this.isIso = jsonObject.isIso; this.isIso = jsonObject.isIso;
@@ -35,7 +35,7 @@ export class HardwareConfiguration {
fromBinary(buffer: UhkBuffer): HardwareConfiguration { fromBinary(buffer: UhkBuffer): HardwareConfiguration {
this.signature = buffer.readString(); this.signature = buffer.readString();
this.dataModelVersion = buffer.readUInt16(); this.dataModelVersion = buffer.readUInt16();
this.hardwareId = buffer.readUInt8(); this.deviceId = buffer.readUInt8();
this.uuid = buffer.readUInt32(); this.uuid = buffer.readUInt32();
this.brandId = buffer.readUInt8(); this.brandId = buffer.readUInt8();
this.isIso = buffer.readBoolean(); this.isIso = buffer.readBoolean();
@@ -47,7 +47,7 @@ export class HardwareConfiguration {
return { return {
signature: this.signature, signature: this.signature,
dataModelVersion: this.dataModelVersion, dataModelVersion: this.dataModelVersion,
hardwareId: this.hardwareId, deviceId: this.deviceId,
brandId: this.brandId, brandId: this.brandId,
uuid: this.uuid, uuid: this.uuid,
isIso: this.isIso, isIso: this.isIso,
@@ -58,7 +58,7 @@ export class HardwareConfiguration {
toBinary(buffer: UhkBuffer): void { toBinary(buffer: UhkBuffer): void {
buffer.writeString(this.signature); buffer.writeString(this.signature);
buffer.writeUInt16(this.dataModelVersion); buffer.writeUInt16(this.dataModelVersion);
buffer.writeUInt8(this.hardwareId); buffer.writeUInt8(this.deviceId);
buffer.writeUInt8(this.brandId); buffer.writeUInt8(this.brandId);
buffer.writeUInt32(this.uuid); buffer.writeUInt32(this.uuid);
buffer.writeBoolean(this.isIso); buffer.writeBoolean(this.isIso);

View File

@@ -28,7 +28,7 @@ const hardwareConfig = new HardwareConfiguration();
hardwareConfig.signature = 'UHK'; hardwareConfig.signature = 'UHK';
hardwareConfig.dataModelVersion = 0; hardwareConfig.dataModelVersion = 0;
hardwareConfig.hardwareId = 0; hardwareConfig.deviceId = 1;
hardwareConfig.uuid = uuid; hardwareConfig.uuid = uuid;
hardwareConfig.brandId = 0; hardwareConfig.brandId = 0;
hardwareConfig.isIso = layout === 'iso'; hardwareConfig.isIso = layout === 'iso';