diff options
author | Anton Tananaev <anton@traccar.org> | 2023-12-16 07:48:13 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-12-16 07:48:13 -0800 |
commit | 4dc2e86ae5e403143b3c4e2c1a3bd671dfeaf5f8 (patch) | |
tree | 857bc0ccf91e7376715ecbe08d2fed84e2c1d9da /src | |
parent | fa71241a3c93f1210e5f30fc4195477ad35986ae (diff) | |
download | trackermap-server-4dc2e86ae5e403143b3c4e2c1a3bd671dfeaf5f8.tar.gz trackermap-server-4dc2e86ae5e403143b3c4e2c1a3bd671dfeaf5f8.tar.bz2 trackermap-server-4dc2e86ae5e403143b3c4e2c1a3bd671dfeaf5f8.zip |
Better Suntech driver id support
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java | 3 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java index 86a8bf6fe..53c4a5d02 100644 --- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java @@ -454,9 +454,10 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { if (values.length - index >= 2) { String driverUniqueId = values[index++]; - if (values[index++].equals("1") && !driverUniqueId.isEmpty()) { + if (!driverUniqueId.isEmpty()) { position.set(Position.KEY_DRIVER_UNIQUE_ID, driverUniqueId); } + index += 1; // registered } if (isIncludeTemp(deviceSession.getDeviceId())) { diff --git a/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java index 22afe559a..d656bba13 100644 --- a/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/SuntechProtocolDecoderTest.java @@ -293,6 +293,12 @@ public class SuntechProtocolDecoderTest extends ProtocolTest { "ST300HTE;100850001;04;248;20110101;00:13:52;167559;12.28;004005;0.0;1;0;3;3;0;-22.881018;-047.070831;-22.881018;-047.070831;000.000;000.000;0;0;3;0;0;0;01E04D44160000"), Position.KEY_DRIVER_UNIQUE_ID, "01E04D44160000"); + decoder.setHbm(true); + + verifyAttribute(decoder, buffer( + "ST300STT;807469112;45;315;20231215;15:25:03;104147;-16.030168;-047.989150;000.000;000.00;19;1;8600;12.14;000010;1;0456;000373;4.1;1;01B54221010000;0"), + Position.KEY_DRIVER_UNIQUE_ID, "01B54221010000"); + } } |