1078-修复摄像头立即拍摄命令应答

This commit is contained in:
648540858
2024-05-14 23:21:57 +08:00
parent e02a047eb2
commit 7bf548492a
3 changed files with 10 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import org.springframework.context.ApplicationEvent;
import java.util.ArrayList;
import java.util.List;
/**
@@ -27,17 +28,19 @@ public class J0805 extends Re {
/**
* 表示拍摄成功的多媒体个数
*/
private List<Long> ids;
private List<Long> ids = new ArrayList<>();
@Override
protected Rs decode0(ByteBuf buf, Header header, Session session) {
respNo = buf.readUnsignedShort();
result = buf.readUnsignedByte();
int length = buf.readUnsignedByte();
for (int i = 0; i < length; i++) {
ids.add(buf.readUnsignedInt());
if (result == 0) {
int length = buf.readUnsignedShort();
for (int i = 0; i < length; i++) {
ids.add(buf.readUnsignedInt());
}
}
SessionManager.INSTANCE.response(header.getTerminalId(), "0805", (long) respNo, ids);
SessionManager.INSTANCE.response(header.getTerminalId(), "0805", null, ids);
return null;
}

View File

@@ -711,6 +711,6 @@ public class jt1078ServiceImpl implements Ijt1078Service {
public List<Long> shooting(String deviceId, JTShootingCommand shootingCommand) {
J8801 j8801 = new J8801();
j8801.setCommand(shootingCommand);
return (List<Long>)jt1078Template.shooting(deviceId, j8801, 20);
return (List<Long>)jt1078Template.shooting(deviceId, j8801, 300);
}
}

View File

@@ -81,6 +81,7 @@ public enum SessionManager {
return null;
}
String requestKey = requestKey(cmd.getDevId(), cmd.getRespId(), cmd.getPackageNo());
System.out.println("requestKey==" + requestKey);
SynchronousQueue<Object> subscribe = subscribe(requestKey);
if (subscribe == null) {
log.error("DevId: {} key:{} send repaid", cmd.getDevId(), requestKey);