aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-11-05 10:17:06 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-11-05 10:17:06 -0700
commitf8e6bc5ced2244f5f09664e7d778c0bf51cd4ab9 (patch)
tree41e3a0efaebea974337180b44e111e67db5fa4c7 /src/main
parent479a2b6c938177d10c02ea3c4937d129de774776 (diff)
downloadtraccar-server-f8e6bc5ced2244f5f09664e7d778c0bf51cd4ab9.tar.gz
traccar-server-f8e6bc5ced2244f5f09664e7d778c0bf51cd4ab9.tar.bz2
traccar-server-f8e6bc5ced2244f5f09664e7d778c0bf51cd4ab9.zip
Fix photo request
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java b/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
index 457b5ae62..c64b8171f 100644
--- a/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
@@ -64,18 +64,16 @@ public class DualcamProtocolDecoder extends BaseProtocolDecoder {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, uniqueId);
long settings = buf.readUnsignedInt();
if (channel != null && deviceSession != null) {
- if (BitUtil.check(settings, 26)) {
- ByteBuf response = Unpooled.buffer();
+ ByteBuf response = Unpooled.buffer();
+ if (BitUtil.between(settings, 26, 28) > 0) {
response.writeShort(MSG_FILE_REQUEST);
- String file = "%photof";
+ String file = BitUtil.check(settings, 26) ? "%photof" : "%photor";
response.writeShort(file.length());
response.writeCharSequence(file, StandardCharsets.US_ASCII);
- channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
} else {
- ByteBuf response = Unpooled.buffer();
response.writeShort(MSG_COMPLETE);
- channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
}
+ channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
}
break;
case MSG_START: