diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-23 20:43:17 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-23 20:43:17 +1200 |
commit | 5cd79fef21612cc58ea6f0d0eed612c76d021d8a (patch) | |
tree | baca1e5f48b2286155801899bf6bdc2945c39268 /src/org/traccar | |
parent | 2f3c5cac45601f54fa0dd46a23cbd593b5779cc1 (diff) | |
download | traccar-server-5cd79fef21612cc58ea6f0d0eed612c76d021d8a.tar.gz traccar-server-5cd79fef21612cc58ea6f0d0eed612c76d021d8a.tar.bz2 traccar-server-5cd79fef21612cc58ea6f0d0eed612c76d021d8a.zip |
Improve GL200 decoder
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Gl200ProtocolDecoder.java | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 639c9439a..ce845a6ec 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.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. @@ -26,43 +26,27 @@ import org.traccar.ServerManager; import org.traccar.helper.Log; import org.traccar.model.Position; -/** - * GL200 tracker protocol decoder - */ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { - /** - * Initialize - */ public Gl200ProtocolDecoder(ServerManager serverManager) { super(serverManager); } - /** - * Regular expressions pattern - */ static private Pattern pattern = Pattern.compile( "\\+RESP:GT...," + "[0-9a-fA-F]{6}," + // Protocol version - "(\\d{15})," + // IMEI - "[^,]*," + // Device name - "(?:(?:\\d," + // Report ID / Geo mode - "\\d*," + // Report type / Geo radius - "\\d*)|" + // Number / Geo check interval - "(?:[^,]*))," + // Call number + "(\\d{15}),.*," + // IMEI "(\\d*)," + // GPS accuracy "(\\d+.\\d)," + // Speed "(\\d+)," + // Course - "(-?\\d+.\\d)," + // Altitude - "(-?\\d+.\\d+)," + // Longitude - "(-?\\d+.\\d+)," + // Latitude + "(-?\\d+\\.\\d)," + // Altitude + "(-?\\d+\\.\\d+)," + // Longitude + "(-?\\d+\\.\\d+)," + // Latitude "(\\d{4})(\\d{2})(\\d{2})" + // Date (YYYYMMDD) "(\\d{2})(\\d{2})(\\d{2})," + // Time (HHMMSS) ".*"); - /** - * Decode message - */ + @Override protected Object decode( ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { |