aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
diff options
context:
space:
mode:
authorcasswarry0 <33078062+casswarry0@users.noreply.github.com>2021-11-23 15:35:10 +0000
committerGitHub <noreply@github.com>2021-11-23 15:35:10 +0000
commit26e3d8eb0c40822e5f39d144ecb053916c463e8f (patch)
treeb28e4b09f4e2aea9179d482dd4a2b153b1db63c5 /src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
parenta425ea42de76ba81890fb52b1f06eff82bba1ded (diff)
parentfd47e69b388b1e0af8aa5ead940773f6b2da3e81 (diff)
downloadtrackermap-server-26e3d8eb0c40822e5f39d144ecb053916c463e8f.tar.gz
trackermap-server-26e3d8eb0c40822e5f39d144ecb053916c463e8f.tar.bz2
trackermap-server-26e3d8eb0c40822e5f39d144ecb053916c463e8f.zip
Merge branch 'traccar:master' into master
Diffstat (limited to 'src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java')
-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;
}