aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/xexun2
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2011-11-18 09:09:15 +0000
committerAnton Tananaev <anton.tananaev@gmail.com>2011-11-18 09:09:15 +0000
commit91a8d2558644293758c93d2c1df21487cd387993 (patch)
tree6399d1bbd8b522acf8eeb6ebceb88fe04892544b /src/org/traccar/protocol/xexun2
parent710bdd092b193704fabdf6136bd5bffe0d8e01e7 (diff)
downloadtrackermap-server-91a8d2558644293758c93d2c1df21487cd387993.tar.gz
trackermap-server-91a8d2558644293758c93d2c1df21487cd387993.tar.bz2
trackermap-server-91a8d2558644293758c93d2c1df21487cd387993.zip
Diffstat (limited to 'src/org/traccar/protocol/xexun2')
-rw-r--r--src/org/traccar/protocol/xexun2/Xexun2ProtocolDecoder.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/xexun2/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/xexun2/Xexun2ProtocolDecoder.java
index 8f1b53328..8f9fb7535 100644
--- a/src/org/traccar/protocol/xexun2/Xexun2ProtocolDecoder.java
+++ b/src/org/traccar/protocol/xexun2/Xexun2ProtocolDecoder.java
@@ -59,6 +59,7 @@ public class Xexun2ProtocolDecoder extends OneToOneDecoder {
* Regular expressions pattern
*/
static private Pattern pattern = Pattern.compile(
+ "[\r\n]*" +
"\\d+," +
"\\+\\d+," +
"GPRMC," +
@@ -72,11 +73,12 @@ public class Xexun2ProtocolDecoder extends OneToOneDecoder {
"(\\d+.\\d+)?," + // Course
"(\\d{2})(\\d{2})(\\d{2})," + // Date (DDMMYY)
".*imei:" +
- "([\\d]+)," + // IMEI
+ "(\\d+)," + // IMEI
"\\d+," +
"\\d+.\\d+," +
"F:(\\d+.\\d+)V," + // Power
- ".*");
+ ".*" +
+ "[\r\n]*");
/**
* Decode message
@@ -89,7 +91,8 @@ public class Xexun2ProtocolDecoder extends OneToOneDecoder {
String sentence = (String) msg;
Matcher parser = pattern.matcher(sentence);
if (!parser.matches()) {
- throw new ParseException(null, 0);
+ //throw new ParseException(null, 0);
+ return null;
}
// Create new position