From 08eead58823782394f6219561e8f8251cdf17a48 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Aug 2013 23:41:49 +1200 Subject: Extend TK102 support (fix #329) --- src/org/traccar/protocol/Tk102ProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/org/traccar') 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); -- cgit v1.2.3