diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-11 05:46:48 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-11 05:46:48 +1300 |
commit | d407e1d4d7a71a108d11483be40d4abec89dd266 (patch) | |
tree | 4b9818d37b630d05a0371fb652e9498bb8b21604 /src | |
parent | 9ae75e701499d07fca67dc45f9be748e04752fea (diff) | |
download | traccar-server-d407e1d4d7a71a108d11483be40d4abec89dd266.tar.gz traccar-server-d407e1d4d7a71a108d11483be40d4abec89dd266.tar.bz2 traccar-server-d407e1d4d7a71a108d11483be40d4abec89dd266.zip |
Decode GT06 language field
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index bff04b36d..7365c9c57 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -156,6 +156,21 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } } + private static boolean hasLanguage(int type) { + switch (type) { + case MSG_LBS_EXTEND: + case MSG_GPS_PHONE: + case MSG_HEARTBEAT: + case MSG_GPS_LBS_STATUS_3: + case MSG_LBS_MULTIPLE: + case MSG_LBS_2: + case MSG_FENCE_MULTI: + return true; + default: + return false; + } + } + private void sendResponse(Channel channel, boolean extended, int type, ChannelBuffer content) { if (channel != null) { ChannelBuffer response = ChannelBuffers.dynamicBuffer(); @@ -612,6 +627,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } + if (hasLanguage(type)) { + buf.readUnsignedShort(); + } + sendResponse(channel, false, type, null); return position; |