From d407e1d4d7a71a108d11483be40d4abec89dd266 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 11 Dec 2017 05:46:48 +1300 Subject: Decode GT06 language field --- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/org') 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; -- cgit v1.2.3