30 #ifndef ADVANCED_SENSING_DJI_BATTERY_IMPL_H 31 #define ADVANCED_SENSING_DJI_BATTERY_IMPL_H 34 #include "dji_platform.hpp" 43 uint32_t isFakeSingleBatteryMode:1;
44 uint32_t isSingleBatteryMode:1;
45 uint32_t batteryPowerOffWarning:1;
46 uint32_t batteryShutDownProtection:1;
49 uint32_t batteryNotReady:1;
54 uint32_t batteryCommunicationError:1;
55 uint32_t batteryCellError:1;
56 uint32_t lv2LowVoltageAlarm:1;
57 uint32_t lv1LowVoltageAlarm:1;
58 uint32_t smartBatteryLanding:1;
59 uint32_t smartBatteryGoHome:1;
60 uint32_t seriousLowCapacityAlarm:1;
61 uint32_t LowCapacityAlarm:1;
70 uint16_t remainFlyTime;
71 uint16_t goHomeNeedTime;
78 uint8_t goHomeCountDownState;
86 uint8_t lowBatteryAlarmEnable:1;
87 uint8_t seriousLowBatteryAlarmThreshold:7;
88 uint8_t seriousLowBatteryAlarmEnable:1;
89 uint8_t batteryType:2;
95 DJI_APP_FIRAMWARE = 0,
96 DJI_LOADER_FIRMWARE = 1,
100 typedef struct DJISmartBatteryStateImpl {
101 uint32_t firstLevelElectric :1;
102 uint32_t secondLevelElectric :1;
103 uint32_t firstLevelOverHeating :1;
104 uint32_t secondLevelOverHeating :1;
105 uint32_t firstLevelLowTemperature :1;
106 uint32_t secondLevelLowTemperature:1;
107 uint32_t shortCut :1;
108 uint32_t cellUnderVoltage :5;
109 uint32_t cellBreak :5;
110 uint32_t selfCheckError :3;
112 uint32_t dischargeDuringStorage :1;
113 uint32_t electricityOver :1;
114 uint32_t pressKeyClose :1;
115 uint32_t firmwareAbnormal :1;
116 uint32_t sopWarning :1;
117 uint32_t reserved2 :1;
118 uint32_t batteryClosedReason :5;
119 uint8_t mosCONTROL :3;
120 uint8_t isBatteryMosReady:1;
121 uint8_t batteryEndLife :1;
123 uint8_t batSOHState :2;
124 uint8_t maxCycleLimit:6;
125 uint8_t reserved3 :2;
126 uint16_t lessBattery :1;
127 uint16_t batteryCommunicationAbnormal:1;
128 uint16_t voltageDiffOverRange1 :1;
129 uint16_t voltageDiffOverRange2 :1;
130 uint16_t hasCellLowVoltages :1;
131 uint16_t hasCellBreak :1;
132 uint16_t hasDiffBatteryFirmware :1;
133 uint16_t hasSocLow :1;
134 uint16_t hasBatteryPowerSupplyAbnormal :1;
135 uint16_t cellDiffVoltageOverRange:1;
136 uint16_t isBatteryEmbed :1;
137 uint16_t heatState :2;
138 uint16_t socState :3;
139 } DJISmartBatteryStateImpl;
141 typedef struct SmartBatteryDynamicInfoImpl {
143 uint8_t batteryIndex;
144 int32_t currentVoltage;
145 int32_t currentElectric;
146 uint32_t fullCapacity;
147 uint32_t remainedCapacity;
148 int16_t batteryTemperature;
150 uint8_t batteryCapacityPercent;
151 DJISmartBatteryStateImpl batteryState;
152 uint8_t batteryPrtocolVersion;
154 uint8_t batteryNumber;
157 } SmartBatteryDynamicInfoImpl;
159 const uint8_t MaxSmartBatteryNum = 2;
163 class DJIBatteryImpl {
165 DJIBatteryImpl(Vehicle* vehicle);
171 void setBatteryWholeInfo(
const uint8_t *batteryData,
const uint16_t dataLen);
174 bool createBatteryInfoLock();
175 bool lockBatteryInfo();
176 bool freeBatteryInfo();
177 bool destroyBatteryInfoLock();
181 T_OsdkMutexHandle m_batteryLock;
187 #endif //ADVANCED_SENSING_DJI_BATTERY_IMPL_H struct DJI::OSDK::DJIWholeBatteryStateImpl DJIWholeBatteryStateImpl
uint16_t landNeedCapacity
Definition: dji_battery_impl.hpp:74
uint16_t voltage
Definition: dji_battery_impl.hpp:83
uint8_t gohomeCountDownvalue
Definition: dji_battery_impl.hpp:82
DJIWholeBatteryStateImpl batteryState
Definition: dji_battery_impl.hpp:77
uint16_t goHomeNeedCapacity
Definition: dji_battery_impl.hpp:73
Definition: dji_battery_impl.hpp:69
uint8_t lowBatteryAlarmThreshold
Definition: dji_battery_impl.hpp:85
float capacityConsumeSpeed
Definition: dji_battery_impl.hpp:76
uint32_t verySeriousLowVoltage
Definition: dji_battery_impl.hpp:53
DJIBatteryFirmwareAbnormalImpl
Definition: dji_battery_impl.hpp:94
Definition: dji_battery_impl.hpp:41
Data type and Data Structure definitions for use throughout DJI OSDK.
float safeFlyRadius
Definition: dji_battery_impl.hpp:75
uint32_t powerLimit
Definition: dji_battery_impl.hpp:47
Definition: dji_ack.cpp:38
uint8_t batteryCapacityPercentage
Definition: dji_battery_impl.hpp:84
uint32_t voltageNotSafety
Definition: dji_battery_impl.hpp:51
uint32_t firstChargeNotFull
Definition: dji_battery_impl.hpp:48
struct DJI::OSDK::BatteryWholeInfoImpl BatteryWholeInfoImpl
uint16_t landNeedTime
Definition: dji_battery_impl.hpp:72