NEW: release DJI Payload-SDK version 3.4

Signed-off-by: DJI-Martin <DJI-Martin@dji.com>
This commit is contained in:
DJI-Martin
2023-04-18 21:26:50 +08:00
parent b621c93fde
commit 29109dd0db
106 changed files with 3030521 additions and 1114 deletions

View File

@ -487,7 +487,7 @@ typedef struct {
} T_DjiCameraManagerFileAttributeData;
typedef struct {
char fileName[32];
char fileName[256];
uint32_t fileSize;
uint32_t fileIndex;
T_DjiCameraManagerFileCreateTime createTime;
@ -506,11 +506,47 @@ typedef enum {
DJI_DOWNLOAD_FILE_EVENT_END,
} E_DjiDownloadFileEvent;
/*!< Attention: when the remote control is in split-screen mode, the coordinate range of the x-axis is 0 ~ 0.5
* */
typedef struct {
dji_f32_t pointX; /*! x-coordinate of point thermometry, range: 0 ~ 1 */
dji_f32_t pointY; /*! y-coordinate of point thermometry, range: 0 ~ 1 */
} T_DjiCameraManagerPointThermometryCoordinate;
typedef struct {
dji_f32_t areaTempLtX; /*! x-coordinate of the upper left corner of the area thermometry, range: 0 ~ 1 */
dji_f32_t areaTempLtY; /*! y-coordinate of the upper left corner of the area thermometry, range: 0 ~ 1 */
dji_f32_t areaTempRbX; /*! x-coordinate of the lower right corner of the area thermometry, range: 0 ~ 1 */
dji_f32_t areaTempRbY; /*! y-coordinate of the lower right corner of the area thermometry, range: 0 ~ 1 */
} T_DjiCameraManagerAreaThermometryCoordinate;
//result of point thermometry
typedef struct {
dji_f32_t pointX; /*! x-coordinate of point thermometry, range: 0 ~ 1 */
dji_f32_t pointY; /*! y-coordinate of point thermometry, range: 0 ~ 1 */
dji_f32_t pointTemperature; /*! The temperature of the current point */
} T_DjiCameraManagerPointThermometryData;
//result of area thermometry
typedef struct {
dji_f32_t areaTempLtX; /*! x_coordinate of the upper left corner of the current thermometry area */
dji_f32_t areaTempLtY; /*! y_coordinate of the upper left corner of the current thermometry area */
dji_f32_t areaTempRbX; /*! x_coordinate of the lower right corner of the current thermometry area */
dji_f32_t areaTempRbY; /*! y_coordinate of the lower right corner of the current thermometry area */
dji_f32_t areaAveTemp; /*! The average temperature of the current thermometry area */
dji_f32_t areaMinTemp; /*! The minimum temperature of the current thermometry area */
dji_f32_t areaMaxTemp; /*! The maximum temperature of the current thermometry area */
dji_f32_t areaMinTempPointX; /*! x_coordinate of the minimum temperature in the thermometry area */
dji_f32_t areaMinTempPointY; /*! y_coordinate of the minimum temperature in the thermometry area */
dji_f32_t areaMaxTempPointX; /*! x_coordinate of the maximum temperature in the thermometry area */
dji_f32_t areaMaxTempPointY; /*! y_coordinate of the maximum temperature in the thermometry area */
} T_DjiCameraManagerAreaThermometryData;
typedef struct {
E_DjiDownloadFileEvent downloadFileEvent;
uint32_t fileIndex;
uint32_t fileSize;
float progressInPercent;
dji_f32_t progressInPercent;
} T_DjiDownloadFilePacketInfo;
typedef struct {
@ -1012,6 +1048,47 @@ T_DjiReturnCode DjiCameraManager_DeleteFileByIndex(E_DjiMountPosition position,
*/
T_DjiReturnCode DjiCameraManager_GetLaserRangingInfo(E_DjiMountPosition position,
T_DjiCameraManagerLaserRangingInfo *laserRangingInfo);
/**
* @brief Set point thermometry coordinates of the selected camera mounted position.
* @param position: camera mounted position
* @param pointCoordinate: point thermometry coordinates
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_SetPointThermometryCoordinate(E_DjiMountPosition position,
T_DjiCameraManagerPointThermometryCoordinate pointCoordinate);
/**
* @brief Get point thermometry result.
* @note Before get point thermometry data from camera, DjiCameraManager_SetPointThermometryCoordinate()
* function has to be called.
* @param position: camera mounted position
* @param pointThermometryData: point thermometry result
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_GetPointThermometryData(E_DjiMountPosition position,
T_DjiCameraManagerPointThermometryData *pointThermometryData);
/**
* @brief Set area thermometry coordinates of the selected camera mounted position.
* @param position: camera mounted position
* @param areaCoordinate: area thermometry coordinates
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_SetAreaThermometryCoordinate(E_DjiMountPosition position,
T_DjiCameraManagerAreaThermometryCoordinate areaCoordinate);
/**
* @brief Get area thermometry result.
* @note Before get area thermometry data from camera, DjiCameraManager_SetAreaThermometryCoordinate()
* function has to be called.
* @param position: camera mounted position
* @param areaThermometryData: area thermometry result
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_GetAreaThermometryData(E_DjiMountPosition position,
T_DjiCameraManagerAreaThermometryData *areaThermometryData);
#ifdef __cplusplus
}
#endif

View File

@ -81,6 +81,22 @@ T_DjiReturnCode DjiCore_Init(const T_DjiUserInfo *userInfo);
*/
T_DjiReturnCode DjiCore_SetAlias(const char *productAlias);
/**
* @brief Set custom firmware version for DJI application or product.
* @details Payload firmware version will always display in DJI Pilot payload settings interface.
* @param version: the custom firmware version to be set.
* @return Execution result.
*/
T_DjiReturnCode DjiCore_SetFirmwareVersion(T_DjiFirmwareVersion version);
/**
* @brief Set custom serial number for DJI application or product.
* @details Payload custom serial number will always display in DJI Pilot payload settings interface.
* @param productSerialNumber: the custom serial number to be set, needs to be no larger than 32 bytes.
* @return Execution result.
*/
T_DjiReturnCode DjiCore_SetSerialNumber(const char *productSerialNumber);
/**
* @brief Notify that the Payload SDK core application starts.
* @note The call location of this interface requires special attention, The call needs to be completed after all the

View File

@ -37,6 +37,14 @@ extern "C" {
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef enum {
DJI_HMS_ERROR_LEVEL_NONE = 0,
DJI_HMS_ERROR_LEVEL_HINT,
DJI_HMS_ERROR_LEVEL_WARN,
DJI_HMS_ERROR_LEVEL_CRITICAL,
DJI_HMS_ERROR_LEVEL_FATAL,
} E_DjiHmsErrorLevel;
typedef struct {
uint32_t errorCode;
uint8_t componentIndex;
@ -48,6 +56,17 @@ typedef struct {
uint32_t hmsInfoNum;
} T_DjiHmsInfoTable;
typedef struct {
char *fileName; /*!< The file name of the hms text config file */
uint32_t fileSize; /*!< The file size of the hms text config file, uint : byte */
const uint8_t *fileBinaryArray; /*!< The binary C array of the hms text config file */
} T_DjiHmsFileBinaryArray;
typedef struct {
uint16_t binaryArrayCount; /*!< Binary array count. */
T_DjiHmsFileBinaryArray *fileBinaryArrayList; /*!< Pointer to binary array list */
} T_DjiHmsBinaryArrayConfig;
typedef T_DjiReturnCode (*DjiHmsInfoCallback)(T_DjiHmsInfoTable hmsInfoTable);
/* Exported functions --------------------------------------------------------*/
@ -72,6 +91,60 @@ T_DjiReturnCode DjiHms_DeInit(void);
*/
T_DjiReturnCode DjiHms_RegHmsInfoCallback(DjiHmsInfoCallback callback);
/**
* @brief Inject custom hms error code to APP.
* @note: For the same hms error code, a single call is enough, no need to call repeatedly.
* @param errorCode: hms error code, value range: [0x1E020000 ~ 0x1E02FFFF].
* @param errorLevel: hms error level, see reference of E_DjiHmsErrorLevel.
* @return Execution result.
*/
T_DjiReturnCode DjiHms_InjectHmsErrorCode(uint32_t errorCode, E_DjiHmsErrorLevel errorLevel);
/**
* @brief Eliminate custom hms error code to APP.
* @note: For the same hms error code, a single call is enough, no need to call repeatedly.
* @param errorCode: hms error code, value range: [0x1E020000 ~ 0x1E02FFFF].
* @return Execution result.
*/
T_DjiReturnCode DjiHms_EliminateHmsErrorCode(uint32_t errorCode);
/**
* @brief Register default hms text configuration file by directory path.
* @param configDirPath: the hms text configuration by directory path.
* @return Execution result.
*/
T_DjiReturnCode DjiHms_RegDefaultHmsTextConfigByDirPath(const char *configDirPath);
/**
* @brief Register hms text configuration file by directory path.
* @note Different hms text configurations for several language require the same hms config.
* @param appLanguage: mobile app language type.
* @param configDirPath: the hms text configuration by directory path.
* @return Execution result.
*/
T_DjiReturnCode DjiHms_RegHmsTextConfigByDirPath(E_DjiMobileAppLanguage appLanguage,
const char *configDirPath);
/**
* @brief Register default hms text configuration config by binary array.
* @note In RTOS, most likely there is no file system. The hms text config file content can use C array express. Use this
* function and DjiHms_RegDefaultHmsTextConfigByBinaryArray set hms text configuration. When the language is not cover in
* your setting by DjiHms_RegHmsTextConfigByBinaryArray, the hms text configuration uses setting by this function.
* @param binaryArrayConfig: the binary array config for hms text configuration.
* @return Execution result.
*/
T_DjiReturnCode DjiHms_RegDefaultHmsTextConfigByBinaryArray(const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
/**
* @brief Register hms text config by binary array configuration.
* @note Different hms text configurations for several language require the same hms config.
* @param appLanguage: mobile app language type.
* @param binaryArrayConfig: the binary array config for hms text configuration.
* @return Execution result.
*/
T_DjiReturnCode DjiHms_RegHmsTextConfigByBinaryArray(E_DjiMobileAppLanguage appLanguage,
const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
#ifdef __cplusplus
}
#endif

View File

@ -107,6 +107,15 @@ T_DjiReturnCode DjiLiveview_StartH264Stream(E_DjiLiveViewCameraPosition position
*/
T_DjiReturnCode DjiLiveview_StopH264Stream(E_DjiLiveViewCameraPosition position, E_DjiLiveViewCameraSource source);
/**
* @brief Request the intraframe Frame of Camera H264 Stream by selected position.
* @param position: point out which camera to output the H264 stream
* @param source: point out which sub camera to output the H264 stream
* @return Execution result.
*/
T_DjiReturnCode DjiLiveview_RequestIntraframeFrameData(E_DjiLiveViewCameraPosition position,
E_DjiLiveViewCameraSource source);
#ifdef __cplusplus
}
#endif

View File

@ -357,6 +357,18 @@ typedef struct {
uint32_t microsecond; /*!< Microsecond. */
} T_DjiDataTimestamp;
/**
* @brief The firmware version of payload.
* @note If majorVersion = AA, minorVersion = BB, modifyVersion = CC, debugVersion = DD, The version show in
* terminal APP is AA.BB.CC.DD
*/
typedef struct {
uint8_t majorVersion; /*!< The major version of firmware, the range is 0 ~ 99. */
uint8_t minorVersion; /*!< The minor version of firmware, the range is 0 ~ 99. */
uint8_t modifyVersion; /*!< The modify version of firmware, the range is 0 ~ 99. */
uint8_t debugVersion; /*!< The debug version of firmware, the range is 0 ~ 99. */
} T_DjiFirmwareVersion;
#pragma pack ()
/**
* @brief Prototype of callback function used to receive data of topic.

View File

@ -69,18 +69,6 @@ typedef enum {
DJI_UPGRADE_END_STATE_UNKNOWN_ERROR = 2, /*!< Upgrade failure due to unknown reason. */
} E_DjiUpgradeEndState;
/**
* @brief The firmware version of payload.
* @note If majorVersion = AA, minorVersion = BB, modifyVersion = CC, debugVersion = DD, The version show in
* terminal APP is AA.BB.CC.DD
*/
typedef struct {
uint8_t majorVersion; /*!< The major version of firmware, the range is 0 ~ 99. */
uint8_t minorVersion; /*!< The minor version of firmware, the range is 0 ~ 99. */
uint8_t modifyVersion; /*!< The modify version of firmware, the range is 0 ~ 99. */
uint8_t debugVersion; /*!< The debug version of firmware, the range is 0 ~ 99. */
} T_DjiFirmwareVersion;
typedef struct {
uint8_t upgradeProgress; /*!< The upgrade progress, the range is 0 ~ 100. */
} T_DjiUpgradeOngoingInfo;

View File

@ -34,10 +34,10 @@ extern "C" {
/* Exported constants --------------------------------------------------------*/
#define DJI_VERSION_MAJOR 3 /*!< DJI SDK major version num, when have incompatible API changes. Range from 0 to 99. */
#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_MINOR 4 /*!< 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 1705 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
#define DJI_VERSION_BUILD 1743 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
/* Exported types ------------------------------------------------------------*/

View File

@ -48,27 +48,47 @@ typedef enum {
} E_DjiWaypointV3Action;
/**
* Waypoint v3 current aircraft state.
* Waypoint v3 current mission state.
*/
typedef enum {
DJI_WAYPOINT_V3_STATE_IDLE = 0, /*!< Waypoint v3 aircraft in idle state. */
DJI_WAYPOINT_V3_STATE_PREPARE = 16, /*!< Waypoint v3 aircraft in prepare state. */
DJI_WAYPOINT_V3_STATE_TRANS_MISSION = 32, /*!< Waypoint v3 aircraft in trans mission state. */
DJI_WAYPOINT_V3_STATE_MISSION = 48, /*!< Waypoint v3 aircraft in mission state. */
DJI_WAYPOINT_V3_STATE_BREAK = 64, /*!< Waypoint v3 aircraft in break state. */
DJI_WAYPOINT_V3_STATE_RESUME = 80, /*!< Waypoint v3 aircraft in resume state. */
DJI_WAYPOINT_V3_STATE_RETURN_FIRSTPOINT = 98, /*!< Waypoint v3 aircraft in return first point state. */
} E_DjiWaypointV3State;
DJI_WAYPOINT_V3_MISSION_STATE_IDLE = 0, /*!< Waypoint v3 mission in idle state. */
DJI_WAYPOINT_V3_MISSION_STATE_PREPARE = 16, /*!< Waypoint v3 mission in prepare state. */
DJI_WAYPOINT_V3_MISSION_STATE_TRANS_MISSION = 32, /*!< Waypoint v3 mission in trans mission state. */
DJI_WAYPOINT_V3_MISSION_STATE_MISSION = 48, /*!< Waypoint v3 mission in mission state. */
DJI_WAYPOINT_V3_MISSION_STATE_BREAK = 64, /*!< Waypoint v3 mission in break state. */
DJI_WAYPOINT_V3_MISSION_STATE_RESUME = 80, /*!< Waypoint v3 mission in resume state. */
DJI_WAYPOINT_V3_MISSION_STATE_RETURN_FIRSTPOINT = 98, /*!< Waypoint v3 mission in return first point state. */
} E_DjiWaypointV3MissionState;
/**
* Waypoint v3 current action state.
*/
typedef enum {
DJI_WAYPOINT_V3_ACTION_STATE_IDLE = 0, /*!< Waypoint v3 action in idle state. */
DJI_WAYPOINT_V3_ACTION_STATE_RUNNING = 1, /*!< Waypoint v3 action in idle state. */
DJI_WAYPOINT_V3_ACTION_STATE_FINISHED = 5, /*!< Waypoint v3 action in idle state. */
} E_DjiWaypointV3ActionState;
/**
* Waypoint v3 mission state.
*/
typedef struct {
E_DjiWaypointV3State state; /*!< Waypoint v3 current aircraft state, #E_DjiWaypointV3State. */
E_DjiWaypointV3MissionState state; /*!< Waypoint v3 current mission state, #E_DjiWaypointV3MissionState. */
uint32_t wayLineId; /*!< Waypoint v3 current way line id. */
uint16_t currentWaypointIndex; /*!< Waypoint v3 current waypoint index. */
} T_DjiWaypointV3MissionState;
/**
* Waypoint v3 action state.
*/
typedef struct {
E_DjiWaypointV3ActionState state; /*!< Waypoint v3 current action state, #E_DjiWaypointV3ActionState. */
uint32_t wayLineId; /*!< Waypoint v3 current way line id. */
uint16_t currentWaypointIndex; /*!< Waypoint v3 current waypoint index. */
uint16_t actionGroupId; /*!< Waypoint v3 current action group index. */
uint16_t actionId; /*!< Waypoint v3 current action index. */
} T_DjiWaypointV3ActionState;
/**
* @brief Prototype of callback function used to receive the waypoint v3 mission state.
* @warning User can not execute blocking style operations or functions in callback function, because that will block
@ -76,7 +96,16 @@ typedef struct {
* @param missionState: current waypoint v3 mission state.
* @return Execution result.
*/
typedef T_DjiReturnCode (*WaypointV3StateCallback)(T_DjiWaypointV3MissionState missionState);
typedef T_DjiReturnCode (*WaypointV3MissionStateCallback)(T_DjiWaypointV3MissionState missionState);
/**
* @brief Prototype of callback function used to receive the waypoint v3 mission state.
* @warning User can not execute blocking style operations or functions in callback function, because that will block
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
* @param missionState: current waypoint v3 mission state.
* @return Execution result.
*/
typedef T_DjiReturnCode (*WaypointV3ActionStateCallback)(T_DjiWaypointV3ActionState missionState);
/* Exported functions --------------------------------------------------------*/
/**
@ -112,7 +141,15 @@ T_DjiReturnCode DjiWaypointV3_Action(E_DjiWaypointV3Action action);
* file or executing this mission action.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_RegMissionStateCallback(WaypointV3StateCallback callback);
T_DjiReturnCode DjiWaypointV3_RegMissionStateCallback(WaypointV3MissionStateCallback callback);
/**
* @brief Register the action state callback for waypoint mission.
* @note If you want to monitor the state of waypoint action, this interface should be called before uploading kmz
* file or executing this mission action.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_RegActionStateCallback(WaypointV3ActionStateCallback callback);
#ifdef __cplusplus
}