Browse Source

添加缺失解析内容

S0025136190 1 year ago
parent
commit
1999cce155

+ 4 - 1
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java

@@ -59,7 +59,10 @@ public enum RemoteDebugStepKeyEnum {
 
     FREE_PUTTER("free_putter", "Free Putter"),
 
-    STOP_CHARGE("stop_charge", "Stop charging");
+    STOP_CHARGE("stop_charge", "Stop charging"),
+
+    CLOSE_DRONE("close_drone", "Close the plane");
+
 
     private final String stepKey;
 

+ 33 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/ArInfoSwitch.java

@@ -0,0 +1,33 @@
+package com.dji.sdk.cloudapi.device;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ */
+public class ArInfoSwitch {
+
+    /**
+     *
+     */
+    private SwitchActionEnum arInfoSwitch;
+
+    public ArInfoSwitch() {
+    }
+
+    @Override
+    public String toString() {
+        return "ArInfoSwitch{" +
+                "arInfoSwitch='" + arInfoSwitch + '\'' +
+                '}';
+    }
+
+    public SwitchActionEnum getArInfoSwitch() {
+        return arInfoSwitch;
+    }
+
+    public ArInfoSwitch setArInfoSwitch(SwitchActionEnum arInfoSwitch) {
+        this.arInfoSwitch = arInfoSwitch;
+        return this;
+    }
+}

+ 52 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/CenterNode.java

@@ -0,0 +1,52 @@
+package com.dji.sdk.cloudapi.device;
+
+import java.util.List;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ * 飞行器对频信息
+ */
+public class CenterNode {
+
+    /**
+     * 扰码信息
+     */
+    private Integer sdrId;
+
+    /**
+     * 设备sn
+     */
+    private String sn;
+
+    public CenterNode() {
+    }
+
+    @Override
+    public String toString() {
+        return "CenterNode{" +
+                "sdrId='" + sdrId + '\'' +
+                ", sn=" + sn +
+                '}';
+    }
+
+    public Integer getSdrId() {
+        return sdrId;
+    }
+
+    public CenterNode setSdrId(Integer sdrId) {
+        this.sdrId = sdrId;
+        return this;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public CenterNode setSn(String sn) {
+        this.sn = sn;
+        return this;
+    }
+
+}

+ 67 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/DockWirelessLink.java

@@ -0,0 +1,67 @@
+package com.dji.sdk.cloudapi.device;
+
+import java.util.List;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ */
+public class DockWirelessLink {
+
+
+    /**
+     * 加密编码
+     */
+    private List<Integer> secretCode;
+
+    /**
+     * 飞行器对频信息
+     */
+    private CenterNode centerNode;
+
+    /**
+     * 机场或遥控器对频信息
+     */
+    private List<LeafNode> leafNodes;
+
+
+    public DockWirelessLink() {
+    }
+
+    @Override
+    public String toString() {
+        return "DockWirelessLink{" +
+                "secretCode='" + secretCode + '\'' +
+                ", centerNode=" + centerNode +
+                ", leafNodes='" + leafNodes + '\'' +
+                '}';
+    }
+
+    public List<Integer> getSecretCode() {
+        return secretCode;
+    }
+
+    public DockWirelessLink setSecretCode(List<Integer> secretCode) {
+        this.secretCode = secretCode;
+        return this;
+    }
+
+    public CenterNode getCenterNode() {
+        return centerNode;
+    }
+
+    public DockWirelessLink setCenterNode(CenterNode centerNode) {
+        this.centerNode = centerNode;
+        return this;
+    }
+
+    public List<LeafNode> getLeafNodes() {
+        return leafNodes;
+    }
+
+    public DockWirelessLink setLeafNodes(List<LeafNode> leafNodes) {
+        this.leafNodes = leafNodes;
+        return this;
+    }
+}

+ 66 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/LeafNode.java

@@ -0,0 +1,66 @@
+package com.dji.sdk.cloudapi.device;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ * 机场或遥控器对频信息
+ */
+public class LeafNode {
+
+    /**
+     * 扰码信息
+     */
+    private Integer sdrId;
+
+    /**
+     * 设备sn
+     */
+    private String sn;
+
+    /**
+     * 控制源序号
+     */
+    private Integer controlSourceIndex;
+
+
+    public LeafNode() {
+    }
+
+    @Override
+    public String toString() {
+        return "LeafNode{" +
+                "sdrId='" + sdrId + '\'' +
+                ", sn=" + sn +
+                ", controlSourceIndex=" + controlSourceIndex +
+                '}';
+    }
+
+    public Integer getSdrId() {
+        return sdrId;
+    }
+
+    public LeafNode setSdrId(Integer sdrId) {
+        this.sdrId = sdrId;
+        return this;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public LeafNode setSn(String sn) {
+        this.sn = sn;
+        return this;
+    }
+
+    public Integer getControlSourceIndex() {
+        return controlSourceIndex;
+    }
+
+    public LeafNode setControlSourceIndex(Integer controlSourceIndex) {
+        this.controlSourceIndex = controlSourceIndex;
+        return this;
+    }
+
+}

+ 95 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/RtcmInfo.java

@@ -0,0 +1,95 @@
+package com.dji.sdk.cloudapi.device;
+
+import java.util.List;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ * 机场 RTK 标定源
+ */
+public class RtcmInfo {
+
+    /**
+     * 网络 RTK 挂载点信息
+     */
+    private String mountPoint;
+
+    /**
+     * 网络端口信息
+     */
+    private String port;
+
+
+    /**
+     * 网络 host 信息
+     */
+    private String host;
+
+    /**
+     * 设备类型
+     */
+    private DeviceTypeEnum rtcmDeviceType;
+
+    /**
+     * 标定类型
+     */
+    private SourceTypeEnum sourceType;
+
+
+    @Override
+    public String toString() {
+        return "RtcmInfo{" +
+                "mountPoint='" + mountPoint + '\'' +
+                ", port=" + port +
+                ", host='" + host + '\'' +
+                ", rtcmDeviceType=" + rtcmDeviceType +
+                ", sourceType=" + sourceType +
+                '}';
+    }
+
+    public String getMountPoint() {
+        return mountPoint;
+    }
+
+    public RtcmInfo setMountPoint(String mountPoint) {
+        this.mountPoint = mountPoint;
+        return this;
+    }
+
+    public String getPort() {
+        return port;
+    }
+
+    public RtcmInfo setPort(String port) {
+        this.port = port;
+        return this;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public RtcmInfo setHost(String host) {
+        this.host = host;
+        return this;
+    }
+
+    public DeviceTypeEnum getRtcmDeviceType() {
+        return rtcmDeviceType;
+    }
+
+    public RtcmInfo setRtcmDeviceType(DeviceTypeEnum rtcmDeviceType) {
+        this.rtcmDeviceType = rtcmDeviceType;
+        return this;
+    }
+
+    public SourceTypeEnum getSourceType() {
+        return sourceType;
+    }
+
+    public RtcmInfo setSourceType(SourceTypeEnum sourceType) {
+        this.sourceType = sourceType;
+        return this;
+    }
+}

+ 44 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/SourceTypeEnum.java

@@ -0,0 +1,44 @@
+package com.dji.sdk.cloudapi.device;
+
+import com.dji.sdk.exception.CloudSDKException;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import java.util.Arrays;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ * 标定类型
+ */
+public enum SourceTypeEnum {
+
+    NOT(0,"未标定"),
+
+    SELF(1,"自收敛标定"),
+
+    HAND(2,"手动标定"),
+
+    RTK(3,"网络RTK标定");
+
+    private final int sourceType;
+
+    private final String text;
+
+    SourceTypeEnum(int sourceType,String text) {
+        this.sourceType = sourceType;
+        this.text = text;
+    }
+
+    @JsonValue
+    public int getControlSource() {
+        return sourceType;
+    }
+
+    @JsonCreator
+    public static SourceTypeEnum find(int sourceType) {
+        return Arrays.stream(values()).filter(controlSourceEnum -> controlSourceEnum.sourceType==sourceType).findAny()
+                .orElseThrow(() -> new CloudSDKException(SourceTypeEnum.class, sourceType));
+    }
+}

+ 34 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/cloudapi/device/UomRealNameState.java

@@ -0,0 +1,34 @@
+package com.dji.sdk.cloudapi.device;
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ */
+public class UomRealNameState {
+
+    /**
+     *
+     */
+    private Integer uomRealNameState;
+
+    public UomRealNameState() {
+    }
+
+    @Override
+    public String toString() {
+        return "UomRealNameState{" +
+                "uomRealNameState='" + uomRealNameState + '\'' +
+                '}';
+    }
+
+    public Integer getUomRealNameState() {
+        return uomRealNameState;
+    }
+
+    public UomRealNameState setUomRealNameState(Integer uomRealNameState) {
+        this.uomRealNameState = uomRealNameState;
+        return this;
+    }
+
+}

+ 12 - 0
Backend/cloud-sdk/src/main/java/com/dji/sdk/mqtt/state/DockStateDataKeyEnum.java

@@ -50,6 +50,18 @@ public enum DockStateDataKeyEnum {
 
     SILENT_MODE(Set.of("silent_mode"), DockSilentMode.class),
 
+    WIRELESS_LINK_TOPO(Set.of("wireless_link_topo"), DockWirelessLink.class),
+
+    RTCM_INFO(Set.of("rtcm_info"), RtcmInfo.class),
+
+    COMMANDER_FLIGHT_MODE(Set.of("commander_flight_mode"), DockDroneCurrentCommanderFlightMode.class),
+
+    UOM_REAL_NAME_STATE(Set.of("uom_real_name_state"), UomRealNameState.class),
+
+    AR_INFO_SWITCH(Set.of("ar_info_switch"), ArInfoSwitch.class),
+
+    PAYLOADS(Set.of("payloads"), DockPayloadControlSource.class),
+
     ;
 
     private final Set<String> keys;

+ 11 - 2
Backend/cloud-sdk/src/main/java/com/dji/sdk/mqtt/state/StateRouter.java

@@ -49,8 +49,17 @@ public class StateRouter {
                         if(keys.contains("cameras")) {
                             System.out.println("================cameras:" + response.getData().toString());
                         }
-                        if(keys.contains("dongle_infos")) {
-                            System.out.println("================dongle_infos:" + response.getData().toString());
+                        if(keys.contains("commander_flight_mode")) {
+                            System.out.println("================commander_flight_mode:" + response.getData().toString());
+                        }
+                        if(keys.contains("ar_info_switch")) {
+                            System.out.println("================ar_info_switch:" + response.getData().toString());
+                        }
+                        if(keys.contains("uom_real_name_state")) {
+                            System.out.println("================uom_real_name_state:" + response.getData().toString());
+                        }
+                        if(keys.contains("payloads")) {
+                            System.out.println("================payloads:" + response.getData().toString());
                         }
                         return response.setFrom(from)
                                 .setData(Common.getObjectMapper().convertValue(response.getData(), getTypeReference(response.getGateway(), response.getData())));

+ 44 - 0
Backend/sample/src/main/java/com/dji/sample/map/service/impl/OfflineMapService.java

@@ -0,0 +1,44 @@
+package com.dji.sample.map.service.impl;
+
+import com.dji.sdk.cloudapi.map.OfflineMapGetRequest;
+import com.dji.sdk.cloudapi.map.OfflineMapGetResponse;
+import com.dji.sdk.cloudapi.map.OfflineMapSyncProgress;
+import com.dji.sdk.cloudapi.map.api.AbstractOfflineMapService;
+import com.dji.sdk.cloudapi.property.DockDroneOfflineMapEnable;
+import com.dji.sdk.mqtt.MqttReply;
+import com.dji.sdk.mqtt.requests.TopicRequestsRequest;
+import com.dji.sdk.mqtt.requests.TopicRequestsResponse;
+import com.dji.sdk.mqtt.state.TopicStateRequest;
+import com.dji.sdk.mqtt.state.TopicStateResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.messaging.MessageHeaders;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * @author hqjiang
+ * @version 1.0
+ * @date 2024/8/28
+ */
+@Service
+@Slf4j
+public class OfflineMapService extends AbstractOfflineMapService {
+
+    @Override
+    public TopicStateResponse<MqttReply> dockDroneOfflineMapEnable(TopicStateRequest<DockDroneOfflineMapEnable> request, MessageHeaders headers) {
+        log.info("==========dockDroneOfflineMapEnable=========request:"+ request.toString() + ",headers:" + headers.toString());
+        return new TopicStateResponse<MqttReply>().setData(MqttReply.error("dockDroneOfflineMapEnable not implemented"));
+    }
+
+    @Override
+    public TopicRequestsResponse<MqttReply> offlineMapSyncProgress(TopicRequestsRequest<OfflineMapSyncProgress> request, MessageHeaders headers) {
+        log.info("==========offlineMapSyncProgress=========request:"+ request.toString() + ",headers:" + headers.toString());
+        return new TopicRequestsResponse<MqttReply>().setData(MqttReply.error("offlineMapSyncProgress not implemented"));
+    }
+
+    @Override
+    public TopicRequestsResponse<MqttReply<OfflineMapGetResponse>> offlineMapGet(TopicRequestsRequest<OfflineMapGetRequest> request, MessageHeaders headers) {
+        log.info("==========offlineMapGet=========request:"+ request.toString() + ",headers:" + headers.toString());
+        return new TopicRequestsResponse<MqttReply<OfflineMapGetResponse>>().setData(MqttReply.error("offlineMapGet not implemented"));
+    }
+}