You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Override
public void dockFirmwareVersionUpdate(TopicStateRequest<DockFirmwareVersion> request, MessageHeaders headers) {
// If the reported version is empty, it will not be processed to prevent misleading page.
if (!StringUtils.hasText(request.getData().getFirmwareVersion())) {
return;
}
DeviceDTO device = DeviceDTO.builder()
.deviceSn(request.getFrom())
.firmwareVersion(request.getData().getFirmwareVersion())
// 这里判断是否有问题,为何为 false (不需要一致性升级)时,设置为需要一致性升级
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
.firmwareStatus(request.getData().getNeedCompatibleStatus() ?
DeviceFirmwareStatusEnum.UNKNOWN : DeviceFirmwareStatusEnum.CONSISTENT_UPGRADE)
.build();
boolean isUpd = deviceService.updateDevice(device);
if (!isUpd) {
log.error("Data update of firmware version failed. SN: {}", request.getFrom());
}
}
com.dji.sample.manage.service.impl.SDKDeviceService#dockFirmwareVersionUpdate
方法如下:其中
request.getData().getNeedCompatibleStatus()
为 true 时,是否是表示需要一致性升级,应对应DeviceFirmwareStatusEnum.CONSISTENT_UPGRADE
;而为 false 时,则表示不需要一致性升级,应对应DeviceFirmwareStatusEnum.NOT_UPGRADE
。源码中判断是否有问题,希望可以得到各位的解答,谢谢~
The text was updated successfully, but these errors were encountered: