wangmengmeng
2024-12-24 24432a361d5c6bd6f3d8c008693e9f1155d62517
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package com.dji.sdk.cloudapi.debug;
 
import com.dji.sdk.common.IErrorInfo;
import com.dji.sdk.mqtt.events.IEventsErrorCode;
import com.dji.sdk.mqtt.services.IServicesErrorCode;
 
import java.util.Arrays;
 
/**
 * @author sean.zhou
 * @version 0.1
 * @date 2021/11/25
 */
public enum DebugErrorCodeEnum implements IServicesErrorCode, IEventsErrorCode, IErrorInfo {
 
    AIRCRAFT_NO_DONGLE(326002, "The DJI Cellular module is not installed on the aircraft."),
 
    AIRCRAFT_DONGLE_NO_SIM(326003, "There is no SIM card installed in the DJI Cellular module of the aircraft."),
 
    AIRCRAFT_DONGLE_NEED_UPGRADE(326004, "The DJI Cellular module of the aircraft needs to be upgraded, otherwise it cannot be used."),
 
    ESTABLISH_CONNECTION_FAILED(326005, "The 4G transmission of the aircraft fails to be enabled, and the 4G transmission cannot establish a connection. Please check the 4G signal strength, or consult the operator to check the package traffic and APN settings."),
 
    SDR_SWITCH_FAILED(326006, "The 4G transmission switch failed, please try again later."),
 
    WRONG_COMMAND_FORMAT(326007, "The command format is wrong."),
 
    DOCK_NO_DONGLE(326008, "The DJI Cellular module is not installed on the dock."),
 
    DOCK_DONGLE_NO_SIM(326009, "There is no SIM card installed in the DJI Cellular module of the dock."),
 
    DOCK_DONGLE_NEED_UPGRADE(326010, "The DJI Cellular module of the dock needs to be upgraded, otherwise it cannot be used."),
 
    COMMAND_NOT_SUPPORTED(514100, "Dock error. Restart dock and try again."),
 
    PUSH_DRIVING_RODS_FAILED(514101, "Failed to push driving rods into place."),
 
    PULL_DRIVING_RODS_FAILED(514102, "Failed to pull driving rods back."),
 
    LOW_POWER_1(514103, "Aircraft battery level low. Unable to perform task. Wait until aircraft is charged up to 50% and try again."),
 
    CHARGE_FAILED(514104, "Failed to charge battery."),
 
    STOP_CHARGING_FAILED(514105, "Failed to stop charging battery."),
 
    REBOOT_DRONE_FAILED(514106, "Failed to reboot drone."),
 
    OPEN_DOCK_COVER_FAILED(514107, "Failed to open dock cover."),
 
    CLOSE_DOCK_COVER_FAILED(514108, "Failed to close dock cover."),
 
    POWER_ON_AIRCRAFT_FAILED(514109, "Failed to power on aircraft."),
 
    POWER_OFF_AIRCRAFT_FAILED(514110, "Failed to power off aircraft."),
 
    OPEN_SLOW_MOTION_FAILED(514111, "Propeller error in opening slow motion mode"),
 
    CLOSE_SLOW_MOTION_FAILED(514112, "Propeller error in closing slow motion mode"),
 
    AIRCRAFT_NOT_FOUND_1(514113, "Connection error between driving rod and aircraft. Check if aircraft is inside dock, driving rods are stuck, or charging connector is stained or damaged."),
 
    OBTAIN_BATTERY_FAILED(514114, "Failed to obtain aircraft battery status. Restart dock and try again."),
 
    DOCK_BUSY(514116, "Unable to perform operation. Dock is executing other command. Try again later."),
 
    OBTAIN_DOCK_COVER_FAILED(514117, "Dock cover is open or not fully closed. Restart dock and try again"),
 
    OBTAIN_DRIVING_RODS_FAILED(514118, "Driving rods pulled back or not pushed into place. Restart dock and try again."),
 
    TRANSMISSION_ERROR(514120, "Dock and aircraft disconnected. Restart dock and try again or relink dock and aircraft."),
 
    EMERGENCY_BUTTON_PRESSED_DOWN(514121, "Emergency stop button pressed down. Release button."),
 
    OBTAIN_CHARGING_STATUS_FAILED(514122, "Failed to obtain aircraft charging status. Restart dock and try again."),
 
    LOW_POWER_2(514123, "Aircraft battery level too low. Unable to power on aircraft."),
 
    OBTAIN_BATTERY_STATUS_FAILED(514124, "Failed to obtain aircraft battery information."),
 
    BATTERY_FULL(514125, "Aircraft battery level almost full. Unable to start charging. Charge battery when battery level is lower than 95%."),
 
    HEAVY_RAINFALL(514134, "Heavy rainfall. Unable to perform task. Try again later."),
 
    HIGH_WIND(514135, "Wind speed too high (≥12 m/s). Unable to perform task. Try again later."),
 
    POWER_SUPPLY_ERROR(514136, "Dock power supply error. Unable to perform task. Resume power supply and try again."),
 
    LOW_ENVIRONMENT_TEMPERATURE(514137, "Environment temperature too low (lower than -20° C). Unable to perform task. Try again later."),
 
    BATTERY_MAINTAINING(514138, "Maintaining aircraft battery. Unable to perform task. Wait until maintenance is complete."),
 
    MAINTAIN_BATTERY_FAILED(514139, "Failed to maintain aircraft battery. No maintenance required."),
 
    SETTING_BATTERY_STORAGE_FAILED(514140, "Failed to set battery storage mode."),
 
    DOCK_SYSTEM_ERROR(514141, "Dock system error. Restart dock and try again."),
 
    AIRCRAFT_NOT_FOUND_2(514142, "Connection error between driving rod and aircraft before takeoff. Check if aircraft is inside dock, driving rods are stuck, or charging connector is stained or damaged."),
 
    DRIVING_RODS_ERROR(514143, "Driving rods pulled back or not pushed into place. Try again later or restart dock and try again."),
 
    DOCK_COVER_ERROR(514144, "Dock cover is open or not fully closed."),
 
    ONSITE_DEBUGGING_MODE(514145, "Dock in onsite debugging mode. Unable to perform current operation or task."),
 
    REMOTE_DEBUGGING_MODE(514146, "Dock in remote debugging mode. Unable to perform task."),
 
    FIRMWARE_UPDATING(514147, "Updating device firmware. Unable to perform task."),
 
    WORKING(514148, "Task in progress. Dock unable to enter remote debugging mode or perform task again. "),
 
    WRONG_STATUS(514149, "The airport is not in operation mode, but an operation mode-related command has been issued."),
 
    RESTARTING(514150, "Restarting device."),
 
    UPDATING(514151, "Updating device firmware."),
 
    NOT_REMOTE_DEBUGGING_MODE(514153, "Dock exited remote debugging mode. Unable to perform current operation."),
 
    INITIALIZING(514170, "Initializing dock. Unable to perform operation. Wait until initialization completes."),
 
    WRONG_PARAMETER(514171, "Cloud command parameter error. Dock unable to execute command."),
 
    DISABLE_AC_FAILED(514180, "Failed to disable AC cooling or heating."),
 
    ENABLE_AC_COOLING_FAILED(514181, "Failed to enable AC cooling."),
 
    ENABLE_AC_HEATING_FAILED(514182, "Failed to enable AC heating."),
 
    ENABLE_AC_DEHUMIDIFYING_FAILED(514183, "Failed to enable AC dehumidifying."),
 
    LOW_TEMPERATURE(514184, "Ambient temperature below 0° C. Unable to enable AC cooling."),
 
    HIGH_TEMPERATURE(514185, "Ambient temperature above 45° C. Unable to enable AC heating"),
 
    UNKNOWN(-1, "UNKNOWN"),
 
    ;
 
 
    private final String msg;
 
    private final int code;
 
    DebugErrorCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
 
    @Override
    public String getMessage() {
        return this.msg;
    }
 
    @Override
    public Integer getCode() {
        return this.code;
    }
 
    /**
     * @param code error code
     * @return enumeration object
     */
    public static DebugErrorCodeEnum find(int code) {
        return Arrays.stream(values()).filter(codeEnum -> codeEnum.code == code).findAny().orElse(UNKNOWN);
    }
 
}