aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
index dc558147a..f29fb9850 100644
--- a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -309,18 +309,17 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
Position position = null;
- if (length > 1) {
+ if (photo == null) {
+ photo = Unpooled.buffer();
+ }
- if (photo == null) {
- photo = Unpooled.buffer();
- }
+ buf.readUnsignedByte(); // part number
- buf.readUnsignedByte(); // part number
- photo.writeBytes(buf, length - 1);
+ if (length > 1) {
- sendResponse(channel, 0x07, buf.readUnsignedShortLE());
+ photo.writeBytes(buf, length - 1);
- } else if (photo != null) {
+ } else {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
String uniqueId = Context.getIdentityManager().getById(deviceSession.getDeviceId()).getUniqueId();
@@ -336,6 +335,8 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
}
+ sendResponse(channel, 0x07, buf.readUnsignedShortLE());
+
return position;
}