From 5cd79fef21612cc58ea6f0d0eed612c76d021d8a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 23 Jun 2013 20:43:17 +1200 Subject: Improve GL200 decoder --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 28 +++++----------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3