aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-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: