From 181500ad0f678c859b3171fce5b6f7ee7ad71b2a Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sat, 25 Nov 2023 09:42:11 -0600 Subject: [PATCH] fix auxtime parsing --- packages/lib/index.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/lib/index.js b/packages/lib/index.js index 1fa8a19..06e19f4 100644 --- a/packages/lib/index.js +++ b/packages/lib/index.js @@ -88,17 +88,8 @@ class Console { this.state.time.display += `.${this.state.time.tenths}`; } - this.state.auxTime.seconds = this.currentBuffer.hex.substring(16, 18); - if (this.state.auxTime.seconds === 'aa') { - this.state.auxTime.seconds = '00'; - } - - this.state.auxTime.tenths = this.currentBuffer.hex.substring(19, 20); - if (this.state.auxTime.tenths === 'a') { - this.state.auxTime.tenths = '0'; - } - - this.state.auxTime.display = `${this.state.auxTime.seconds}.${this.state.auxTime.tenths}`; + this.state.auxTime = this.currentBuffer.buffer.subarray(8, 9).toString('hex'); + this.state.aux2Time = this.currentBuffer.buffer.subarray(9, 10).toString('hex'); const hornBinaryFlags = this.currentBuffer.buffer.at(4).toString(2).padStart(8, '0'); this.state.horn = hornBinaryFlags[0] === '1';