From 3e91e9deb7cceda7b9d83fe2fae3d8ee063786cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurij=20Podgor=C5=A1ek?= Date: Mon, 23 Sep 2024 19:17:16 +0200 Subject: [PATCH] Mark problem --- SLIPDecoder.sc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SLIPDecoder.sc b/SLIPDecoder.sc index 5d28a03..11c172a 100644 --- a/SLIPDecoder.sc +++ b/SLIPDecoder.sc @@ -33,8 +33,9 @@ SLIPDecoder { ^((byteArr[0] << 24) + (byteArr[1] << 16) + (byteArr[2] << 8) + byteArr[3]); } + // @TODO this is wrong! readFloat32 { |byteArr| - ^Float.from32Bits(this.readInt32(byteArr)); + ^Float.from32Bits((byteArr[0] << 24) + (byteArr[1] << 16) + (byteArr[2] << 8) + byteArr[3]); } // Read byte array 4 bytes at a time, return on null termination or if end of buffer reached @@ -213,6 +214,7 @@ SLIPDecoder { this.traceMsg("Stopping..."); running = false; port.close; + port.free; this.reader.free; } }