dji-sdk / DJI-Cloud-API-Demo

MIT License
112 stars 84 forks source link

控制挂载的时候,报The device does not have payload control authority. #27

Open answerThe opened 1 year ago

answerThe commented 1 year ago

控制挂载的时候,报The device does not have payload control authority. 调试看是设备osd 上报数据 里面的payloadsList 为null.导致检测控制权限判断为空直接报没有控制权限。payloadsList 这个需要怎么用才能上报。挂载直播着,payloadsList 为啥为null public Boolean checkAuthorityPayload(String deviceSn, String payloadIndex) { return deviceRedisService.getDeviceOnline(deviceSn).flatMap(device -> Optional.of(DeviceDomainEnum.SUBDEVICE.getVal() == device.getDomain() && **!CollectionUtils.isEmpty(device.getPayloadsList())_** && ControlSourceEnum.A.getControlSource() .equals(device.getPayloadsList().stream() .filter(payload -> payloadIndex.equals(payload.getPayloadIndex())) .map(DevicePayloadDTO::getControlSource).findAny() .orElse(ControlSourceEnum.B.getControlSource())))).orElse(true);

}