FIX: fixed the following issues

1.fixed the problem of setting the gimbal mode abnormally when the gimbal is not rotated.
2.fixed the waypoint v2 mission state enum description error.
3.fixed the problem that large-capacity video download fails on M30/M30T.
4.added the api doc for uart available baudrate list.
5.added the enum defines for single smart battery info.

Signed-off-by: DJI-Martin <DJI-Martin@dji.com>
This commit is contained in:
DJI-Martin
2023-03-06 22:48:59 +08:00
parent 84714c112a
commit 23c461830a
18 changed files with 109 additions and 58 deletions

View File

@ -662,6 +662,67 @@ typedef enum {
DJI_FC_SUBSCRIPTION_HOME_POINT_SET_STATUS_SUCCESS = 1, /*!< The home point was set successfully. */
} E_DjiFcSubscriptionHomePointSetStatus;
/**
* @brief Smart battery self-check result.
*/
typedef enum {
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_NORMAL = 0, /*!< Battery self-check is normal. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_NTC_ABNORMAL = 1, /*!< Battery self-check NTC is abnormal. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_MOS_ABNORMAL = 2, /*!< Battery self-check MOS is abnormal. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_R_ABNORMAL = 3, /*!< Battery self-check sampling resistance is abnormal. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_CELL_DAMAGE = 4, /*!< Battery cell self-check is damaged. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_CAL_EXP = 5, /*!< Battery self-check is not calibrated. */
DJI_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_GAUGE_PARM_EXP = 6, /*!< Battery self-check fuel gauge parameters is abnormal. */
} E_DJIFcSubscriptionBatterySelfCheck;
/**
* @brief Smart battery closed reason.
*/
typedef enum {
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_NORMAL = 0, /*!< Battery closed reason is normal shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_FORCED = 1, /*!< Battery closed reason is forced by flight controller shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_SCD = 2, /*!< Battery closed reason is discharge short circuit shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_OLD = 3, /*!< Battery closed reason is discharge overload shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_OCD = 4, /*!< Battery closed reason is discharge over current shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_UVD = 5, /*!< Battery closed reason is discharge under voltage shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_OTD = 6, /*!< Battery closed reason is discharge over temperature shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_SCC = 16, /*!< Battery closed reason is charging short circuit shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_OCC = 17, /*!< Battery closed reason is charging over current shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_OVC = 18, /*!< Battery closed reason is charging over voltage shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_CHARGER_OVC = 19, /*!< Battery closed reason is charger over voltage shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_LTC = 20, /*!< Battery closed reason is charging low temperature shutdown. */
DJI_FC_SUBSCRIPTION_BATTERY_CLOSED_HTC = 21, /*!< Battery closed reason is charging high temperature shutdown. */
} E_DJIFcSubscriptionBatteryClosedReason;
/**
* @brief Smart battery SOH state.
*/
typedef enum {
DJI_FC_SUBSCRIPTION_BATTERY_SOH_NORMAL = 0, /*!< Battery SOH state is normal. */
DJI_FC_SUBSCRIPTION_BATTERY_SOH_ALERT = 1, /*!< Battery SOH state is alert. */
DJI_FC_SUBSCRIPTION_BATTERY_SOH_SAFE = 2, /*!< Battery SOH state is safe. */
} E_DJIFcSubscriptionBatterySohState;
/**
* @brief Smart battery heart state.
*/
typedef enum {
DJI_FC_SUBSCRIPTION_BATTERY_NO_HEAT = 0, /*!< Battery is in no heat state. */
DJI_FC_SUBSCRIPTION_BATTERY_IN_HEAT = 1, /*!< Battery is in heat state. */
DJI_FC_SUBSCRIPTION_BATTERY_KEEP_WARM = 2, /*!< Battery is in keep warm state. */
} E_DJIFcSubscriptionBatteryHeatState;
/**
* @brief Smart battery SOC state.
*/
typedef enum {
DJI_FC_SUBSCRIPTION_BATTERY_SOC_NORMAL = 0, /*!< Battery SOC state is normal. */
DJI_FC_SUBSCRIPTION_BATTERY_SOC_ABNORMAL_HIGH = 1, /*!< Battery SOC state is abnormal high. */
DJI_FC_SUBSCRIPTION_BATTERY_SOC_JUMP_DOWN = 2, /*!< Battery SOC state is jump down. */
DJI_FC_SUBSCRIPTION_BATTERY_SOC_JUMP_UP = 3, /*!< Battery SOC state is jump up. */
DJI_FC_SUBSCRIPTION_BATTERY_SOC_INVALID = 4, /*!< Battery SOC state is invalid. */
} E_DJIFcSubscriptionBatterySocState;
#pragma pack(1)
/**
@ -885,22 +946,22 @@ typedef uint16_t T_DjiFcSubscriptionMotorStartError;
typedef struct {
uint32_t reserved: 12;
uint32_t cellBreak: 5; /*! 0:normal;other:Undervoltage core index(0x01-0x1F)*/
uint32_t selfCheckError: 3; /*! enum-type: DJISmartBatterySelfCheck*/
uint32_t cellBreak: 5; /*!< 0: normal; other: under voltage core index(0x01-0x1F). */
uint32_t selfCheckError: 3; /*!< enum-type: E_DJIFcSubscriptionBatterySelfCheck. */
uint32_t reserved1: 7;
uint32_t batteryClosedReason: 5; /*! enum-type: DJI_BETTERY_CLOSED_REASON*/
uint8_t reserved2: 6; /*! [0]CHG state[1]DSG state[2]ORING state*/
uint8_t batSOHState: 2; /*! enum-type: DJISmartBatterySohState*/
uint8_t maxCycleLimit: 6; /*! APP:cycle_limit*10*/
uint32_t batteryClosedReason: 5; /*!< enum-type: E_DJIFcSubscriptionBatteryClosedReason. */
uint8_t reserved2: 6; /*!< 0: CHG state; 1: DSG state; 2: ORING state. */
uint8_t batSOHState: 2; /*!< enum-type: E_DJIFcSubscriptionBatterySohState. */
uint8_t maxCycleLimit: 6; /*!< APP: cycle_limit*10. */
uint8_t reserved3: 2;
uint16_t lessBattery: 1;
uint16_t batteryCommunicationAbnormal: 1;
uint16_t reserved4: 3;
uint16_t hasCellBreak: 1;
uint16_t reserved5: 4;
uint16_t isBatteryEmbed: 1; /*! 0:embed;1:unmebed*/
uint16_t heatState: 2; /*!enum-type: DJISmartBatteryHeatState*/
uint16_t socState: 3; /*!enum-type: DJISmartBatterySocWarning*/
uint16_t isBatteryEmbed: 1; /*!< 0:embed; 1:not embed. */
uint16_t heatState: 2; /*!< enum-type: E_DJIFcSubscriptionBatteryHeatState. */
uint16_t socState: 3; /*!< enum-type: E_DJIFcSubscriptionBatterySocState. */
} T_DjiFcSubscriptionSingleBatteryState;
/**
@ -916,17 +977,17 @@ typedef struct BatteryWholeInfo {
typedef struct BatterySingleInfo {
uint8_t reserve;
uint8_t batteryIndex;
int32_t currentVoltage; /*! uint:mV*/
int32_t currentElectric; /*!uint:mA*/
uint32_t fullCapacity; /*!uint:mAh*/
uint32_t remainedCapacity; /*!uint:mAh*/
int16_t batteryTemperature; /*!uint:℃*/
int32_t currentVoltage; /*!< uint:mV. */
int32_t currentElectric; /*!< uint:mA. */
uint32_t fullCapacity; /*!< uint:mAh. */
uint32_t remainedCapacity; /*!< uint:mAh. */
int16_t batteryTemperature; /*!< uint:℃. */
uint8_t cellCount;
uint8_t batteryCapacityPercent; /*!uint:%*/
uint8_t batteryCapacityPercent; /*!< uint:%. */
T_DjiFcSubscriptionSingleBatteryState batteryState;
uint8_t reserve1;
uint8_t reserve2;
uint8_t SOP; /*!Relative power percentage*/
uint8_t SOP; /*!< Relative power percentage. */
} T_DjiFcSubscriptionSingleBatteryInfo;
/*!

View File

@ -83,7 +83,18 @@ typedef void *T_DjiDirHandle;
typedef void *T_DjiSocketHandle;
typedef enum {
/**
* All aircraft type supportusers can connect via chip serial port or USB to TTL serial port.
* Baud rate support list on M300 RTK Payload Port: 115200, 230400, 460800, 921600.
* Baud rate support list on M300 RTK Extension Port: 115200, 230400, 460800, 921600, 1000000.
* Baud rate support list on M30/M30T: 115200, 230400, 460800, 921600, 1000000.
* Baud rate support list on M3E/M3T: 921600.
* */
DJI_HAL_UART_NUM_0,
/**
* Only support on M300 RTK Extension Port by USB virtual serial port, such as /dev/ttyACM0.
* Baud rate support list on M300 RTK Extension Port: 921600.
* */
DJI_HAL_UART_NUM_1,
} E_DjiHalUartNum;

View File

@ -37,7 +37,7 @@ extern "C" {
#define DJI_VERSION_MINOR 3 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
#define DJI_VERSION_MODIFY 0 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
#define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
#define DJI_VERSION_BUILD 1684 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
#define DJI_VERSION_BUILD 1695 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
/* Exported types ------------------------------------------------------------*/

View File

@ -37,6 +37,7 @@ extern "C" {
/* Exported types ------------------------------------------------------------*/
typedef dji_f32_t T_DjiWaypointV2GlobalCruiseSpeed;
/**
* Actions will be taken when the waypoint mission is finished.
*/
@ -217,52 +218,44 @@ typedef enum {
DJI_WAYPOINT_V2_TURN_MODE_UNKNOWN = 0xFF,
} E_DJIWaypointV2TurnMode;
/**
* All the possible state of ``WaypointV2MissionOperator``.
*/
typedef enum {
/**
* The state of the operator is unknown. It is the initial state when the operator
* is just created.
*/
DJI_WAYPOINT_V2_MISSION_STATE_UNKNOWN = -1,
* Waypoint mission state is ground station not start.
*/
DJI_WAYPOINT_V2_MISSION_STATE_GROUND_STATION_NOT_START = 0,
/**
* The connection OSDK device, remote controller and aircraft is
* broken.
* Waypoint mission state is mission prepared.
*/
DJI_WAYPOINT_V2_MISSION_STATE_DISCONNECTED = 0,
DJI_WAYPOINT_V2_MISSION_STATE_MISSION_PREPARED = 1,
/**
* Raed to execute the mission.
* Waypoint mission state is enter mission.
*/
DJI_WAYPOINT_V2_MISSION_STATE_READY_TO_EXECUTE = 1,
DJI_WAYPOINT_V2_MISSION_STATE_ENTER_MISSION = 2,
/**
* The execution is started successfully.
* Waypoint mission state is execute flying route mission.
*/
DJI_WAYPOINT_V2_MISSION_STATE_EXECUTING = 2,
DJI_WAYPOINT_V2_MISSION_STATE_EXECUTING = 3,
/**
* Waypoint mission is paused successfully.
* Waypoint mission state is pause state.
*/
DJI_WAYPOINT_V2_MISSION_STATE_INTERRUPTED = 3,
DJI_WAYPOINT_V2_MISSION_STATE_PAUSED = 4,
/**
* Waypoint mission is restarted after interrupted.
* Waypoint mission state is enter mission after ending pause.
*/
DJI_WAYPOINT_V2_MISSION_STATE_RESUME_AFTER_INTERRUPTED = 4,
DJI_WAYPOINT_V2_MISSION_STATE_ENTER_MISSION_AFTER_ENDING_PAUSE = 5,
/**
* Waypoint mission is exited.
* Waypoint mission state is exit mission.
*/
DJI_WAYPOINT_V2_MISSION_STATE_EXIT_MISSION = 5,
/**
* Waypoint mission is finished.
*/
DJI_WAYPOINT_V2_MISSION_STATE_FINISHED_MISSION = 6,
DJI_WAYPOINT_V2_MISSION_STATE_EXIT_MISSION = 6,
} E_DJIWaypointV2MissionState;
/*! waypoint position relative to WayPointV2InitSettings's reference point
@ -371,8 +364,6 @@ typedef struct {
uint16_t waypointV2Num;
} T_DjiWaypointV2List;
//Action Notes
/**
* Possible types of action trigger.
*/
@ -450,7 +441,6 @@ typedef enum {
DJI_WAYPOINT_V2_ACTION_INTERVAL_TYPE_UNKNOWN = 0xFF,
} E_DJIWaypointV2ActionIntervalType;
/**
* Possible types of action actuator.
*/
@ -638,7 +628,6 @@ typedef struct {
} T_DJIWaypointV2IntervalTriggerParam;
typedef struct {
//see "E_DJIWaypointV2ActionTriggerType"
uint8_t actionTriggerType;
@ -650,7 +639,6 @@ typedef struct {
};
} T_DJIWaypointV2Trigger;
/*! Focus point parameter
*/
typedef struct {
@ -968,7 +956,7 @@ typedef struct {
dji_f64_t refLati;
dji_f64_t refLong;
dji_f32_t refAlti;
} T_WayPointV2InitSettingsInternal;// pack(1)
} T_WayPointV2InitSettingsInternal;
/*! Mission's event data
*/
@ -1049,24 +1037,15 @@ typedef struct {
uint8_t event;
uint32_t FCTimestamp;
U_DjiWaypointV2EventData data;
} T_DjiWaypointV2MissionEventPush;// pack(1)
} T_DjiWaypointV2MissionEventPush;
#pragma pack()
/*! Mission's state push data
*/
typedef struct {
uint16_t curWaypointIndex;
/*!
* 0x0:ground station not start.
* 0x1:mission prepared.
* 0x2:enter mission.
* 0x3:execute flying route mission.
* 0x4:pause state.
* 0x5:enter mission after ending pause.
* 0x6:exit mission.
*/
uint8_t state;
uint16_t velocity; //uint:0.01m/s
uint8_t state; /*!< enum-type: E_DJIWaypointV2MissionState. */
uint16_t velocity; /*!< Uint:0.01m/s. */
} T_DjiWaypointV2MissionStatePush;
typedef struct {