aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tk102ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-01 23:41:49 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-01 23:41:49 +1200
commit08eead58823782394f6219561e8f8251cdf17a48 (patch)
treeaad3177556b7599472a515ed491ab479e1aa5663 /src/org/traccar/protocol/Tk102ProtocolDecoder.java
parentc81160165ae6881c9195cf3c00469cb9466e6364 (diff)
downloadtrackermap-server-08eead58823782394f6219561e8f8251cdf17a48.tar.gz
trackermap-server-08eead58823782394f6219561e8f8251cdf17a48.tar.bz2
trackermap-server-08eead58823782394f6219561e8f8251cdf17a48.zip
Extend TK102 support (fix #329)
Diffstat (limited to 'src/org/traccar/protocol/Tk102ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tk102ProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java
index fd760e795..d7226980e 100644
--- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java
@@ -36,16 +36,16 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder {
}
static private Pattern pattern = Pattern.compile(
- "\\[\\=\\d{10}.\\(.{3}" +
+ "\\[.\\d{10}.\\(\\p{Upper}+" +
"(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS)
"([AV])" + // Validity
"(\\d{2})(\\d{2}\\.\\d{4})" + // Latitude (DDMM.MMMM)
"([NS])" +
"(\\d{3})(\\d{2}\\.\\d{4})" + // Longitude (DDDMM.MMMM)
"([EW])" +
- "(\\d{3}\\.\\d{3})" + // Speed
+ "(\\d{3}\\.\\d{3})" + // Speed
"(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY)
- ".+");
+ "\\d+\\)");
@Override
protected Object decode(
@@ -65,7 +65,7 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder {
}
// Parse message
- else if (sentence.startsWith("[=") && deviceId != null) {
+ else if (deviceId != null) {
// Parse message
Matcher parser = pattern.matcher(sentence);