diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-16 19:00:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-16 19:00:32 +1300 |
commit | 8db1cf2bc97f5f616bd5722656db2d69edd46d45 (patch) | |
tree | 011979a862c1ead66d1e8200da5c9d0d08afdf13 /src/org/traccar | |
parent | 7c8a732d577d6748b9223f720d2dde70f5ebfc41 (diff) | |
download | traccar-server-8db1cf2bc97f5f616bd5722656db2d69edd46d45.tar.gz traccar-server-8db1cf2bc97f5f616bd5722656db2d69edd46d45.tar.bz2 traccar-server-8db1cf2bc97f5f616bd5722656db2d69edd46d45.zip |
Fix xexun protocol decoder (fix #170)
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/XexunProtocolDecoder.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 1fd572896..53b34d2b1 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.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. @@ -27,14 +27,8 @@ import org.traccar.ServerManager; import org.traccar.helper.Log; import org.traccar.model.Position; -/** - * Xexun tracker protocol decoder - */ public class XexunProtocolDecoder extends BaseProtocolDecoder { - /** - * Initialize - */ public XexunProtocolDecoder(ServerManager serverManager) { super(serverManager); } @@ -42,23 +36,22 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { /** * 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{3})," + // Time (HHMMSS.SSS) "([AV])," + // Validity - "([\\d]{2})([\\d]{2}.[\\d]{4})," + // Latitude (DDMM.MMMM) + "(\\d+)(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM) "([NS])," + - "([\\d]{2,3})([\\d]{2}.[\\d]{4})," + // Longitude (DDDMM.MMMM) + "(\\d+)(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM) "([EW])," + - "([\\d]+.[\\d]+)," + // Speed - "([\\d]+.[\\d]+)?," + // Course - "([\\d]{2})([\\d]{2})([\\d]{2})," + // Date (DDMMYY) + "(\\d+\\.\\d+)," + // Speed + "(\\d+\\.\\d+)?," + // Course + "(\\d{2})(\\d{2})(\\d{2})," + // Date (DDMMYY) ".*imei:" + - "([\\d]+),"); // IMEI + "(\\d+),"); // IMEI - /** - * Decode message - */ + @Override protected Object decode( ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { |