diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-13 14:18:47 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-13 14:18:47 +1300 |
commit | b61dee3d8474d5431dc2b085ec0ed92f7ee918c6 (patch) | |
tree | 7d6d24ba2e074ddc2359816c3385e5642c878d18 /src/org/traccar/protocol/Gt06ProtocolDecoder.java | |
parent | fc0933a50d0ee2081e98e652ebfa0fc04d2e7069 (diff) | |
download | trackermap-server-b61dee3d8474d5431dc2b085ec0ed92f7ee918c6.tar.gz trackermap-server-b61dee3d8474d5431dc2b085ec0ed92f7ee918c6.tar.bz2 trackermap-server-b61dee3d8474d5431dc2b085ec0ed92f7ee918c6.zip |
Fix method length warning
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 71df47f0a..16114f420 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -478,7 +478,37 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { content.writeByte(calendar.get(Calendar.SECOND)); sendResponse(channel, false, MSG_TIME_REQUEST, 0, content); - } else if (type == MSG_X1_GPS) { + } else if (type == MSG_X1_GPS || type == MSG_X1_PHOTO_INFO) { + + return decodeX1(channel, buf, deviceSession, type); + + } else if (type == MSG_WIFI || type == MSG_WIFI_2) { + + return decodeWifi(buf, deviceSession); + + } else if (type == MSG_INFO) { + + Position position = new Position(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + + getLastLocation(position, null); + + position.set(Position.KEY_POWER, buf.readShort() * 0.01); + + return position; + + } else { + + return decodeBasicOther(channel, buf, deviceSession, type, dataLength); + + } + + return null; + } + + private Object decodeX1(Channel channel, ByteBuf buf, DeviceSession deviceSession, int type) { + + if (type == MSG_X1_GPS) { Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); @@ -520,25 +550,6 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { photos.put(pictureId, photo); sendPhotoRequest(channel, pictureId); - } else if (type == MSG_WIFI || type == MSG_WIFI_2) { - - return decodeWifi(buf, deviceSession); - - } else if (type == MSG_INFO) { - - Position position = new Position(getProtocolName()); - position.setDeviceId(deviceSession.getDeviceId()); - - getLastLocation(position, null); - - position.set(Position.KEY_POWER, buf.readShort() * 0.01); - - return position; - - } else { - - return decodeBasicOther(channel, buf, deviceSession, type, dataLength); - } return null; |