aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-01 20:46:28 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-01 20:46:28 -0700
commit5606f054244fc1ea2d5929152dd5c997d04f66fa (patch)
treee7a55159b1497aa2aa145844276354eb062b771b
parente4134911f17cbe6f556a8bc4d1b3f5073474a940 (diff)
downloadtrackermap-server-5606f054244fc1ea2d5929152dd5c997d04f66fa.tar.gz
trackermap-server-5606f054244fc1ea2d5929152dd5c997d04f66fa.tar.bz2
trackermap-server-5606f054244fc1ea2d5929152dd5c997d04f66fa.zip
Support binary Atrack motion
-rw-r--r--src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java5
-rw-r--r--src/test/java/org/traccar/protocol/AtrackProtocolDecoderTest.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
index 8896dcfb0..834f4f16c 100644
--- a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2024 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -325,6 +325,9 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
case "SA":
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
break;
+ case "MT":
+ position.set(Position.KEY_MOTION, buf.readUnsignedByte() > 0);
+ break;
case "MV":
position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.1);
break;
diff --git a/src/test/java/org/traccar/protocol/AtrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/AtrackProtocolDecoderTest.java
index be6fb5c45..7115e0ea6 100644
--- a/src/test/java/org/traccar/protocol/AtrackProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/AtrackProtocolDecoderTest.java
@@ -44,6 +44,9 @@ public class AtrackProtocolDecoderTest extends ProtocolTest {
decoder.setCustom(true);
verifyPositions(decoder, binary(
+ "405064e503092d8600000000000f54ab660786b0660786b0660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f002800660786ec660786ec660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f0028006607872866078728660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f0028006607876466078764660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f002800660787a0660787a0660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f002800660787dc660787dc660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f0028006607881866078818660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f0028006607885466078854660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f0028006607889066078890660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f002800660788cc660788cc660a12c4fa2e202d01cfd32a005a02000022b700060000000000000007d007d000254349254d56254256254d5400007f0028006607890866078908660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f0028006607894466078944660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f0028006607898066078980660a12c4fa2e202d01cfd32a005a02000022b700070000000000000007d007d000254349254d56254256254d5400007f002800"));
+
+ verifyPositions(decoder, binary(
"4050d78502e01d29000312fa45441d6d647d8e67647d8e67647eef190205437c021846e6001a020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010c0000000000000000000000000000000000000000000000000e647d8e85647d8e86647eef190205437c021846e60019020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010c0000000000000000000000000000000000000000000000000e647d8ea3647d8ea4647eef190205437c021846e60019020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010b0000000000000000000000000000000000000000000000000e647d8ec1647d8ec2647eef190205437c021846e60019020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010a0000000000000000000000000000000000000000000000000e647d8edf647d8ee0647eef190205437c021846e60019020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010a0000000000000000000000000000000000000000000000000e647d8efd647d8efe647eef190205437c021846e60019020002d7f000070000000000000007d007d000254349254d5625525025564e254d4625454c25545225455425464c254d4c25464325534d25494e3025484125484225484325415400010a0000000000000000000000000000000000000000000000000e"));
verifyPositions(decoder, binary(