From 3679bcc9dc31fbab434f79a71ccb012c53b61c5e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 19 Jun 2024 08:48:44 -0700 Subject: Updated Sucre Lee protocol --- src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java | 5 +++++ src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java index 319349d0e..d088077e2 100644 --- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -1155,6 +1155,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ICCID, ByteBufUtil.hexDump(buf.readSlice(10)).replaceAll("f", "")); return position; + } else if (subType == 0x0b) { + + position.set("networkTechnology", buf.readByte() > 0 ? "4G" : "2G"); + return position; + } else if (subType == 0x0d) { if (buf.getByte(buf.readerIndex()) != '!') { diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java index 32a492df5..aba0a6293 100644 --- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java @@ -17,6 +17,10 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "78780D01086471700328358100093F040D0A")); + verifyAttribute(decoder, binary( + "79790007940B010A0B5ACE0D0A"), + "networkTechnology", "4G"); + verifyAttribute(decoder, binary( "7878293218061301261ccd0274c4ad050d7c960018000a02d4000ac3c70dbdc40b46f004210202af001784290d0a"), "altitude", -31703.0); @@ -29,9 +33,8 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest { "7878281718060e021831c6026e8acc0c361b1000140001cc00286d000f4dbf0000012ca7e001000004b2630d0a"), Position.KEY_DRIVER_UNIQUE_ID, "0000012ca7e00100"); - verifyAttribute(decoder, binary( - "78782732180214123324ca0162bdf0041f45d900190b0a02d4000bc5270000ec025206040202005e07e10d0a"), - Position.KEY_ALARM, Position.ALARM_POWER_CUT); + verifyNotNull(decoder, binary( + "78782732180214123324ca0162bdf0041f45d900190b0a02d4000bc5270000ec025206040202005e07e10d0a")); verifyAttribute(decoder, binary( "78782616170A080C0E24C0027C58AD0C2B8B0100454E0901CC0025030328E7A0005D4B13021EC373170D0A"), -- cgit v1.2.3