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

View File

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