aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-01-18 20:50:43 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-01-18 20:50:43 +1300
commitcdc98904fef47f01a7311eca17eeae97dd5e4fac (patch)
tree62359894fa78b33361a8a70a9c2b45eaff11b7c6 /src/org
parent8161004d43dbd25ef78ea90c85ed20522008db05 (diff)
downloadtrackermap-server-cdc98904fef47f01a7311eca17eeae97dd5e4fac.tar.gz
trackermap-server-cdc98904fef47f01a7311eca17eeae97dd5e4fac.tar.bz2
trackermap-server-cdc98904fef47f01a7311eca17eeae97dd5e4fac.zip
Fix avl08 protocol (fix #121)
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Avl08ProtocolDecoder.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Avl08ProtocolDecoder.java b/src/org/traccar/protocol/Avl08ProtocolDecoder.java
index 488008be4..7cd64ad2b 100644
--- a/src/org/traccar/protocol/Avl08ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Avl08ProtocolDecoder.java
@@ -43,24 +43,24 @@ public class Avl08ProtocolDecoder extends BaseProtocolDecoder {
*/
static private Pattern pattern = Pattern.compile(
"\\$\\$.{2}" + // Length
- "(\\d{15})\\|" + // IMEI
+ "(\\d+)\\|" + // IMEI
"(.{2})" + // Alarm Type
"\\$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{2})(\\d{2}.\\d{4})," + // Latitude (DDMM.MMMM)
+ "(\\d{2})(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM)
"([NS])," +
- "(\\d{3})(\\d{2}.\\d{4})," + // Longitude (DDDMM.MMMM)
+ "(\\d{3})(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM)
"([EW])," +
- "(\\d+.\\d{2})?," + // Speed
- "(\\d+.\\d{2})?," + // Course
+ "(\\d+\\.\\d+)?," + // Speed
+ "(\\d+\\.\\d+)?," + // Course
"(\\d{2})(\\d{2})(\\d{2}),[^\\|]*\\|" + // Date (DDMMYY)
- "(\\d+.\\d)\\|(\\d+.\\d)\\|(\\d+.\\d)\\|" + // Dilution of precision
+ "(\\d+\\.?\\d+)\\|(\\d+\\.?\\d+)\\|(\\d+\\.?\\d+)\\|" + // Dilution of precision
"(\\d{12})\\|" + // Status
"(\\d{14})\\|" + // Clock
"(\\d{8})\\|" + // Voltage
"(\\d{8})\\|" + // ADC
- "(.{8})\\|" + // Cell
+ "([0-9a-fA-F]{8})\\|" + // Cell
"(.\\d{3})\\|" + // Temperature
"(\\d+.\\d{4})\\|" + // Mileage
"(\\d{4})\\|" + // Serial
@@ -70,6 +70,7 @@ public class Avl08ProtocolDecoder extends BaseProtocolDecoder {
/**
* Decode message
*/
+ @Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, Object msg)
throws Exception {