aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/PluginProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
index 0d4ea7139..65de211ac 100644
--- a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
@@ -103,7 +103,7 @@ public class PluginProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_ODOMETER, (long) (parser.nextDouble() * 1000));
- int status = parser.nextInt();
+ long status = parser.nextLong();
position.setValid(BitUtil.check(status, 0));
position.set(Position.KEY_IGNITION, BitUtil.check(status, 1));
for (int i = 0; i < 4; i++) {
diff --git a/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java
index 05f97e312..2d134d967 100644
--- a/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class PluginProtocolDecoderTest extends ProtocolTest {
var decoder = new PluginProtocolDecoder(null);
+ verifyPosition(decoder, text(
+ "$$STATUS,000000900005,20210521111252,27.171105,-25.600934,62.0,323,0,-1,2,0.000,2147489155,0.00,0,0,0.0,0.0,0,0,0,0,0,0,0,0,0"));
+
verifyAttribute(decoder, text(
"$$STATUS,60925,20190829123115,28.254151,-25.860605,0.0,0,0,-1,2,0.000,13699,0.00,0,0,28.4,23.4,0,0,0,0,0,0,0,0,0"),
Position.PREFIX_TEMP + 1, 28.4);