aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-08 22:55:29 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-08 22:55:29 -0700
commitcdb2d2aa151f900bf16af22538b6049daf7e494c (patch)
tree6555a9959bf8b871504364a9fd2a750be8a000e6 /src/main
parent53ee85d47e851615e271c7ac80675877365509a3 (diff)
downloadtrackermap-server-cdb2d2aa151f900bf16af22538b6049daf7e494c.tar.gz
trackermap-server-cdb2d2aa151f900bf16af22538b6049daf7e494c.tar.bz2
trackermap-server-cdb2d2aa151f900bf16af22538b6049daf7e494c.zip
Refactor response
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 0c8ecd4a9..a9da34e6e 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -1141,9 +1141,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else if (type == MSG_GPS_MODULAR) {
- sendResponse(channel, false, type, buf.getShort(buf.writerIndex() - 6), null);
-
- return decodeExtendedModular(buf, deviceSession);
+ return decodeExtendedModular(channel, buf, deviceSession);
} else {
@@ -1154,7 +1152,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- private Object decodeExtendedModular(ByteBuf buf, DeviceSession deviceSession) {
+ private Object decodeExtendedModular(Channel channel, ByteBuf buf, DeviceSession deviceSession) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
@@ -1255,6 +1253,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
+ sendResponse(channel, false, MSG_GPS_MODULAR, buf.readUnsignedShort(), null);
+
return position;
}