aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TotemProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-11-03 11:56:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-11-03 11:56:19 +1300
commit27b76e26e7f438976e6702c9f3c71be93f68fa52 (patch)
tree31eff062934a199e644c613894410a276d98cbc9 /src/org/traccar/protocol/TotemProtocolDecoder.java
parent4eee2d3db43dd7154e0de499b89be90c8f59a383 (diff)
downloadtrackermap-server-27b76e26e7f438976e6702c9f3c71be93f68fa52.tar.gz
trackermap-server-27b76e26e7f438976e6702c9f3c71be93f68fa52.tar.bz2
trackermap-server-27b76e26e7f438976e6702c9f3c71be93f68fa52.zip
Merge AVL08 and Totem protocols
Diffstat (limited to 'src/org/traccar/protocol/TotemProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java
index 5b9aeff84..1a0f22d80 100644
--- a/src/org/traccar/protocol/TotemProtocolDecoder.java
+++ b/src/org/traccar/protocol/TotemProtocolDecoder.java
@@ -33,7 +33,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
- static private Pattern patternFirst = Pattern.compile(
+ private static final Pattern patternFirst = Pattern.compile(
"\\$\\$" + // Header
"\\p{XDigit}{2}" + // Length
"(\\d+)\\|" + // IMEI
@@ -62,9 +62,10 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
"(\\d+)\\|" + // Temperature
"(\\d+.\\d+)\\|" + // Milage
"\\d+\\|" + // Serial Number
+ ".*\\|?" +
"\\p{XDigit}{4}"); // Checksum
- static private Pattern patternSecond = Pattern.compile(
+ private static final Pattern patternSecond = Pattern.compile(
"\\$\\$" + // Header
"\\p{XDigit}{2}" + // Length
"(\\d+)\\|" + // IMEI
@@ -90,7 +91,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
"\\d+\\|" + // Serial Number
"\\p{XDigit}{4}"); // Checksum
- static private Pattern patternThird = Pattern.compile(
+ private static final Pattern patternThird = Pattern.compile(
"\\$\\$" + // Header
"\\p{XDigit}{2}" + // Length
"(\\d+)\\|" + // IMEI
@@ -188,7 +189,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++)));
// 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++));