From e08eba7a56214583f0b513f2dc9c84a8c24721c7 Mon Sep 17 00:00:00 2001 From: MultiMote <contact@mmote.ru> Date: Mon, 21 Oct 2024 14:35:39 +0300 Subject: [PATCH] Temporary use HW and SW version raw values --- src/packets/abstraction.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/packets/abstraction.ts b/src/packets/abstraction.ts index 9800517..b8d813a 100644 --- a/src/packets/abstraction.ts +++ b/src/packets/abstraction.ts @@ -275,6 +275,8 @@ export class Abstraction { const packet = await this.send(PacketGenerator.getPrinterInfo(PrinterInfoType.SoftWareVersion)); Validators.u8ArrayLengthEquals(packet.data, 2); + // todo: find how to determine format + /* let version = 0; const model = this.client.getModelMetadata()?.model; @@ -284,7 +286,9 @@ export class Abstraction { version = (packet.data[0] * 256 + packet.data[1]) / 100.0; } - return version.toFixed(2); + return version.toFixed(2);\ + */ + return `0x${Utils.bufToHex(packet.data, "")}`; } /** May be wrong, version format varies between models */ @@ -292,6 +296,8 @@ export class Abstraction { const packet = await this.send(PacketGenerator.getPrinterInfo(PrinterInfoType.HardWareVersion)); Validators.u8ArrayLengthEquals(packet.data, 2); + // todo: find how to determine format + /* let version = 0; const model = this.client.getModelMetadata()?.model; @@ -302,6 +308,8 @@ export class Abstraction { } return version.toFixed(2); + */ + return `0x${Utils.bufToHex(packet.data, "")}`; } public async setAutoShutDownTime(time: AutoShutdownTime): Promise<void> {