aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-06-14 22:35:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-06-14 22:35:07 +1200
commit786f2c7245e4f7cd4f0bd7ffcf5a79b1b2197ee6 (patch)
tree4b7a9885a25ac2e5976e78d853993a67191e452b /src/org
parente6d9af4efc0895cd1723f1cd2b80f82776ccf2e0 (diff)
downloadtraccar-server-786f2c7245e4f7cd4f0bd7ffcf5a79b1b2197ee6.tar.gz
traccar-server-786f2c7245e4f7cd4f0bd7ffcf5a79b1b2197ee6.tar.bz2
traccar-server-786f2c7245e4f7cd4f0bd7ffcf5a79b1b2197ee6.zip
Fix TLT-2H decoder
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Tlt2hProtocolDecoder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
index 4433322c2..c8671bc54 100644
--- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java
@@ -35,14 +35,14 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
- static private Pattern patternHeader = Pattern.compile(
+ private static final Pattern patternHeader = Pattern.compile(
"#(\\d+)#" + // IMEI
"[^#]+#" +
"\\d+#" +
"([^#]+)#" + // Status
"\\d+"); // Number of records
- static private Pattern patternPosition = Pattern.compile(
+ private static final Pattern patternPosition = Pattern.compile(
"#([0-9a-f]+)?" + // Cell info
"\\$GPRMC," +
"(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)," + // Time (HHMMSS.SSS)
@@ -51,8 +51,8 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
"([NS])," +
"(\\d+)(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM)
"([EW])," +
- "(\\d+\\.\\d{2})?," + // Speed
- "(\\d+\\.\\d{2})?," + // Course
+ "(\\d+\\.\\d+)?," + // Speed
+ "(\\d+\\.\\d+)?," + // Course
"(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY)
".+"); // Other (Checksumm)
@@ -107,7 +107,7 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
index += 1; // Skip milliseconds
// Validity
- position.setValid(parser.group(index++).compareTo("A") == 0 ? true : false);
+ position.setValid(parser.group(index++).compareTo("A") == 0);
// Latitude
Double latitude = Double.valueOf(parser.group(index++));