aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java')
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java87
1 files changed, 80 insertions, 7 deletions
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index b65b6709e..9b196e501 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -1,6 +1,6 @@
package org.traccar.protocol;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;
import org.traccar.model.Position;
@@ -9,7 +9,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
- var decoder = new Gt06ProtocolDecoder(null);
+ var decoder = inject(new Gt06ProtocolDecoder(null));
verifyNull(decoder, binary(
"787805120099abec0d0a"));
@@ -18,6 +18,78 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
+ "78785995ffff01170719152013df0163d45f041ee52018be002f00876900004556454e545f3836323739383035303137353131325f30303030303030305f323032335f30375f32355f31385f33325f30355f31342e6d70340119d15a0d0a"),
+ Position.KEY_EVENT, 0x69);
+
+ verifyAttribute(decoder, binary(
+ "787829a01707150f2d0ecd01635100041e96d000087c02d4020000912e000000000718798d000e0006ed3ce50d0a"),
+ Position.KEY_IGNITION, false);
+
+ verifyNotNull(decoder, binary(
+ "787829a0170704112226cf0163fe7c0420f6f000091302d402000091290000000007186b8f01030001460d010d0a"));
+
+ verifyAttribute(decoder, binary(
+ "797900109b0344373532304136320d0a000f87f00d0a"),
+ Position.KEY_RESULT, "D7520A62");
+
+ verifyAttribute(decoder, binary(
+ "7878241617070a150e24ca01fba0040780e177005c0001720253360027db6204e40400004bf1e90d0a"),
+ Position.KEY_ALARM, Position.ALARM_SOS);
+
+ verifyAttribute(decoder, binary(
+ "78780a130604ea04000006bc8a0d0a"),
+ Position.KEY_POWER, null);
+
+ verifyAttributes(decoder, binary(
+ "797900849404414c4d313d43353b414c4d323d43433b414c4d333d35433b535441313d43303b4459443d30313b534f533d303133323838333730302c2c3b43454e5445523d303133323838333730303b46454e43453d46656e63652c4f46462c302c302e3030303030302c302e3030303030302c3330302c494e206f72204f55542c313b00b79d120d0a"));
+
+ verifyAttribute(decoder, binary(
+ "78782912170316053b3bcf015b51220af1201105d56100000000000000000000869c0130010000000238d1af0d0a"),
+ Position.KEY_DRIVING_TIME, 0);
+
+ verifyAttribute(decoder, binary(
+ "78781219012ed042cc00954d00040419000056fe290d0a"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
+ verifyAttribute(decoder, binary(
+ "78782DA4150817073B10CF032EEA9C0B6CE0800015141001CC0100009A00000000000A6F24014605041900FF01908A640D0A"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
+ verifyAttribute(decoder, binary(
+ "78782627100419092D07C5027AC91C0C4658000005370900000000000000008002001900FF00004DF60D0A"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
+ verifyPosition(decoder, binary(
+ "78781511170103100e1f9904efe30400a97f88003410ffdd000d0a"));
+
+ verifyAttribute(decoder, binary(
+ "787819a5012ed0000075df000000000098661502050413000019a12b0d0a"),
+ Position.KEY_ALARM, Position.ALARM_TAMPERING);
+
+ verifyAttribute(decoder, binary(
+ "7878131302801900002e42016f000000003a0177ef180d0a"),
+ Position.KEY_POWER, 3.67);
+
+ verifyAttribute(decoder, binary(
+ "78782526160913063918c002780fab0c44750f00040008027f14084c0038420600030c020007398e0d0a"),
+ Position.KEY_ALARM, Position.ALARM_TAMPERING);
+
+ verifyAttribute(decoder, binary(
+ "7979000d940516090908081c030defbd2d0d0a"),
+ Position.KEY_DOOR, true);
+
+ verifyAttribute(decoder, binary(
+ "78782516160908063736c0006e70110442fc800000000800000000000000000300002512000473fb0d0a"),
+ Position.KEY_ALARM, Position.ALARM_TAMPERING);
+
+ verifyPosition(decoder, binary(
+ "78782e2416061a103600c80275298404a0a24000184602d4023a49006f060104ed01940000086508004139765000be7d640d0a"));
+
+ verifyAttribute(decoder, binary(
+ "79790019941b524649443a3030384642324245424133390d0a000c14930d0a"),
+ "serial", "RFID:008FB2BEBA39");
+
+ verifyAttribute(decoder, binary(
"7878241216040e102c22cf00915ffb04c6016300195a02d402283b00753f400571040001dda4880d0a"),
Position.KEY_IGNITION, false);
@@ -54,8 +126,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"7878281520000000003c49434349443a38393838323339303030303039373330323635303e00020d446f260d0a"),
Position.KEY_ICCID, "89882390000097302650");
- verifyNull(decoder, binary(
- "797900099b0380d600046f91e90d0a"));
+ verifyAttribute(decoder, binary(
+ "797900099b0380d600046f91e90d0a"),
+ Position.KEY_RESULT, "80d600");
verifyNull(decoder, binary(
"797900a56615010d081f3b012c323131303d30303033643238342c323130353d30303030316332302c323130623d30303030326537632c323130633d30303033643238342c323130663d30303030306331632c323130643d30303030323166632c323161363d30303030303030302c323130343d30303030306531302c323132663d30303030303030302c323134353d30303030303030302ccb03851f5f03c020525514a7003e216a0d0a"));
@@ -68,7 +141,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyAttribute(decoder, binary(
"7979000E9B0332382E33A1E60D0A0289BE490D0A"),
- Position.PREFIX_TEMP + 1, 28.3);
+ Position.KEY_RESULT, "32382e33a1e60d0a");
verifyPosition(decoder, binary(
"7878353714080d05000ac500a886eb0b7522f000100001fe0a05ea004f1b000001002e0400002328003b0217c0003c0401020001002c468a0d0a"));
@@ -111,7 +184,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyAttribute(decoder, binary(
"797900149b03023539303042343843454238410300139ba40d0a"),
- Position.KEY_DRIVER_UNIQUE_ID, "5900B48CEB");
+ Position.KEY_RESULT, "0235393030423438434542384103");
verifyPosition(decoder, binary(
"787821121303120b2524c70138e363085b549003d43301940057d200cd52c000006aa1ca0d0a"));
@@ -144,7 +217,7 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyAttributes(decoder, binary(
"79790008940000ed0289d6860d0a"));
- verifyNull(decoder, binary(
+ verifyAttributes(decoder, binary(
"797900a59404414c4d313d34353b414c4d323d44353b414c4d333d35353b535441313d34303b4459443d30313b534f533d303538353036313536372c2c3b43454e5445523d3b46454e43453d46656e63652c4f46462c302c302e3030303030302c302e3030303030302c3330302c494e206f72204f55542c303b49434349443d38393937313033313031303038393539303432463b4d4f44453d4d4f44452c312c3138303b0008f65e0d0a"));
verifyPosition(decoder, binary(