diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-09 11:34:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-09 11:34:42 +1300 |
commit | 663231ec30ed41d60ef352e89ea61e9eb2b735c2 (patch) | |
tree | ea32f4b350bc7497bc738d2bb00b476423472efb /src/org/traccar/protocol/AutoFonFrameDecoder.java | |
parent | bc8a449d384506eac902b76870d7b565f96c05e6 (diff) | |
download | trackermap-server-663231ec30ed41d60ef352e89ea61e9eb2b735c2.tar.gz trackermap-server-663231ec30ed41d60ef352e89ea61e9eb2b735c2.tar.bz2 trackermap-server-663231ec30ed41d60ef352e89ea61e9eb2b735c2.zip |
Merge AutoFon and AutoFon45 protocols
Diffstat (limited to 'src/org/traccar/protocol/AutoFonFrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AutoFonFrameDecoder.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/AutoFonFrameDecoder.java b/src/org/traccar/protocol/AutoFonFrameDecoder.java index 1ad9e6d3b..2c547d822 100644 --- a/src/org/traccar/protocol/AutoFonFrameDecoder.java +++ b/src/org/traccar/protocol/AutoFonFrameDecoder.java @@ -1,5 +1,6 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2015 Vitaly Litvak (vitavaque@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +23,6 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder; public class AutoFonFrameDecoder extends FrameDecoder { - public static final int MSG_LOGIN = 0x10; - public static final int MSG_LOCATION = 0x11; - public static final int MSG_HISTORY = 0x12; - @Override protected Object decode( ChannelHandlerContext ctx, @@ -39,15 +36,21 @@ public class AutoFonFrameDecoder extends FrameDecoder { int length; switch (buf.getUnsignedByte(buf.readerIndex())) { - case MSG_LOGIN: + case AutoFonProtocolDecoder.MSG_LOGIN: length = 12; break; - case MSG_LOCATION: + case AutoFonProtocolDecoder.MSG_LOCATION: length = 78; break; - case MSG_HISTORY: + case AutoFonProtocolDecoder.MSG_HISTORY: length = 257; break; + case AutoFonProtocolDecoder.MSG_45_LOGIN: + length = 19; + break; + case AutoFonProtocolDecoder.MSG_45_LOCATION: + length = 34; + break; default: length = 0; break; |