From f61893727534e888cf2143557bf6f143bdd64e60 Mon Sep 17 00:00:00 2001 From: Evgeny S Maksimov Date: Mon, 21 Jan 2019 22:53:22 +0300 Subject: Revert "Fixed two-field parameters" This reverts commit 3a0bcff44aba8b15d97a669dc8c959830644a8bd. --- src/org/traccar/protocol/NavisProtocolDecoder.java | 13 +++++++------ traccar-web | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 93e751012..4e5162b44 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -329,9 +329,6 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); long index = 0; - int status = 0; - short input = 0; - short output = 0; for (int i = 0; i < flexBitfieldDataSize; i++) { if ((flexBitfield[(int) (i / 8)] & (0x80 >> i % 8)) == 0) { @@ -339,6 +336,10 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { continue; } + int status = 0; + short input = 0; + short output = 0; + switch (i) { case 0: index = buf.readUnsignedIntLE(); @@ -360,7 +361,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { break; case 5: int status2 = buf.readUnsignedByte(); - position.set(Position.KEY_STATUS, (short) ((status & 0xFF) | (status2 << 8))); + position.set(Position.KEY_STATUS, (short) ((status & 0xFF) | (status2 << 1))); break; case 6: position.set(Position.KEY_RSSI, buf.readUnsignedByte()); @@ -419,7 +420,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { break; case 29: short input2 = buf.readUnsignedByte(); - position.set(Position.KEY_INPUT, (short) ((input & 0xFF) | (input2 << 8))); + position.set(Position.KEY_INPUT, (short) ((input & 0xFF) | (input2 << 1))); for (int k = 0; k < 8; k++) { position.set(Position.PREFIX_IN + (k + 9), BitUtil.check(input2, k)); } @@ -433,7 +434,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { break; case 31: short output2 = buf.readUnsignedByte(); - position.set(Position.KEY_OUTPUT, (short) ((output & 0xFF) | (output2 << 8))); + position.set(Position.KEY_OUTPUT, (short) ((output & 0xFF) | (output2 << 1))); for (int k = 0; k < 8; k++) { position.set(Position.PREFIX_OUT + (k + 9), BitUtil.check(output2, k)); } diff --git a/traccar-web b/traccar-web index 5d0d92b9a..689d2b691 160000 --- a/traccar-web +++ b/traccar-web @@ -1 +1 @@ -Subproject commit 5d0d92b9a7b3170103aad0d09e21b1239444d249 +Subproject commit 689d2b691829301014e85b5f7ce5804b0649be09 -- cgit v1.2.3