You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/09/09 14:25:23 UTC

[plc4x] branch develop updated: - Fixed an issue when reading floats

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2309ba0  - Fixed an issue when reading floats
2309ba0 is described below

commit 2309ba05246a2614c5f52a85555f5c9597152511
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Sep 9 16:25:15 2020 +0200

    - Fixed an issue when reading floats
---
 .../java/org/apache/plc4x/java/spi/generation/ReadBuffer.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/generation/ReadBuffer.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/generation/ReadBuffer.java
index 041f6d1..be6e30b 100644
--- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/generation/ReadBuffer.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/generation/ReadBuffer.java
@@ -250,10 +250,10 @@ public class ReadBuffer {
                 }
             } else if (bitLength == 32) {
                 byte[] buffer = new byte[4];
-                buffer[0] = bi.readByte(true, 8);
-                buffer[1] = bi.readByte(true, 8);
-                buffer[2] = bi.readByte(true, 8);
-                buffer[3] = bi.readByte(true, 8);
+                buffer[0] = bi.readByte(false, 8);
+                buffer[1] = bi.readByte(false, 8);
+                buffer[2] = bi.readByte(false, 8);
+                buffer[3] = bi.readByte(false, 8);
                 return Float.intBitsToFloat((buffer[0] & 0xff) ^ buffer[1] << 8 ^ buffer[2] << 16 ^ buffer[3] << 24);
             } else {
                 throw new UnsupportedOperationException("unsupported bit length (only 16 and 32 supported)");