diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-07-31 20:56:53 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-07-31 20:56:53 +1200 |
commit | d53db01813ee67e7578f55c162639aa61608ed0b (patch) | |
tree | d4e5228c196f59512278b18542510dc3551499a4 /src/org/traccar/protocol/Jt600ProtocolDecoder.java | |
parent | 016561b2060242e4d4cac25f352cec3dbe4c41a4 (diff) | |
download | trackermap-server-d53db01813ee67e7578f55c162639aa61608ed0b.tar.gz trackermap-server-d53db01813ee67e7578f55c162639aa61608ed0b.tar.bz2 trackermap-server-d53db01813ee67e7578f55c162639aa61608ed0b.zip |
Fix jt600 frame decoder (fix #290)
Diffstat (limited to 'src/org/traccar/protocol/Jt600ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Jt600ProtocolDecoder.java | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 6a8f9da52..86711a644 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.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. @@ -29,21 +29,12 @@ import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Log; import org.traccar.model.Position; -/** - * JT600 protocol decoder - */ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { - /** - * Initialize - */ public Jt600ProtocolDecoder(ServerManager serverManager) { super(serverManager); } - /** - * Decode regular message - */ private Position decodeNormalMessage(ChannelBuffer buf) throws Exception { Position position = new Position(); @@ -56,7 +47,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(getDataManager().getDeviceByImei(id).getId()); } catch(Exception error) { Log.warning("Unknown device - " + id); - return null; + //return null; } buf.readByte(); // protocol version + data type @@ -122,9 +113,6 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { return position; } - /** - * Alert message pattern - */ static private Pattern pattern = Pattern.compile( "\\(" + "([\\d]+)," + // Id @@ -144,9 +132,6 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { "(\\d+)," + // Alert Type ".*\\)"); - /** - * Decode alert message - */ private Position decodeAlertMessage(ChannelBuffer buf) throws Exception { String message = buf.toString(Charset.defaultCharset()); @@ -208,9 +193,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { return position; } - /** - * Decode message - */ + @Override protected Object decode( ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { |