diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-07-27 09:00:10 +0200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-07-27 09:00:10 +0200 |
commit | dc775e0e114737e3078270bf45d131446b8e6058 (patch) | |
tree | 08fbb2bbf02a5d42fdfebcd49926047fcbaacd2f /src | |
parent | 52315f99445c347b421dcae6a4c977d79d756b6a (diff) | |
download | traccar-server-dc775e0e114737e3078270bf45d131446b8e6058.tar.gz traccar-server-dc775e0e114737e3078270bf45d131446b8e6058.tar.bz2 traccar-server-dc775e0e114737e3078270bf45d131446b8e6058.zip |
Support PT501 device (fix #786)
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Pt502ProtocolDecoder.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index 6986bf22b..179219038 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -1,6 +1,6 @@ /*
- * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com)
- * Luis Parada (luis.parada@gmail.com)
+ * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com)
+ * Luis Parada (luis.parada@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,8 +34,8 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { super(serverManager);
}
- static private Pattern pattern = Pattern.compile(
- "\\$POS," + // Data Frame start
+ private static final Pattern pattern = Pattern.compile(
+ ".*\\$POS," + // Data Frame start
"(\\d+)," + // Id
"(\\d{2})(\\d{2})(\\d{2})\\.(\\d{3})," + // Time (HHMMSS.SSS)
"([AV])," + // Validity
@@ -86,7 +86,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.MILLISECOND, 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++));
|