aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-27 21:29:48 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-27 21:29:48 +1200
commit4e77075ea6c333e0eb46204faf6b3f350a1cb984 (patch)
tree2a6eaaf7488e75dbb7c81222934825994f0f86c4 /src/org
parentb35863ef77196a1ca060169df0c022eb25d99a7d (diff)
downloadtrackermap-server-4e77075ea6c333e0eb46204faf6b3f350a1cb984.tar.gz
trackermap-server-4e77075ea6c333e0eb46204faf6b3f350a1cb984.tar.bz2
trackermap-server-4e77075ea6c333e0eb46204faf6b3f350a1cb984.zip
Modify Xexun decoder
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/XexunFrameDecoder.java5
-rw-r--r--src/org/traccar/protocol/XexunProtocolDecoder.java6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/XexunFrameDecoder.java b/src/org/traccar/protocol/XexunFrameDecoder.java
index 726ca5e1f..2dd9dad7d 100644
--- a/src/org/traccar/protocol/XexunFrameDecoder.java
+++ b/src/org/traccar/protocol/XexunFrameDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import org.traccar.helper.ChannelBufferTools;
public class XexunFrameDecoder extends FrameDecoder {
+ @Override
protected Object decode(
ChannelHandlerContext ctx,
Channel channel,
@@ -30,7 +31,7 @@ public class XexunFrameDecoder extends FrameDecoder {
// Check minimum length
int length = buf.readableBytes();
- if (length < 100) {
+ if (length < 80) {
return null;
}
diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java
index 0d7d3e9aa..03d746c34 100644
--- a/src/org/traccar/protocol/XexunProtocolDecoder.java
+++ b/src/org/traccar/protocol/XexunProtocolDecoder.java
@@ -33,13 +33,9 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
- /**
- * Regular expressions pattern
- */
- //GPRMC,043435.000,A,811.299200,S,11339.9500,E,0.93,29.52,160313,00,0000.0,A*65,F,,imei:359585014597923,
static private Pattern pattern = Pattern.compile(
"GPRMC," +
- "(\\d{2})(\\d{2})(\\d{2}).(\\d{3})," + // Time (HHMMSS.SSS)
+ "(\\d{2})(\\d{2})(\\d{2}).(\\d+)," + // Time (HHMMSS.SSS)
"([AV])," + // Validity
"(\\d+)(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM)
"([NS])," +