From f8e6bc5ced2244f5f09664e7d778c0bf51cd4ab9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 5 Nov 2021 10:17:06 -0700 Subject: Fix photo request --- src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java | 10 ++++------ 1 file 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: -- cgit v1.2.3