aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-27 20:48:47 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-27 20:48:47 -0600
commitaa59b968c7d6a89b8e6285647ab2e6e62f02cf7f (patch)
treee74474e6b6bd75a71ac79bdbd31b9237a7b3c2d6 /src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
parentf03b999d6d17e53c1c1e1aa2f9271d03f12f2264 (diff)
downloadtraccar-server-aa59b968c7d6a89b8e6285647ab2e6e62f02cf7f.tar.gz
traccar-server-aa59b968c7d6a89b8e6285647ab2e6e62f02cf7f.tar.bz2
traccar-server-aa59b968c7d6a89b8e6285647ab2e6e62f02cf7f.zip
Revert "Merge branch 'master' into suntech-fixes"
This reverts commit f03b999d6d17e53c1c1e1aa2f9271d03f12f2264, reversing changes made to 3a528ddc88f72f39ff9566cf5e0f54938b1584ef.
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, 8 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
index f29fb9850..dc558147a 100644
--- a/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GalileoProtocolDecoder.java
@@ -309,17 +309,18 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
Position position = null;
- if (photo == null) {
- photo = Unpooled.buffer();
- }
-
- buf.readUnsignedByte(); // part number
-
if (length > 1) {
+ if (photo == null) {
+ photo = Unpooled.buffer();
+ }
+
+ buf.readUnsignedByte(); // part number
photo.writeBytes(buf, length - 1);
- } else {
+ sendResponse(channel, 0x07, buf.readUnsignedShortLE());
+
+ } else if (photo != null) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
String uniqueId = Context.getIdentityManager().getById(deviceSession.getDeviceId()).getUniqueId();
@@ -335,8 +336,6 @@ public class GalileoProtocolDecoder extends BaseProtocolDecoder {
}
- sendResponse(channel, 0x07, buf.readUnsignedShortLE());
-
return position;
}