NEW: release DJI Payload-SDK version 3.1

Signed-off-by: DJI-Martin <DJI-Martin@dji.com>
This commit is contained in:
DJI-Martin
2022-03-21 22:25:37 +08:00
parent 7b5f853e87
commit 0e06bc3fd3
62 changed files with 9042 additions and 348 deletions

View File

@ -509,6 +509,17 @@ typedef struct {
uint8_t progressInPercent;
} T_DjiDownloadFilePacketInfo;
typedef struct {
dji_f64_t longitude; /*! Range: [-180,180] */
dji_f64_t latitude; /*! Range: [-90,90] */
int32_t altitude; /*! Unit: 0.1m */
int32_t distance; /*! Unit: 0.1m */
int16_t screenX; /*! Unit: 0.1% */
int16_t screenY; /*! Unit: 0.1% */
bool enable_lidar;
bool exception;
} T_DjiCameraManagerLaserRangingInfo;
typedef T_DjiReturnCode (*DjiCameraManagerDownloadFileDataCallback)(T_DjiDownloadFilePacketInfo packetInfo,
const uint8_t *data,
uint16_t dataLen);
@ -976,6 +987,14 @@ T_DjiReturnCode DjiCameraManager_DownloadFileByIndex(E_DjiMountPosition position
*/
T_DjiReturnCode DjiCameraManager_DeleteFileByIndex(E_DjiMountPosition position, uint32_t fileIndex);
/**
* @brief Get the camera laser ranging info of the selected camera mounted position.
* @param position: the mount position of the camera
* @param laserRangingInfo: the pointer to the camera laser ranging info
* @return Execution result.
*/
T_DjiReturnCode DjiCameraManager_GetLaserRangingInfo(E_DjiMountPosition position,
T_DjiCameraManagerLaserRangingInfo *laserRangingInfo);
#ifdef __cplusplus
}
#endif

View File

@ -55,7 +55,7 @@ typedef struct {
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialize the Onboard SDK core in blocking mode.
* @brief Initialize the Payload SDK core in blocking mode.
* @note The call location of this interface requires special attention, The call needs to be completed after the
* registration of console/OSAL handler functions/HAL handler functions are completed. At the same time, it must be
* initialized at the beginning of calling other functional module interfaces. You need to fill in the developer
@ -82,7 +82,7 @@ T_DjiReturnCode DjiCore_Init(const T_DjiUserInfo *userInfo);
T_DjiReturnCode DjiCore_SetAlias(const char *productAlias);
/**
* @brief Notify that the Onboard SDK core application starts.
* @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
* module initialize and register interfaces.
* @return Execution result.

View File

@ -90,6 +90,7 @@ typedef enum {
DJI_AIRCRAFT_SERIES_UNKNOWN = 0,
DJI_AIRCRAFT_SERIES_M200_V2 = 1,
DJI_AIRCRAFT_SERIES_M300 = 2,
DJI_AIRCRAFT_SERIES_M30 = 3,
} E_DjiAircraftSeries;
typedef enum {
@ -98,6 +99,8 @@ typedef enum {
DJI_AIRCRAFT_TYPE_M210_V2 = 45, /*!< Aircraft type is Matrice 220 V2. */
DJI_AIRCRAFT_TYPE_M210RTK_V2 = 46, /*!< Aircraft type is Matrice 210 RTK V2. */
DJI_AIRCRAFT_TYPE_M300_RTK = 60, /*!< Aircraft type is Matrice 300 RTK. */
DJI_AIRCRAFT_TYPE_M30 = 67, /*!< Aircraft type is Matrice 30. */
DJI_AIRCRAFT_TYPE_M30T = 68, /*!< Aircraft type is Matrice 30T. */
} E_DjiAircraftType;
/**
@ -113,6 +116,8 @@ typedef enum {
DJI_CAMERA_TYPE_H20T = 43, /*!< Camera type is H20T. */
DJI_CAMERA_TYPE_P1 = 50, /*!< Camera type is P1. */
DJI_CAMERA_TYPE_L1, /*!< Camera type is L1. */
DJI_CAMERA_TYPE_M30, /*!< Camera type is M30. */
DJI_CAMERA_TYPE_M30T, /*!< Camera type is M30T. */
} E_DjiCameraType;
/**

View File

@ -28,24 +28,21 @@
#define DJI_VERSION_H
/* Includes ------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
/* 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 0 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
#define DJI_VERSION_MINOR 1 /*!< 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 1462 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
#define DJI_VERSION_BUILD 1491 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
/* Exported types ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
#ifdef __cplusplus
}
#endif

View File

@ -36,9 +36,11 @@ extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef T_DjiReturnCode (*WaypointV2EventCbFunc)(T_DjiWaypointV2MissionEventPush eventData);
typedef T_DjiReturnCode (*WaypointV2StateCbFunc)(T_DjiWaypointV2MissionStatePush stateData);
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialise waypoint v2 module, and user should call this function

View File

@ -0,0 +1,122 @@
/**
********************************************************************
* @file dji_waypoint_v3.h
* @brief This is the header file for "dji_waypoint_v3.c", defining the structure and
* (exported) function prototypes.
*
* @copyright (c) 2021 DJI. All rights reserved.
*
* All information contained herein is, and remains, the property of DJI.
* The intellectual and technical concepts contained herein are proprietary
* to DJI and may be covered by U.S. and foreign patents, patents in process,
* and protected by trade secret or copyright law. Dissemination of this
* information, including but not limited to data and other proprietary
* material(s) incorporated within the information, in any form, is strictly
* prohibited without the express written consent of DJI.
*
* If you receive this source code without DJIs authorization, you may not
* further disseminate the information, and you must immediately remove the
* source code and notify DJI of its removal. DJI reserves the right to pursue
* legal actions against you for any loss(es) or damage(s) caused by your
* failure to do so.
*
*********************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef DJI_WAYPOINT_V3_H
#define DJI_WAYPOINT_V3_H
/* Includes ------------------------------------------------------------------*/
#include "dji_typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Exported constants --------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/**
* @brief Waypoint v3 mission action.
*/
typedef enum {
DJI_WAYPOINT_V3_ACTION_START = 0, /*!< Waypoint v3 mission start action. */
DJI_WAYPOINT_V3_ACTION_STOP = 1, /*!< Waypoint v3 mission stop action. */
DJI_WAYPOINT_V3_ACTION_PAUSE = 2, /*!< Waypoint v3 mission pause action. */
DJI_WAYPOINT_V3_ACTION_RESUME = 3, /*!< Waypoint v3 mission resume action. */
} E_DjiWaypointV3Action;
/**
* Waypoint v3 current aircraft 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;
/**
* Waypoint v3 mission state.
*/
typedef struct {
E_DjiWaypointV3State state; /*!< Waypoint v3 current aircraft state, #E_DjiWaypointV3State. */
uint32_t wayLineId; /*!< Waypoint v3 current way line id. */
uint16_t currentWaypointIndex; /*!< Waypoint v3 current waypoint index. */
} T_DjiWaypointV3MissionState;
/**
* @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 (*WaypointV3StateCallback)(T_DjiWaypointV3MissionState missionState);
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialise waypoint v3 module, and user should call this function.
* before using waypoint v3 features.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_Init(void);
/**
* @brief Deinitialise waypoint v3 module.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_DeInit(void);
/**
* @brief Upload kmz file by raw data.
* @note The size of kmz file is very small, you can use this interface to upload quickly.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_UploadKmzFile(const uint8_t *data, uint32_t dataLen);
/**
* @brief Execute the mission action.
* @note This action should be called after uploading the kmz file.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_Action(E_DjiWaypointV3Action action);
/**
* @brief Register the mission state callback for waypoint mission.
* @note If you want to monitor the state of waypoint mission, this interface should be called before uploading kmz
* file or executing this mission action.
* @return Execution result.
*/
T_DjiReturnCode DjiWaypointV3_RegMissionStateCallback(WaypointV3StateCallback callback);
#ifdef __cplusplus
}
#endif
#endif // DJI_WAYPOINT_V3_H
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/

View File

@ -66,6 +66,42 @@ typedef enum {
DJI_WIDGET_SWITCH_STATE_ON = 1 /*!< Switch is turned on */
} E_DjiWidgetSwitchState;
/**
* @brief Switch widget speaker work mode.
*/
typedef enum {
DJI_WIDGET_SPEAKER_WORK_MODE_TTS,
DJI_WIDGET_SPEAKER_WORK_MODE_VOICE,
} E_DjiWidgetSpeakerWorkMode;
/**
* @brief Switch widget speaker play mode.
*/
typedef enum {
DJI_WIDGET_SPEAKER_PLAY_MODE_SINGLE_PLAY,
DJI_WIDGET_SPEAKER_PLAY_MODE_LOOP_PLAYBACK,
} E_DjiWidgetSpeakerPlayMode;
/**
* @brief Switch widget speaker state.
*/
typedef enum {
DJI_WIDGET_SPEAKER_STATE_IDEL,
DJI_WIDGET_SPEAKER_STATE_TRANSMITTING,
DJI_WIDGET_SPEAKER_STATE_PLAYING,
DJI_WIDGET_SPEAKER_STATE_ERROR,
} E_DjiWidgetSpeakerState;
/**
* @brief Switch widget transmit data event.
*/
typedef enum {
DJI_WIDGET_TRANSMIT_DATA_EVENT_START,
DJI_WIDGET_TRANSMIT_DATA_EVENT_TRANSMIT,
DJI_WIDGET_TRANSMIT_DATA_EVENT_FINISH,
DJI_WIDGET_TRANSMIT_DATA_EVENT_ABORT,
} E_DjiWidgetTransmitDataEvent;
/**
* @brief Widget file binary array.
*/
@ -132,6 +168,45 @@ typedef struct {
void *userData;
} T_DjiWidgetHandlerListItem;
typedef struct {
uint16_t size;
uint32_t uuid;
uint8_t md5Sum[16];
} T_DjiWidgetTtsDataInfo;
typedef struct {
uint16_t size;
uint32_t uuid;
uint8_t md5Sum[16];
} T_DjiWidgetVoiceDataInfo;
typedef struct {
E_DjiWidgetSpeakerState state;
E_DjiWidgetSpeakerWorkMode workMode;
E_DjiWidgetSpeakerPlayMode playMode;
uint8_t volume;
uint32_t uuid;
} T_DjiWidgetSpeakerState;
typedef struct {
T_DjiReturnCode (*GetSpeakerState)(T_DjiWidgetSpeakerState *speakerState);
T_DjiReturnCode (*SetWorkMode)(E_DjiWidgetSpeakerWorkMode workMode);
T_DjiReturnCode (*GetWorkMode)(E_DjiWidgetSpeakerWorkMode *workMode);
T_DjiReturnCode (*SetPlayMode)(E_DjiWidgetSpeakerPlayMode playMode);
T_DjiReturnCode (*GetPlayMode)(E_DjiWidgetSpeakerPlayMode *playMode);
T_DjiReturnCode (*SetVolume)(uint8_t volume);
T_DjiReturnCode (*GetVolume)(uint8_t *volume);
T_DjiReturnCode (*StartPlay)(void);
T_DjiReturnCode (*StopPlay)(void);
T_DjiReturnCode (*ReceiveTtsData)(E_DjiWidgetTransmitDataEvent event,
uint32_t offset, uint8_t *buf, uint16_t size);
T_DjiReturnCode (*ReceiveVoiceData)(E_DjiWidgetTransmitDataEvent event,
uint32_t offset, uint8_t *buf, uint16_t size);
} T_DjiWidgetSpeakerHandler;
/* Exported functions --------------------------------------------------------*/
/**
* @brief Initialise widget module, and user should call this function before using widget features.
@ -215,6 +290,15 @@ T_DjiReturnCode DjiWidgetFloatingWindow_ShowMessage(const char *str);
*/
T_DjiReturnCode DjiWidgetFloatingWindow_GetChannelState(T_DjiDataChannelState *state);
/**
* @brief Register the handler for widget speaker function interfaces.
* @note This interface registers the widget speaker function interface, including speaker settings, play operation,
* speaker status interface.
* @param widgetSpeakerHandler: pointer to the handler for widget speaker functions.
* @return Execution result.
*/
T_DjiReturnCode DjiWidget_RegSpeakerHandler(const T_DjiWidgetSpeakerHandler *widgetSpeakerHandler);
#ifdef __cplusplus
}
#endif