aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-01-06 19:44:12 -0800
committerAnton Tananaev <anton@traccar.org>2023-01-06 19:44:12 -0800
commitc6e7f17791f5721c994128c8165c71bcb40a02fb (patch)
tree77706ca1c06f6a414e2539233912f808f4d5a3bb /src/main
parentc1cbda022e33d56e9f77a9e26da59e88061c469f (diff)
downloadtrackermap-server-c6e7f17791f5721c994128c8165c71bcb40a02fb.tar.gz
trackermap-server-c6e7f17791f5721c994128c8165c71bcb40a02fb.tar.bz2
trackermap-server-c6e7f17791f5721c994128c8165c71bcb40a02fb.zip
Fix TLT2H LBS decoding
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
index 7976b825f..e85bdf9b3 100644
--- a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2022 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.
@@ -191,25 +191,14 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
DateBuilder dateBuilder = new DateBuilder()
.setTime(parser.nextInt(), parser.nextInt(), parser.nextInt());
- boolean isPositionValid = parser.next().equals("A");
- position.setValid(isPositionValid);
-
- if (isPositionValid) {
- position.setLatitude(parser.nextCoordinate());
- position.setLongitude(parser.nextCoordinate());
- position.setSpeed(parser.nextDouble(0));
- position.setCourse(parser.nextDouble(0));
- } else {
- parser.skip(8);
- }
+ position.setValid(parser.next().equals("A"));
+ position.setLatitude(parser.nextCoordinate());
+ position.setLongitude(parser.nextCoordinate());
+ position.setSpeed(parser.nextDouble(0));
+ position.setCourse(parser.nextDouble(0));
dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt());
-
- if (isPositionValid) {
- position.setTime(dateBuilder.getDate());
- } else {
- getLastLocation(position, dateBuilder.getDate());
- }
+ position.setTime(dateBuilder.getDate());
} else {
continue;