M350b版本
This commit is contained in:
@ -66,6 +66,14 @@ typedef struct {
|
||||
uint8_t majorVersion;
|
||||
} T_DjiAircraftVersion;
|
||||
|
||||
/**
|
||||
* @brief enhanced transmission state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_ENHANCEED_TRANSMISSION_STATE_DISABLED = 0, /**< Mobile app image transmission setting, Enhanced transmission disabled */
|
||||
DJI_ENHANCEED_TRANSMISSION_STATE_ENABLED = 3, /**< Mobile app image transmission setting, Enhanced transmission enabled. */
|
||||
} E_DjiEnhancedTransmissionState;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Basic information about the aircraft system, including aircraft type and DJI adapter type.
|
||||
@ -97,6 +105,13 @@ T_DjiReturnCode DjiAircraftInfo_GetConnectionStatus(bool *isConnected);
|
||||
*/
|
||||
T_DjiReturnCode DjiAircraftInfo_GetAircraftVersion(T_DjiAircraftVersion *aircraftVersion);
|
||||
|
||||
/**
|
||||
* @brief Get Enhanced Transmission state, which is set in the mobile app image transmission setting -- Enhanced Transmission.
|
||||
* @param aircraftVersion: Enhanced Transmission state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiAircraftInfo_GetEnhancedTransmission(E_DjiEnhancedTransmissionState *state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -682,6 +682,7 @@ typedef struct {
|
||||
E_DjiCameraManagerStreamSource streamSource[16];
|
||||
E_DjiCameraManagerStreamStorage streamStorage[16];
|
||||
E_DjiCameraManagerNightSceneMode nightSceneMode[16];
|
||||
E_DjiCameraManagerMeteringMode meteringMode[16];
|
||||
};
|
||||
uint32_t minValue;
|
||||
uint32_t maxValue;
|
||||
@ -850,7 +851,7 @@ T_DjiReturnCode DjiCameraManager_SetPhotoBurstCount(E_DjiMountPosition position,
|
||||
/**
|
||||
* @brief Set the parameters for INTERVAL shooting mode.
|
||||
* @note In this mode, the camera captures a photo, waits a specified interval
|
||||
* of time, then captures another photo, continuing until the set number of
|
||||
* of time, then captures another photo, continuing until the set number of
|
||||
* photos is reached. Supported by thermal imaging cameras, too.
|
||||
* @param position: camera mounted position
|
||||
* @param intervalSetting: refer to T_DjiCameraPhotoTimeIntervalSettings.
|
||||
@ -991,7 +992,7 @@ T_DjiReturnCode DjiCameraManager_GetTapZoomEnabled(E_DjiMountPosition position,
|
||||
|
||||
/**
|
||||
* @brief Set camera's tap-zoom multiplier of the selected camera mounted position.
|
||||
* @note The final zoom scale during a tap-zoom action will be:
|
||||
* @note The final zoom scale during a tap-zoom action will be:
|
||||
* Current Zoom Scale x Multiplier.
|
||||
* @param position: camera mounted position
|
||||
* @param tapZoomMultiplier: The multiplier range is [1,5]. A multiplier of 1 will not change the zoom.
|
||||
@ -1603,6 +1604,15 @@ T_DjiReturnCode DjiCameraManager_SetInfraredCameraGainMode(E_DjiMountPosition po
|
||||
T_DjiReturnCode DjiCameraManager_GetInfraredCameraGainModeTemperatureRange(E_DjiMountPosition position,
|
||||
T_DjiCameraManagerIrTempMeterRange *tempRange);
|
||||
|
||||
/**
|
||||
* @brief Get metergin mode range of infrared camera.
|
||||
* @param position: camera mounted position.
|
||||
* @param tempRange: returned value of metering range.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiCameraManager_GetMeteringModeRange(E_DjiMountPosition position,
|
||||
T_DjiCameraManagerRangeList *rangeList);
|
||||
|
||||
/**
|
||||
* @brief Set camera metering mode.
|
||||
* @param position: camera mounted position
|
||||
@ -1640,6 +1650,16 @@ T_DjiReturnCode DjiCameraManager_GetMeteringPointRegionRange(E_DjiMountPosition
|
||||
T_DjiReturnCode DjiCameraManager_SetMeteringPoint(E_DjiMountPosition position,
|
||||
uint8_t x, uint8_t y);
|
||||
|
||||
/**
|
||||
* @brief Set metering point normalize.
|
||||
* @param position: camera mounted position
|
||||
* @param x: Normalized horizontal coordinate, value ranges in 0 ~ 1.
|
||||
* @param y: Normalized Vertical coordinate, value ranges in 0 ~ 1.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiCameraManager_SetMeteringPointNormalized(E_DjiMountPosition position,
|
||||
dji_f32_t x, dji_f32_t y);
|
||||
|
||||
/**
|
||||
* @brief Get camera metering mode.
|
||||
* @param position: camera mounted position
|
||||
@ -1651,6 +1671,18 @@ T_DjiReturnCode DjiCameraManager_GetMeteringPoint(E_DjiMountPosition position,
|
||||
uint8_t *x, uint8_t *y);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get camera metering mode.
|
||||
* @param position: camera mounted position
|
||||
* @param x: a pointer to a float (dji_f32_t) that will receive the normalized x-coordinate of the
|
||||
* metering point.
|
||||
* @param y: a pointer to a float (dji_f32_t) that will receive the normalized y-coordinate of the
|
||||
* metering point.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiCameraManager_GetMeteringPointNormalized(E_DjiMountPosition position,
|
||||
dji_f32_t *x, dji_f32_t *y);
|
||||
|
||||
/**
|
||||
* @brief Start to record point cloud of the selected camera mounted position.
|
||||
* @param position: camera mounted position
|
||||
|
||||
@ -526,6 +526,153 @@ typedef enum {
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_IMU_ATTI_NAVI_DATA_WITH_TIMESTAMP = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 48),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.1 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO1 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 48),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.2 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO2 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 49),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.3 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO3 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 50),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.4 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO4 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 51),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.5 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO5 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 52),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.6 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO6 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 53),
|
||||
|
||||
/*!
|
||||
* @brief Provides postion NO.7 gimbal pitch, roll, yaw @ up to 50Hz
|
||||
* @details
|
||||
* The reference frame for gimbal angles is a NED frame attached to the gimbal.
|
||||
* This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :
|
||||
* |Data Structure Element| Meaning|
|
||||
* |----------------------|--------|
|
||||
* |Vector3f.x |pitch |
|
||||
* |Vector3f.y |roll |
|
||||
* |Vector3f.z |yaw |
|
||||
*
|
||||
* @perf
|
||||
* 0.1 deg accuracy in all axes
|
||||
*
|
||||
* @sensors Gimbal Encoder, IMU, Magnetometer
|
||||
* @units deg
|
||||
* @datastruct \ref T_DjiFcSubscriptionGimbalAngles
|
||||
* @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE
|
||||
*/
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES_ON_POS_NO7 = DJI_DATA_SUBSCRIPTION_TOPIC(DJI_DATA_SUBSCRIPTION_MODULE_FC, 54),
|
||||
|
||||
/*! Total number of topics that can be subscribed. */
|
||||
DJI_FC_SUBSCRIPTION_TOPIC_TOTAL_NUMBER,
|
||||
} E_DjiFcSubscriptionTopic;
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -114,6 +113,7 @@ typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT = 10, /*!< Reset the joystick control permission to RC when aircraft is executing low-battery-landing*/
|
||||
DJI_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 11, /*!< Reset the joystick control permission to RC when PSDK is lost*/
|
||||
DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT = 12, /*!< Reset the joystick control permission to RC when aircraft is near boundary.*/
|
||||
DJI_FLIGHT_CONTROLLER_DOCK_REQUEST_CHANGE_JOYSTICK_CTRL_AUTH_EVENT = 13, /*!< Dock request change the joystick control permission.*/
|
||||
} E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent;
|
||||
|
||||
/**
|
||||
@ -237,6 +237,17 @@ typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_DISABLE_RC_LOST_ACTION = 1,
|
||||
} E_DjiFlightControllerRCLostActionEnableStatus;
|
||||
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_NO_MOTOR_IN_SLOW_ROTATE_MODE = 0,
|
||||
DJI_FLIGHT_CONTROLLER_SOME_MOTOR_IN_SLOW_ROTATE_MODE = 1,
|
||||
DJI_FLIGHT_CONTROLLER_ALL_MOTOR_IN_SLOW_ROTATE_MODE = 2,
|
||||
} E_DjiFlightControllerElectronicSpeedControllerStatus;
|
||||
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_FTS_NOT_TRIGGERD = 0,
|
||||
DJI_FLIGHT_CONTROLLER_FTS_TRIGGERD = 1,
|
||||
} E_DjiFlightControllerFtsStatus;
|
||||
|
||||
/**
|
||||
* @brief Joystick mode.
|
||||
* @note You need to set joystick mode first before start to send joystick command to aircraft.
|
||||
@ -272,6 +283,62 @@ typedef struct {
|
||||
uint16_t altitude;
|
||||
} T_DjiFlightControllerRidInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double lat; /*!< Target point latitude, unit: rad */
|
||||
double lon; /*!< Target point longitude, unit: rad */
|
||||
float alt; /*!< Target point altitude, ellipsoidal height unit: meters */
|
||||
} T_DjiFlightControllerPointInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t version; /*!< Function version */
|
||||
int8_t operation; /*!< New upload of a target point or update of the current task's target point; 0: new order, 1: update goal */
|
||||
float mea; /*!< Minimum enroute height, in meters, relative to the takeoff point.
|
||||
If the aircraft has not started or is on the ground, it will first climb to this height before executing the task. This height is ignored if the aircraft is in the air. */
|
||||
uint8_t fly_vel; /*!< Maximum horizontal flight speed to the target point, in meters per second */
|
||||
uint8_t goal_num; /*!< Number of target points, currently only supports one point */
|
||||
T_DjiFlightControllerPointInfo cmd_mode_point_info[1]; /*!< Information of the target point */
|
||||
} T_DjiFlightControllerStartMissionReq;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ret_code; /*!< 0: Start task successfully, 1: Start task failed */
|
||||
uint16_t error_code; /*!< Instruction flight route version reused route error code */
|
||||
uint8_t code_name; /*!< Task code, unique, will be included in the trajectory push to ensure that external modules can correlate the task with its trajectory */
|
||||
} T_DjiFlightControllerStartMissionRsp;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t mission_state_machine; /*!< Task state machine, 0 is idle, others are in progress.*/
|
||||
uint8_t mission_planning_algo; /*!< Task planning algorithm mode */
|
||||
uint8_t goal_index; /*!< Current target point index */
|
||||
float distance_remaining; /*!< Remaining task distance */
|
||||
float time_remaining; /*!< Remaining task time */
|
||||
uint8_t soe_remaining; /*!< Required SOE (State of Energy) */
|
||||
uint8_t progress; /*!< Progress, reserved unused */
|
||||
uint8_t success_rate; /*!< Task success rate, reserved unused */
|
||||
} T_DjiFlightControllerOpenMis;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t latitude; /*!< GPS latitude, unit: 1/2^32 * 180°, range: [-90°, 90°) */
|
||||
int32_t longitude; /*!< GPS longitude, unit: 1/2^32 * 360°, range: [-180°, 180°) */
|
||||
int32_t altitude; /*!< Altitude, unit: mm; Note: The type of altitude depends on the function definition.
|
||||
It could be: relative to the takeoff point, WGS84 absolute ellipsoidal height, EGM96 absolute altitude, barometric height, etc. */
|
||||
} T_DjiFlightControllerSpotlightZoomGps;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t code_name; /*!< Unique task code for this trajectory push */
|
||||
uint8_t point_num; /*!< Number of key points in the trajectory */
|
||||
uint8_t byte_per_point; /*!< Number of bytes per point */
|
||||
T_DjiFlightControllerSpotlightZoomGps points[1]; /*!< Array of key points in the trajectory */
|
||||
uint8_t last_point_type; /*!< Whether the target point can be reached
|
||||
0: Yes, the last point in the trajectory is the user's target point
|
||||
1: No, the user's target point is in an invalid area (e.g., within an NFZ or building), the last point is the closest point to the target */
|
||||
} T_DjiFlightControllerCoreTraj;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
@ -288,6 +355,81 @@ T_DjiReturnCode DjiFlightController_Init(T_DjiFlightControllerRidInfo ridInfo);
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Set planning algorithm.
|
||||
* @param algo: 0:smart height, 1:Manual height.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetPlanningAlgo(uint8_t algo);
|
||||
|
||||
/**
|
||||
* @brief Set max velocity.
|
||||
* @param value: max velocity value, min:1, max:15.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetMaxVelocity(uint8_t value);
|
||||
|
||||
/**
|
||||
* @brief Set min flight height.
|
||||
* @param value: min flight height value, min:1.0, max:3000.0, only SetPlanningAlgo 1 effective.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetMinFlightHeight(float value);
|
||||
|
||||
/**
|
||||
* @brief Get exit reason.
|
||||
* @param reason: exit reason".
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetExitReason(uint16_t *reason);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get open mis info.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*FcCmderModeOpenMisEventCbFunc)(T_DjiFlightControllerOpenMis eventData);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get core traj info.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*FcCmderModeCoreTrajEventCbFunc)(T_DjiFlightControllerCoreTraj eventData);
|
||||
|
||||
/**
|
||||
* @brief Register callback function for the open mis event.
|
||||
* @param callback: the callback for the open mis event.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_RegisterOpenMisInfoCallBack(FcCmderModeOpenMisEventCbFunc callback);
|
||||
|
||||
/**
|
||||
* @brief Register callback function for the core traj event.
|
||||
* @param callback: the callback for the core traj event.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_RegisterCoreTrajCallBack(FcCmderModeCoreTrajEventCbFunc callback);
|
||||
|
||||
/**
|
||||
* @brief antiregister callback function for the open mis event.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_AntiRegisterOpenMisInfoCallBack(void);
|
||||
|
||||
/**
|
||||
* @brief antiregister callback function for the core traj event.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_AntiRegisterCoreTrajCallBack(void);
|
||||
|
||||
/**
|
||||
* @brief set mode start mission.
|
||||
* @param command: cmd for start mission.
|
||||
* @param rsp: response data for set start mission.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetModeStartMission(T_DjiFlightControllerStartMissionReq command,
|
||||
T_DjiFlightControllerStartMissionRsp *rsp);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable RTK position function.
|
||||
* @details Enabling RTK means that RTK data will be used instead of GPS during flight.
|
||||
@ -649,6 +791,25 @@ DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActio
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_RegTriggerFtsEventCallback(TriggerFtsEventCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Start to rotate motors slowly.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartSlowRotateMotor(void);
|
||||
|
||||
/**
|
||||
* @brief Stop to rotate motors slowly.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StopSlowRotateMotor(void);
|
||||
|
||||
/**
|
||||
* @brief Get the status of the ESC.
|
||||
* @param status: The status of the motor on aircraft.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetElectronicSpeedControllerStatus(E_DjiFlightControllerElectronicSpeedControllerStatus *status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -44,6 +44,18 @@ typedef enum {
|
||||
DJI_HMS_ERROR_LEVEL_FATAL,
|
||||
} E_DjiHmsErrorLevel;
|
||||
|
||||
typedef enum {
|
||||
DJI_HMS_ALARM_ENHANCED_TYPE_SHAKE_MOTOR = 1, /*!< Alarm triggered by shaking the motor on the pilot; alerts the user with vibrations indicating a warning or fault. */
|
||||
DJI_HMS_ALARM_ENHANCED_PLAY_SOUND = 2, /*!< Alarm triggered by playing sound */
|
||||
DJI_HMS_ALARM_ENHANCED_PLAY_SOUND_AND_SHAKE_MOTOR =3, /*!< Alarm that alerts the user on the PILOT app with both sound and vibrations */
|
||||
} E_DjiHmsAlarmEnhancedType;
|
||||
|
||||
typedef enum {
|
||||
DJI_HMS_ALARM_ENHANCED_ACTION_STOP = 0, /*!< Action to stop a specific enhanced alarm, shake motor or play sound */
|
||||
DJI_HMS_ALARM_ENHANCED_ACTION_START = 1, /*!< Action to stop a specific enhanced alarm */
|
||||
DJI_HMS_ALARM_ENHANCED_ACTION_EXIT_ALL =2,/*!< Action to exit all enhanced alarms, both shake motor and play sound; */
|
||||
} E_DjiHmsAlarmEnhancedAction;
|
||||
|
||||
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 */
|
||||
@ -55,6 +67,11 @@ typedef struct {
|
||||
T_DjiHmsFileBinaryArray *fileBinaryArrayList; /*!< Pointer to binary array list */
|
||||
} T_DjiHmsBinaryArrayConfig;
|
||||
|
||||
typedef struct {
|
||||
E_DjiHmsAlarmEnhancedType type; /*!< The type is used to specify which enhanced alarm to ACTION_STOP or ACTION_START. It is ignored when EXIT_ALL alarms.*/
|
||||
int8_t times; /* !< Specifies the number of consecutive times the alarm is to be activated.*/
|
||||
int16_t interval; /* !< Indicates the interval (in milliseconds) between consecutive activations of the alarm.*/
|
||||
} T_DjiHmsAlarmEnhancedSetting;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
@ -65,7 +82,7 @@ typedef struct {
|
||||
T_DjiReturnCode DjiHmsCustomization_Init(void);
|
||||
|
||||
/**
|
||||
* @brief DeInitialize hms manager module.
|
||||
* @brief DeInitialize hms customization module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiHmsCustomization_DeInit(void);
|
||||
@ -125,6 +142,15 @@ T_DjiReturnCode DjiHmsCustomization_RegDefaultHmsTextConfigByBinaryArray(const T
|
||||
T_DjiReturnCode DjiHmsCustomization_RegHmsTextConfigByBinaryArray(E_DjiMobileAppLanguage appLanguage,
|
||||
const T_DjiHmsBinaryArrayConfig *binaryArrayConfig);
|
||||
|
||||
/**
|
||||
* @brief Contrl the app alram.
|
||||
* @note This interface support on DJI manifold3.
|
||||
* @param action: The action to start or stop alarm.
|
||||
* @param setting: The alarm information.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiHmsCustomization_AlarmEnhancedCtrl(E_DjiHmsAlarmEnhancedAction action, T_DjiHmsAlarmEnhancedSetting setting);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -39,16 +39,23 @@ extern "C" {
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef enum {
|
||||
DJI_INTEREST_POINT_MISSION_ACTION_STATE_NOT_STARTED = 0,
|
||||
DJI_INTEREST_POINT_MISSION_ACTION_STATE_PAUSE = 1,
|
||||
DJI_INTEREST_POINT_MISSION_ACTION_STATE_RUNNING = 2,
|
||||
} E_DjiInterestPointActionState;
|
||||
|
||||
typedef struct {
|
||||
dji_f32_t curSpeed;
|
||||
dji_f32_t radius;
|
||||
uint8_t state;
|
||||
uint8_t state; /*!< Refer to E_DjiInterestPointActionState.*/
|
||||
} T_DjiInterestPointMissionState;
|
||||
|
||||
typedef struct {
|
||||
dji_f64_t latitude;
|
||||
dji_f64_t longitude;
|
||||
dji_f32_t speed;
|
||||
int8_t payloadCameraIndex; /*!< Used by which aircraft that can mount payload cameras. Range starts from 1.*/
|
||||
} T_DjiInterestPointSettings;
|
||||
|
||||
typedef T_DjiReturnCode (*InterestPointMissionStateCallback)(T_DjiInterestPointMissionState missionState);
|
||||
|
||||
@ -47,6 +47,15 @@ typedef enum {
|
||||
DJI_LIVEVIEW_CAMERA_POSITION_FPV = 7
|
||||
} E_DjiLiveViewCameraPosition;
|
||||
|
||||
/**
|
||||
* @brief Image format.
|
||||
*/
|
||||
typedef enum {
|
||||
PIXFMT_NV12 = 3,
|
||||
PIXFMT_RGB_PLANAR = 4,
|
||||
PIXFMT_RGB_PACKED = 5
|
||||
} E_DjiLiveViewPixFormate;
|
||||
|
||||
/**
|
||||
* @brief Liveview camera stream source.
|
||||
*/
|
||||
@ -71,13 +80,105 @@ typedef enum {
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3D_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3TD_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3TD_IR = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H30_ZOOM = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H30_4K = 7,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4E_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4E_4K = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4T_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4T_IR = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4T_4K = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4D_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4D_4K = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4TD_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4TD_IR = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M4TD_4K = 3,
|
||||
} E_DjiLiveViewCameraSource;
|
||||
|
||||
/**
|
||||
* @brief DJI standard types of target recognition.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_LIVEVIEW_OBJ_TYPE_INVALID = 0,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_UNKNOWN = 1,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_PERSON = 2,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_CAR = 3,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_BOAT = 4,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_HUMAN_FACE = 5,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_BIRD = 10,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_BEACON = 20,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_GPS = 30,
|
||||
DJI_LIVEVIEW_OBJ_TYPE_MOVING_TARGET = 34,
|
||||
} E_DjiLiveViewTargetObjectType;
|
||||
|
||||
/**
|
||||
* @brief Target Recognition Status.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_LIVEVIEW_OBJ_STATE_INVALID = 0, /*!< invalid state */
|
||||
DJI_LIVEVIEW_OBJ_STATE_TRACKED = 1, /*!< steady state following */
|
||||
DJI_LIVEVIEW_OBJ_STATE_VISION_BEACON_FUSIONED = 2, /*!< Vision beacon fusion state */
|
||||
DJI_LIVEVIEW_OBJ_STATE_AUXILIARY_TRACKED = 3, /*!< Loss of trigger source, auxiliary observation following state */
|
||||
DJI_LIVEVIEW_OBJ_STATE_NOT_CONFIDENT = 4, /*!< unstable following state */
|
||||
DJI_LIVEVIEW_OBJ_STATE_LOST_WITH_PREDICT = 5, /*!< Target lost, forecast status maintained */
|
||||
DJI_LIVEVIEW_OBJ_STATE_LOST = 6, /*!< Target Loss Status */
|
||||
DJI_LIVEVIEW_OBJ_STATE_REDETECTED = 7, /*!< Target Loss Retrieval Status */
|
||||
} E_DjiLiveViewTargetObjectState;
|
||||
|
||||
/**
|
||||
* @brief Picture frame information for target recognition results
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t cx; /*!< X-coordinate of the center of the frame, unit: 1/10000 * screen width */
|
||||
uint16_t cy; /*!< Y-coordinate of the center of the frame, unit: 1/10000 * screen height */
|
||||
uint16_t w; /*!< Frame width, unit: 1/10000 * screen width */
|
||||
uint16_t h; /*!< Frame height, unit: 1/10000 * screen height */
|
||||
uint32_t distance; /*!< Distance in mm */
|
||||
} __attribute__((packed)) T_DjiLiveViewTarget2dBox;
|
||||
|
||||
/**
|
||||
* @brief BoundingBox information for target recognition.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t id;
|
||||
uint8_t type; /*!< type can be an enumerated value of E_DjiLiveViewTargetObjectType or a user-defined value. */
|
||||
uint8_t state; /*!< state should be of type E_DjiLiveViewTargetObjectState enumeration */
|
||||
T_DjiLiveViewTarget2dBox box;
|
||||
} __attribute__((packed)) T_DjiLiveViewBoundingBox;
|
||||
|
||||
/**
|
||||
* @brief List of boundingBox information.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t boxCount;
|
||||
T_DjiLiveViewBoundingBox boxData[1];
|
||||
} __attribute__((packed)) T_DjiLiveViewStandardMetaData;
|
||||
|
||||
/**
|
||||
* @brief Image information.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiLiveViewPixFormate pixFmt;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint32_t frameId;
|
||||
} T_DjiLiveviewImageInfo;
|
||||
|
||||
/**
|
||||
* @brief Liveview camera h264 stream callback.
|
||||
*/
|
||||
typedef void (*DjiLiveview_H264Callback)(E_DjiLiveViewCameraPosition position, const uint8_t *buf, uint32_t len);
|
||||
|
||||
/**
|
||||
* @brief Liveview camera image data callback.
|
||||
*/
|
||||
typedef void (*DjiLiveview_ImageCallback)(E_DjiLiveViewCameraPosition position, const uint8_t *buf,
|
||||
uint32_t len , T_DjiLiveviewImageInfo ImageInfo);
|
||||
|
||||
/**
|
||||
* @brief Callback for handling encoded output data
|
||||
*/
|
||||
typedef void (*DjiLiveview_EncoderCallback)(const uint8_t *buf, uint32_t len);
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the liveview module.
|
||||
@ -119,6 +220,81 @@ T_DjiReturnCode DjiLiveview_StopH264Stream(E_DjiLiveViewCameraPosition position,
|
||||
T_DjiReturnCode DjiLiveview_RequestIntraframeFrameData(E_DjiLiveViewCameraPosition position,
|
||||
E_DjiLiveViewCameraSource source);
|
||||
|
||||
/**
|
||||
* @brief Request to get the decoded image data from the specified position.
|
||||
* @param position: Camera position for the H264 stream.
|
||||
* @param source: sub-camera source for the H264 stream.
|
||||
* @param pixFmt: Requested Image Format.
|
||||
* @param callback: Callback for handling image data.
|
||||
* @return Execution result.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_StartImageStream(E_DjiLiveViewCameraPosition position, E_DjiLiveViewCameraSource source,
|
||||
E_DjiLiveViewPixFormate pixFmt, DjiLiveview_ImageCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Stop the decoded image data from the specified position.
|
||||
* @param position: Camera position for the H264 stream.
|
||||
* @param source: sub-camera source for the H264 stream.
|
||||
* @return Execution result.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_StopImageStream(E_DjiLiveViewCameraPosition position, E_DjiLiveViewCameraSource source);
|
||||
|
||||
/**
|
||||
* @brief Registering encoder callback handlers.
|
||||
* @return Execution result.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_RegEncoderCallback(DjiLiveview_EncoderCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Unregistering encoder callback handlers.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_UnregEncoderCallback();
|
||||
|
||||
/**
|
||||
* @brief Encoding image into h264 streams.
|
||||
* @param buf: raw data of image.
|
||||
* @param len: length of image data.
|
||||
* @param imageInfo: information of image.
|
||||
* @param metaData: Resulting information obtained from images for target recognition.
|
||||
* @return Execution result.
|
||||
* @note If there is no need for information related to target identification, fill in NULL for metaData.
|
||||
* @note This interface needs to be used after DjiLiveview_RegEncoderCallback.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_EncodeAFrameToH264(const uint8_t *buf, uint32_t len, T_DjiLiveviewImageInfo imageInfo,
|
||||
T_DjiLiveViewStandardMetaData *metaData);
|
||||
|
||||
/**
|
||||
* @brief Register user-defined target Lables
|
||||
* @param lableCount: Number of lable.
|
||||
* @param labels: lable String Array
|
||||
* @note The key-value pairs of lable and index will be recorded on the Pilot after registration
|
||||
* and will be used to parse the metaData and display the lable when rendering the boundingbox.
|
||||
* @note This interface support on DJI manifold3.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_RegUserAiTargetLableList(uint8_t lableCount,const char *labels[]);
|
||||
|
||||
/**
|
||||
* @brief Unregister user-defined target Lables
|
||||
* @return Execution result.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_UnregUserAiTargetLableList();
|
||||
|
||||
/**
|
||||
* @brief Transmits the result information of the target recognition to the pilot for display.
|
||||
* @param metaData: Resulting information obtained from images for target recognition.
|
||||
* @note This interface support on DJI manifold3.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_SendAiMetaToPilot(T_DjiLiveViewStandardMetaData *metaData);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -102,14 +102,24 @@ T_DjiReturnCode DjiLogger_RemoveConsole(T_DjiLoggerConsole *console);
|
||||
void DjiLogger_UserLogOutput(E_DjiLoggerConsoleLogLevel level, const char *fmt, ...);
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define __FILENAME__ (strrchr("/" __FILE__, '/') + 1)
|
||||
|
||||
#define USER_LOG_PREFIX_FMT "%25s:%-4d "
|
||||
|
||||
#ifndef SYSTEM_ARCH_RTOS
|
||||
#define USER_LOG_PREFIX_ARG __FILENAME__, __LINE__
|
||||
#else
|
||||
#define USER_LOG_PREFIX_ARG __FUNCTION__, __LINE__
|
||||
#endif
|
||||
|
||||
#define USER_LOG_DEBUG(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, USER_LOG_PREFIX_FMT fmt, USER_LOG_PREFIX_ARG, ##__VA_ARGS__)
|
||||
#define USER_LOG_INFO(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO, USER_LOG_PREFIX_FMT fmt, USER_LOG_PREFIX_ARG, ##__VA_ARGS__)
|
||||
#define USER_LOG_WARN(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_WARN, USER_LOG_PREFIX_FMT fmt, USER_LOG_PREFIX_ARG, ##__VA_ARGS__)
|
||||
#define USER_LOG_ERROR(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR, USER_LOG_PREFIX_FMT fmt, USER_LOG_PREFIX_ARG, ##__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -173,6 +173,8 @@ typedef struct {
|
||||
bool isShootingIntervalStart; /*!< Specifies if the camera is in interval shooting start status. This parameter is boolean type. */
|
||||
uint16_t currentPhotoShootingIntervalTimeInSeconds; /*!< Specifies the current interval shoot countdown time, the value is decreasing,
|
||||
* when the value equals to zero trigger the interval take photo, uint:s. */
|
||||
uint16_t currentPhotoShootingIntervalTimeInMs; /*!< Specifies the current interval shoot countdown time of millisecond part, the value is decreasing,
|
||||
* when the value equals to zero trigger the interval take photo, uint:ms. */
|
||||
uint16_t currentPhotoShootingIntervalCount; /*!< Specifies the current interval photo count, the value is decreasing step by one from
|
||||
* the setted count when interval taking photo */
|
||||
bool isRecording; /*!< Specifies if the camera is in recording status. This parameter is boolean type. */
|
||||
@ -841,7 +843,7 @@ T_DjiReturnCode DjiPayloadCamera_RegMediaDownloadPlaybackHandler(const T_DjiCame
|
||||
* @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_SendVideoStream(const uint8_t *data, uint16_t len);
|
||||
T_DjiReturnCode DjiPayloadCamera_SendVideoStream(const uint8_t *data, uint32_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "videoStream" channel. User can use the state as base for controlling data
|
||||
|
||||
@ -39,6 +39,8 @@ extern "C" {
|
||||
#define DJI_PERCEPTION_INTRINSICS_PARAM_ARRAY_NUM 9
|
||||
#define DJI_PERCEPTION_ROTATION_PARAM_ARRAY_NUM 9
|
||||
#define DJI_PERCEPTION_TRANSLATION_PARAM_ARRAY_NUM 3
|
||||
#define DJI_PTS_NUM_PER_PKG 96
|
||||
#define DJI_LIDAR_PKG_BUFFER_NUM 564
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
@ -71,6 +73,19 @@ typedef enum {
|
||||
RECTIFY_RIGHT_RIGHT = 26
|
||||
} E_DjiPerceptionCameraPosition;
|
||||
|
||||
/**
|
||||
* @bref Perception radar design location
|
||||
*/
|
||||
typedef enum {
|
||||
RADAR_POSITION_LEFT = 0,
|
||||
RADAR_POSITION_RIGHT = 1,
|
||||
RADAR_POSITION_DOWN =2,
|
||||
RADAR_POSITION_UP = 3,
|
||||
RADAR_POSITION_FRONT = 4,
|
||||
RADAR_POSITION_BACK =5,
|
||||
MAX_RADAR_NUM = 6,
|
||||
}E_DjiPerceptionRadarPosition;
|
||||
|
||||
#pragma pack(1)
|
||||
/**
|
||||
* @bref Perception camera ram image info
|
||||
@ -114,14 +129,217 @@ typedef struct {
|
||||
uint32_t directionNum;
|
||||
T_DjiPerceptionCameraParameters cameraParameters[IMAGE_MAX_DIRECTION_NUM];
|
||||
} T_DjiPerceptionCameraParametersPacket;
|
||||
|
||||
/**
|
||||
* @bref Perception Lidar data point info
|
||||
*/
|
||||
typedef struct{
|
||||
float x; /*!< unit: meters */
|
||||
float y; /*!< unit: meters */
|
||||
float z; /*!< unit: meters */
|
||||
uint8_t intensity;
|
||||
uint8_t label; /*!< Noise filtering results (0: obj; 1: noise; 2: unknow; 3: not_retuen ) */
|
||||
} T_DJIPerceptionLidarPoint;
|
||||
|
||||
/**
|
||||
* @bref Perception Lidar data header of each pkg
|
||||
*/
|
||||
typedef struct{
|
||||
uint16_t timeInterval; /*!< The point cloud sampling time (in 0.1us) */
|
||||
uint16_t dotNum; /*!< Current packet data field contains the number of points This field is not valid for non-repeat scans*/
|
||||
uint8_t dataType; /** dataType
|
||||
*
|
||||
* Bit Position (7-4) | Field Name | Description | Remarks
|
||||
* ------------------ | ------------ | -------------------- | -------------------------------------------------
|
||||
* 4-7 | echo_mode | Echo Mode | 0: Single echo mode
|
||||
* | | | 1: Dual echo mode
|
||||
* | | | 2: Triple echo mode
|
||||
* | | | 3: Quadruple echo mode
|
||||
* | | | 4: Quintuple echo mode
|
||||
*
|
||||
* Bit Position (3-0) | Field Name | Description | Remarks
|
||||
* ------------------ | ------------ | -------------------- | -------------------------------------------------
|
||||
* 0-3 | data_type | Data Type | 40: IMU Data
|
||||
* | | | 1: Point cloud data (rectangular, 32-bit)
|
||||
* | | | 2: Point cloud data (rectangular, 16-bit default)
|
||||
* | | | 3: Point cloud data (spherical)
|
||||
* | | | 4: Point cloud data (rectangular, 20-bit, in use)
|
||||
*/
|
||||
uint8_t timeType; /** timeType
|
||||
* Timestamp Type | Sync Source Type | Data Format | Description
|
||||
* -------------- | ------------------- | ------------- | -------------------------------------------------
|
||||
* 0 | No sync source, | uint64_t | Timestamp is radar uptime, unit: ns
|
||||
* | | |
|
||||
* 1 | gPTP/PTP sync, | uint64_t | Timestamp is master clock source time, unit: ns
|
||||
* | | |
|
||||
* 2 | PPS + ns time sync | uint64_t | Unit: ns
|
||||
* | | |
|
||||
* 3 | PPS + UTC | uint64_t | UTC format is:
|
||||
* | | struct | struct {
|
||||
* | | | uint8_t year;
|
||||
* | | | uint8_t mon;
|
||||
* | | | uint8_t day;
|
||||
* | | | uint8_t hour;
|
||||
* | | | uint32_t us_offset;
|
||||
* | | | };
|
||||
*/
|
||||
uint64_t timeStamp;
|
||||
}T_DJIPerceptionLidarDataHeader;
|
||||
|
||||
/**
|
||||
* @bref Perception Lidar data pkg
|
||||
*/
|
||||
typedef struct{
|
||||
T_DJIPerceptionLidarDataHeader header;
|
||||
T_DJIPerceptionLidarPoint points[DJI_PTS_NUM_PER_PKG];
|
||||
}T_DjiPerceptionLidarDecodePkg;
|
||||
|
||||
/**
|
||||
* @bref Perception Lidar data frame
|
||||
*/
|
||||
typedef struct{
|
||||
uint64_t timeStampNs; /*!< Timestamp of the first point of each packet */
|
||||
uint32_t frameCnt; /*!< in increasing order from zero */
|
||||
uint16_t pkgNum; /*!< Number of valid pkgs per frame */
|
||||
T_DjiPerceptionLidarDecodePkg pkgs[DJI_LIDAR_PKG_BUFFER_NUM];
|
||||
uint32_t poseTimeMs;
|
||||
uint16_t naviFlag; /** naviFlag:
|
||||
* Bit Position | Field Name | Description | Remarks
|
||||
* ------------ | ---------- | ------------------------------------------------ | -----------------------------------
|
||||
* 0 | vel_x | Horizontal x-axis velocity valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 1 | vel_y | Horizontal y-axis velocity valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 2 | vel_z | Vertical velocity valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 3 | pos_x | Horizontal x-axis position valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 4 | pos_y | Horizontal y-axis position valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 5 | pos_z | Vertical position valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 6 | dwn_vz | Ground speed valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 7 | dwn_pz | Ground elevation valid bit (1 valid) | 1 - valid, 0 - invalid
|
||||
* 8 | rtk_pxy | RTK horizontal valid flag (1 valid) | 1 - valid, 0 - invalid
|
||||
* 9 | rtk_pz | RTK vertical valid flag (1 valid) | 1 - valid, 0 - invalid
|
||||
* 10 | gns_ll | GPS horizontal valid flag (1 valid) | 1 - valid, vertical direction always invalid
|
||||
* 11 | fg_ok | FG estimate OK flag (1 valid) | 1 - valid, 0 - invalid
|
||||
* 12-15 | fg_st | FG mode (4 bits) | Modes:
|
||||
* | | | 0 - Random initialization
|
||||
* | | | 1 - Initialization with poor compass
|
||||
* | | | 2 - Initialization with good compass
|
||||
* | | | 3 - Magnetic inclination compensation
|
||||
* | | | 4 - Compass fix during takeoff
|
||||
* | | | 5 - Compass fix in the air
|
||||
* | | | 6 - Compass calibration fix
|
||||
* | | | 7 - Accelerometer alignment
|
||||
* | | | 8 - Speed alignment
|
||||
* | | | 9 - RTK heading alignment
|
||||
*/
|
||||
float naviPos[3]; /*!< UAV IMU to navigation coordinate system translation vector (xyz) */
|
||||
float naviQuat[4]; /*!< Quaternions from UAV IMU to navigation coordinate system */
|
||||
}T_DjiLidarFrame;
|
||||
|
||||
/**
|
||||
* @bref Radar data frame header
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t dataLen;
|
||||
uint8_t curPack; /*!< The current packet number, in the range of [1, pack_num]. */
|
||||
uint8_t packNum; /*!< Total number of current circle packets, starting from 1. */
|
||||
} T_DjiRadarDataHeader;
|
||||
|
||||
/**
|
||||
* @bref Radar information structure
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t velocity :16; /**
|
||||
* Calculating the actual velocity:
|
||||
*
|
||||
* Actual velocity (m/s) = (Velocity - 32767) / 100
|
||||
*
|
||||
* Interpreting the results:
|
||||
* - If the result is > 0, it indicates that the object is moving closer to the target.
|
||||
* - If the result is < 0, it indicates that the object is moving away from the target.
|
||||
*/
|
||||
uint64_t snr :7; /*!< target SNR, in db, ranging from 0 to 127, with 0 being the null point or no echo point
|
||||
(base_noise calculation base_noise = energy / snr) */
|
||||
uint64_t beamAngle:10; /**
|
||||
* Beam emission angle value:
|
||||
* - Unit: 0.01 degrees
|
||||
* - Stored range: 0~1023
|
||||
* - Actual value range: [-45°, 45°]
|
||||
*
|
||||
* Conversion method:
|
||||
* - Divide stored value x by 10
|
||||
* - If x ≤ 450, the angle remains unchanged
|
||||
* - If x > 450, the angle is adjusted by subtracting 90
|
||||
*
|
||||
* Examples:
|
||||
* - Stored value of 449 yields an angle of 44.9° (449/10 = 44.9°)
|
||||
* - Stored value of 451 yields an angle of -44.9° (451/10 - 90 = -44.9°)
|
||||
* invalid in M400
|
||||
*/
|
||||
|
||||
uint64_t radarType:3; /*!< Radar numbe,is invalid in M400*/
|
||||
|
||||
uint64_t clitterFlag:1; /*!< Flag for clutter point in planar radar: 1 indicates a clutter point, 0 indicates a valid point */
|
||||
|
||||
uint64_t reserved :27;
|
||||
} T_DjiRadarBaseInfo;
|
||||
|
||||
/**
|
||||
* @bref The single point data structure of millimeter wave radar
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t azimuth; /*!
|
||||
* Target azimuth in radar coordinate system:
|
||||
* - Unit: 0.001 radian
|
||||
* - Value range: (0 to 2π) / 0.001
|
||||
* - Calculation method (azimuth/1000 - 2π)
|
||||
*/
|
||||
uint16_t elevation; /*!
|
||||
* Target pitch angle in radar coordinate system:
|
||||
* - Unit: 0.001 radian
|
||||
* - Value range: (0 to 2π) / 0.001
|
||||
* - Calculation method (elevation/1000 - 2π)
|
||||
*/
|
||||
uint16_t radius; /*!
|
||||
* Target radial distance in radar coordinate system:
|
||||
* - Unit: 0.01 meters
|
||||
* - Value range: 0 to 65553 (in steps of 0.01 meters)
|
||||
*/
|
||||
uint16_t ene; /*!
|
||||
* Radar target energy
|
||||
* - Actual value: energy / 100
|
||||
* - invalid in M400
|
||||
*/
|
||||
T_DjiRadarBaseInfo base_info;
|
||||
}T_DjiRadarCloudUnit;
|
||||
|
||||
/**
|
||||
* @bref Perception Radar data frame
|
||||
*/
|
||||
typedef struct {
|
||||
T_DjiRadarDataHeader headInfo;
|
||||
T_DjiRadarCloudUnit data[1];
|
||||
} T_DjiRadarDataFrame;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
* @bref Callback type to receive stereo camera image
|
||||
* @note It is not recommended to perform blocking operations in the callback, as it may lead to data loss.
|
||||
*/
|
||||
typedef void(*DjiPerceptionImageCallback)(T_DjiPerceptionImageInfo imageInfo, uint8_t *imageRawBuffer,
|
||||
uint32_t bufferLen);
|
||||
|
||||
/**
|
||||
* @bref Callback type to receive radar data
|
||||
* @note It is not recommended to perform blocking operations in the callback, as it may lead to data loss.
|
||||
*/
|
||||
typedef void(*DjiPerceptionRadarCallback)(E_DjiPerceptionRadarPosition radarPosition, uint8_t *radarDataBuffer,
|
||||
uint32_t bufferLen);
|
||||
/**
|
||||
* @bref Callback type to process Lidar data
|
||||
* @note It is not recommended to perform blocking operations in the callback, as it may lead to data loss.
|
||||
*/
|
||||
typedef void(*DjiPerceptionLidarDataCallback)(uint8_t* lidarDataBuffer, uint32_t bufferLen);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the perception module.
|
||||
@ -147,18 +365,44 @@ T_DjiReturnCode DjiPerception_SubscribePerceptionImage(E_DjiPerceptionDirection
|
||||
|
||||
/**
|
||||
* @brief Unsubscribe the raw image of both stereo cameras in the same direction.
|
||||
* @param direction: direction to specify the direction of the subscription. Ref to E_DjiPerceptionDirection
|
||||
* @param direction: direction to specify the direction of the subscription. Ref to E_DjiPerceptionDirection.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_UnsubscribePerceptionImage(E_DjiPerceptionDirection direction);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the internal and external parameters of all stereo cameras.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_GetStereoCameraParameters(T_DjiPerceptionCameraParametersPacket *packet);
|
||||
|
||||
/**
|
||||
* @brief Subscribe the lidar data.
|
||||
* @param callback: callback to observer the radar data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_SubscribeLidarData(DjiPerceptionLidarDataCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Unsubscribe the lidar data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_UnsubscribeLidarData(void);
|
||||
|
||||
/**
|
||||
* @brief Subscribe the lidar data of the position.
|
||||
* @param position: position the radar monted
|
||||
* @param callback callback to observer the radar data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_SubscribeRadarData(E_DjiPerceptionRadarPosition position, DjiPerceptionRadarCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Unsubscribe the lidar data of the position.
|
||||
* @param position: position the radar monted
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_UnsubscribeRadarData(E_DjiPerceptionRadarPosition position);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -52,6 +52,11 @@ typedef void *T_DjiUsbBulkHandle;
|
||||
*/
|
||||
typedef void *T_DjiNetworkHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of i2c device operation.
|
||||
*/
|
||||
typedef void *T_DjiI2cHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of thread task operation.
|
||||
*/
|
||||
@ -104,6 +109,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
DJI_HAL_USB_BULK_NUM_0 = 0,
|
||||
DJI_HAL_USB_BULK_NUM_1,
|
||||
DJI_HAL_USB_BULK_NUM_2,
|
||||
DJI_HAL_USB_BULK_NUM_MAX,
|
||||
} E_DjiHalUsbBulkNum;
|
||||
|
||||
@ -133,6 +139,11 @@ typedef struct {
|
||||
bool isDir;
|
||||
} T_DjiFileInfo;
|
||||
|
||||
typedef struct {
|
||||
uint16_t pid;
|
||||
uint16_t vid;
|
||||
} T_DjiHalUartDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UartInit)(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUartHandle *uartHandle);
|
||||
|
||||
@ -143,6 +154,13 @@ typedef struct {
|
||||
T_DjiReturnCode (*UartReadData)(T_DjiUartHandle uartHandle, uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UartGetStatus)(E_DjiHalUartNum uartNum, T_DjiUartStatus *status);
|
||||
|
||||
/**
|
||||
* Get the device info of USB uart (virtual com or TTL-To-USB) which directly connected to UAV.
|
||||
* Use for SDK adapter type Eport V2 ribbon cable.
|
||||
* When using other types of interface, it is not necessary to implement this member function.
|
||||
*/
|
||||
T_DjiReturnCode (*UartGetDeviceInfo)(T_DjiHalUartDeviceInfo *deviceInfo);
|
||||
} T_DjiHalUartHandler;
|
||||
|
||||
typedef struct {
|
||||
@ -172,6 +190,11 @@ typedef struct {
|
||||
} usbNetAdapter;
|
||||
} T_DjiHalNetworkDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
uint32_t i2cSpeed;
|
||||
uint16_t devAddress;
|
||||
} T_DjiHalI2cConfig;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UsbBulkInit)(T_DjiHalUsbBulkInfo usbBulkInfo, T_DjiUsbBulkHandle *usbBulkHandle);
|
||||
|
||||
@ -194,6 +217,18 @@ typedef struct {
|
||||
T_DjiReturnCode (*NetworkGetDeviceInfo)(T_DjiHalNetworkDeviceInfo *deviceInfo);
|
||||
} T_DjiHalNetworkHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*I2cInit)(T_DjiHalI2cConfig i2cConfig, T_DjiI2cHandle *i2cHandle);
|
||||
|
||||
T_DjiReturnCode (*I2cDeInit)(T_DjiI2cHandle i2cHandle);
|
||||
|
||||
T_DjiReturnCode (*I2cWriteData)(T_DjiI2cHandle i2cHandle, uint16_t devAddress, const uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*I2cReadData)(T_DjiI2cHandle i2cHandle, uint16_t devAddress, uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
} T_DjiHalI2cHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*TaskCreate)(const char *name, void *(*taskFunc)(void *),
|
||||
uint32_t stackSize, void *arg, T_DjiTaskHandle *task);
|
||||
@ -314,11 +349,24 @@ T_DjiReturnCode DjiPlatform_RegHalUsbBulkHandler(const T_DjiHalUsbBulkHandler *h
|
||||
* sure that the feature is available after a successful registration.
|
||||
* @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
|
||||
* subsequent functions will not work properly.
|
||||
* @param osalHandler: pointer to the handler for network handler interfaces by your platform.
|
||||
* @param halNetworkHandler: pointer to the handler for network handler interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegHalNetworkHandler(const T_DjiHalNetworkHandler *halNetworkHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for hal i2c master mode interfaces by your platform.
|
||||
* @note It should be noted that the interface in hal is written and tested well. Users need to implement all the
|
||||
* interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
|
||||
* through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
|
||||
* sure that the feature is available after a successful registration.
|
||||
* @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
|
||||
* subsequent functions will not work properly.
|
||||
* @param halI2cHandler: pointer to the handler for hal i2c handler interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegHalI2cHandler(const T_DjiHalI2cHandler *halI2cHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for osal interfaces by your platform.
|
||||
* @note It should be noted that the interface in osal is written and tested well. Users need to implement all the
|
||||
@ -363,6 +411,12 @@ T_DjiHalUsbBulkHandler *DjiPlatform_GetHalUsbBulkHandler(void);
|
||||
*/
|
||||
T_DjiHalNetworkHandler *DjiPlatform_GetHalNetworkHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of i2c interfaces.
|
||||
* @return Pointer to i2c handler.
|
||||
*/
|
||||
T_DjiHalI2cHandler *DjiPlatform_GetHalI2cHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of file-system interfaces.
|
||||
* @return Pointer to file-system handler.
|
||||
|
||||
@ -45,6 +45,12 @@ typedef enum {
|
||||
DJI_POWER_MANAGEMENT_PIN_STATE_SET = 1, /*!< Specifies pin is in high level state. */
|
||||
} E_DjiPowerManagementPinState;
|
||||
|
||||
typedef enum {
|
||||
E_DJI_HIGH_POWER_VOLTAGE_13V6 = 0, /*!< Specifies pin is in 13.6V of voltage */
|
||||
E_DJI_HIGH_POWER_VOLTAGE_17V = 1, /*!< Specifies pin is in 17V of voltage */
|
||||
E_DJI_HIGH_POWER_VOLTAGE_24V = 2, /*!< Specifies pin is in 24V of voltage */
|
||||
} E_DjiHighPowerVoltage;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set level of high power application pin.
|
||||
* @param pinState: level state of pin to be set.
|
||||
@ -87,6 +93,17 @@ T_DjiReturnCode DjiPowerManagement_DeInit(void);
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_ApplyHighPowerSync(void);
|
||||
|
||||
/**
|
||||
* @brief Apply high power from aircraft in blocking mode.
|
||||
* @details Before applying, user should register callback function used to set level state of high power application
|
||||
* pin using DjiPowerManagement_RegWriteHighPowerApplyPinCallback() function. After applying high power, power pin of
|
||||
* DJI adapter will output high power based predetermined specification.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @param voltage: The voltage value will be applied to the VCC pin.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_ApplyHighPowerSyncV2(E_DjiHighPowerVoltage voltage);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to set level state of high power application pin. Must be called before
|
||||
* applying high power.
|
||||
@ -108,6 +125,15 @@ T_DjiReturnCode DjiPowerManagement_RegWriteHighPowerApplyPinCallback(DjiWriteHig
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_RegPowerOffNotificationCallback(DjiPowerOffNotificationCallback callback);
|
||||
|
||||
/**
|
||||
* @brief manifold3 outputs high voltage to external devices
|
||||
* @param stat: true: output high voltage, false: output low voltage
|
||||
* @return Execution result.
|
||||
* @note The gpio12 of manifold3 should be pulled down before requesting a high voltage output.
|
||||
* @note This interface support on DJI manifold3.
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_OutputHighPower(bool stat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -44,8 +44,9 @@ extern "C" {
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define DJI_PI (3.14159265358979323846f)
|
||||
#define DJI_FILE_NAME_SIZE_MAX 256
|
||||
#define DJI_FILE_MD5_LENGTH 16
|
||||
#define DJI_FILE_PATH_SIZE_MAX (DJI_FILE_NAME_SIZE_MAX + 256)
|
||||
#define DJI_IP_ADDR_STR_SIZE_MAX 15
|
||||
#define DJI_IP_ADDR_STR_SIZE_MAX 16
|
||||
#define DJI_MD5_BUFFER_LEN 16
|
||||
|
||||
#define DJI_SUBSCRIPTION_MODULE_INDEX_OFFSET 24u
|
||||
@ -58,6 +59,12 @@ extern "C" {
|
||||
(((((uint32_t)(subscriptionModule)) << (DJI_SUBSCRIPTION_MODULE_INDEX_OFFSET)) & (DJI_SUBSCRIPTION_MODULE_INDEX_MASK)) | \
|
||||
((((uint32_t)(topicCode)) << (DJI_SUBSCRIPTION_TOPIC_CODE_OFFSET)) & (DJI_SUBSCRIPTION_TOPIC_CODE_MASK)))
|
||||
|
||||
#define DJI_DATA_SUBSCRIPTION_TOPIC_GET_MODULE(topic) \
|
||||
((uint32_t)((topic & DJI_SUBSCRIPTION_MODULE_INDEX_MASK) >> DJI_SUBSCRIPTION_MODULE_INDEX_OFFSET))
|
||||
|
||||
#define DJI_DATA_SUBSCRIPTION_TOPIC_GET_CODE(topic) \
|
||||
((uint32_t)((topic & DJI_SUBSCRIPTION_TOPIC_CODE_MASK) >> DJI_SUBSCRIPTION_TOPIC_CODE_OFFSET))
|
||||
|
||||
/**
|
||||
* @brief Type define double as dji_f64_t.
|
||||
*/
|
||||
@ -76,7 +83,9 @@ typedef enum {
|
||||
DJI_MOUNT_POSITION_TYPE_UNKNOWN = 0,
|
||||
DJI_MOUNT_POSITION_TYPE_PAYLOAD_PORT = 1,
|
||||
DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT = 2,
|
||||
DJI_MOUNT_POSITION_TYPE_EXTENSION_LITE_PORT = 3
|
||||
DJI_MOUNT_POSITION_TYPE_EXTENSION_LITE_PORT = 3,
|
||||
DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT_V2 = 4,
|
||||
DJI_MOUNT_POSITION_TYPE_MANIFOLD3_ONBOARD = 5,
|
||||
} E_DjiMountPositionType;
|
||||
|
||||
typedef enum {
|
||||
@ -84,8 +93,16 @@ typedef enum {
|
||||
DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 = 1,
|
||||
DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 = 2,
|
||||
DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3 = 3,
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT = 4,
|
||||
DJI_MOUNT_POSITION_EXTENSION_LITE_PORT = 5,
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO1 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1, /*!< Payload on Port: E1*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO2 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2, /*!< Payload on Port: E2*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO3 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3, /*!< Payload on Port: E3*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO4 = 4, /*!< Payload on Port: E4*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO5 = 5, /*!< Payload on Port: usb hub port1*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO6 = 6, /*!< Payload on Port: usb hub port2*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO7 = 7, /*!< Payload on Port: usb hub port3*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT,
|
||||
DJI_MOUNT_POSITION_EXTENSION_PORT_V2_NO8 = 8, /*!< Payload on Port: usb hub port4*/
|
||||
DJI_MOUNT_POSITION_EXTENSION_LITE_PORT,
|
||||
} E_DjiMountPosition;
|
||||
|
||||
typedef enum {
|
||||
@ -97,6 +114,9 @@ typedef enum {
|
||||
DJI_AIRCRAFT_SERIES_M350 = 5,
|
||||
DJI_AIRCRAFT_SERIES_M3D = 6,
|
||||
DJI_AIRCRAFT_SERIES_FC30 = 7,
|
||||
DJI_AIRCRAFT_SERIES_M4 = 8,
|
||||
DJI_AIRCRAFT_SERIES_M4D = 9,
|
||||
DJI_AIRCRAFT_SERIES_M400 = 10,
|
||||
} E_DjiAircraftSeries;
|
||||
|
||||
typedef enum {
|
||||
@ -110,9 +130,15 @@ typedef enum {
|
||||
DJI_AIRCRAFT_TYPE_M3E = 77, /*!< Aircraft type is Mavic 3E. */
|
||||
DJI_AIRCRAFT_TYPE_FC30 = 78, /* !<Aircraft type is FlyCart 30> */
|
||||
DJI_AIRCRAFT_TYPE_M3T = 79, /*!< Aircraft type is Mavic 3T. */
|
||||
DJI_AIRCRAFT_TYPE_M3TA = 80, /*!< Aircraft type is Mavic 3TA. */
|
||||
DJI_AIRCRAFT_TYPE_M350_RTK = 89, /*!< Aircraft type is Matrice 350 RTK. */
|
||||
DJI_AIRCRAFT_TYPE_M3D = 91, /*!< Aircraft type is Matrice 3D. */
|
||||
DJI_AIRCRAFT_TYPE_M3TD = 93, /*!< Aircraft type is Matrice 3TD. */
|
||||
DJI_AIRCRAFT_TYPE_M4T = 99, /*!< Aircraft type is Matrice 4T. */
|
||||
DJI_AIRCRAFT_TYPE_M4E = 990, /*!< Aircraft type is Matrice 4E. */
|
||||
DJI_AIRCRAFT_TYPE_M4TD = 100, /*!< Aircraft type is Matrice 4TD. */
|
||||
DJI_AIRCRAFT_TYPE_M4D = 1000, /*!< Aircraft type is Matrice 4D. */
|
||||
DJI_AIRCRAFT_TYPE_M400 = 103, /*!< Aircraft type is Matrice 400. */
|
||||
} E_DjiAircraftType;
|
||||
|
||||
/**
|
||||
@ -130,14 +156,20 @@ typedef enum {
|
||||
DJI_CAMERA_TYPE_P1 = 50, /*!< Camera type is P1. */
|
||||
DJI_CAMERA_TYPE_L1, /*!< Camera type is L1. */
|
||||
DJI_CAMERA_TYPE_L2 = 84, /*!< Camera type is L2. */
|
||||
DJI_CAMERA_TYPE_L3 = 117, /*!< Camera type is L3. */
|
||||
DJI_CAMERA_TYPE_M30 = 52, /*!< Camera type is M30. */
|
||||
DJI_CAMERA_TYPE_M30T = 53, /*!< Camera type is M30T. */
|
||||
DJI_CAMERA_TYPE_M3E = 66, /*!< Camera type is M3E. */
|
||||
DJI_CAMERA_TYPE_M3T = 67, /*!< Camera type is M3T. */
|
||||
DJI_CAMERA_TYPE_M3TA = 68, /*!< Camera type is M3T. */
|
||||
DJI_CAMERA_TYPE_M3D = 80, /*!< Camera type is Matrice 3D. */
|
||||
DJI_CAMERA_TYPE_M3TD = 81, /*!< Camera type is Matrice 3TD. */
|
||||
DJI_CAMERA_TYPE_H30 = 82, /*!< Camera type is H30. */
|
||||
DJI_CAMERA_TYPE_H30T = 83, /*!< Camera type is H30T. */
|
||||
DJI_CAMERA_TYPE_M4T = 89, /*!< Camera type is M4T. */
|
||||
DJI_CAMERA_TYPE_M4E = 891, /*!< Camera type is M4E. */
|
||||
DJI_CAMERA_TYPE_M4TD = 90, /*!< Camera type is M4TD. */
|
||||
DJI_CAMERA_TYPE_M4D = 91, /*!< Camera type is M4D. */
|
||||
} E_DjiCameraType;
|
||||
|
||||
/**
|
||||
@ -248,7 +280,9 @@ typedef enum {
|
||||
DJI_SDK_ADAPTER_TYPE_UNKNOWN = 0, /*!< SDK adapter type is unknown. */
|
||||
DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 = 1, /*!< SDK adapter type is Skyport V2. */
|
||||
DJI_SDK_ADAPTER_TYPE_XPORT = 2, /*!< SDK adapter type is X-Port. */
|
||||
DJI_SDK_ADAPTER_TYPE_NONE = 3, /*!< No external adapter is connected. */
|
||||
DJI_SDK_ADAPTER_TYPE_NONE = 3, /*!< don't have any adapter outside */
|
||||
DJI_SDK_ADAPTER_TYPE_SKYPORT_V3 = 4, /*!< SDK adapter type is Skyport V3 */
|
||||
DJI_SDK_ADAPTER_TYPE_EPORT_V2_RIBBON_CABLE = 5, /*!< SDK adapter type is Eport V2 ribbon cable */
|
||||
} E_DjiSdkAdapterType;
|
||||
|
||||
typedef enum {
|
||||
@ -256,7 +290,15 @@ typedef enum {
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1,
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO2,
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO3,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO1 = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO2 = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO2,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO3 = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO3,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO4,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO5,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO6,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO7,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT_V2_NO8 = DJI_CHANNEL_ADDRESS_EXTENSION_PORT,
|
||||
DJI_CHANNEL_ADDRESS_MASTER_RC_APP,
|
||||
DJI_CHANNEL_ADDRESS_SLAVE_RC_APP,
|
||||
DJI_CHANNEL_ADDRESS_CLOUD_API,
|
||||
@ -278,6 +320,7 @@ typedef struct {
|
||||
uint8_t captureCount; /*!< Specifies the total capture count of interval settings.
|
||||
* 0: reserved, 1-254: specific number, 255: continuous capture until stopped. */
|
||||
uint16_t timeIntervalSeconds; /*!< Specifies the interval time between two captures, unit: s*/
|
||||
uint16_t timeIntervalMilliseconds; /*!< Specifies the interval time between two captures, unit: ms*/
|
||||
} T_DjiCameraPhotoTimeIntervalSettings;
|
||||
|
||||
/**
|
||||
|
||||
@ -33,11 +33,11 @@ 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 9 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
|
||||
#define DJI_VERSION_MODIFY 1 /*!< 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 2090 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
||||
#define DJI_VERSION_MAJOR 3 /*!< DJI SDK major version num, when have incompatible API changes. Range from 0 to 99. */
|
||||
#define DJI_VERSION_MINOR 15 /*!< 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 2318 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -1,126 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_aircraft_info.h
|
||||
* @brief This is the header file for "psdk_aircraft_info.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 DJI’s 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 PSDK_AIRCRAFT_INFO_H
|
||||
#define PSDK_AIRCRAFT_INFO_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include <dji_typedef.h>
|
||||
#include <dji_aircraft_info.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Aircraft type.
|
||||
*/
|
||||
typedef E_DjiAircraftType E_PsdkAircraftInfoType;
|
||||
#define PSDK_AIRCRAFT_INFO_TYPE_UNKNOWN DJI_AIRCRAFT_TYPE_UNKNOWN /*!< Aircraft type is unknown. */
|
||||
#define PSDK_AIRCRAFT_INFO_TYPE_M200_V2 DJI_AIRCRAFT_TYPE_M200_V2 /*!< Aircraft type is Matrice 200 V2. */
|
||||
#define PSDK_AIRCRAFT_INFO_TYPE_M210_V2 DJI_AIRCRAFT_TYPE_M210_V2 /*!< Aircraft type is Matrice 220 V2. */
|
||||
#define PSDK_AIRCRAFT_INFO_TYPE_M210RTK_V2 DJI_AIRCRAFT_TYPE_M210RTK_V2 /*!< Aircraft type is Matrice 210 RTK V2. */
|
||||
#define PSDK_AIRCRAFT_INFO_TYPE_M300_RTK DJI_AIRCRAFT_TYPE_M300_RTK /*!< Aircraft type is Matrice 300 RTK. */
|
||||
|
||||
/**
|
||||
* @brief PSDK adapter type.
|
||||
*/
|
||||
typedef E_DjiSdkAdapterType E_PsdkAircraftInfoPsdkAdapterType;
|
||||
#define PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_UNKNOWN DJI_SDK_ADAPTER_TYPE_UNKNOWN /*!< PSDK adapter type is unknown. */
|
||||
#define PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_SKYPORT_V2 DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 /*!< PSDK adapter type is Skyport V2. */
|
||||
#define PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_XPORT DJI_SDK_ADAPTER_TYPE_XPORT /*!< PSDK adapter type is X-Port. */
|
||||
|
||||
/**
|
||||
* @brief Payload mount position.
|
||||
*/
|
||||
typedef E_DjiMountPosition E_PsdkAircraftInfoPayloadMountPosition;
|
||||
#define PSDK_AIRCRAFT_INFO_PAYLOAD_MOUNT_POSITION_UNKNOWN DJI_MOUNT_POSITION_UNKNOWN /*!< Payload mount position is unknown.. */
|
||||
#define PSDK_AIRCRAFT_INFO_PAYLOAD_MOUNT_POSITION_NO1 DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 /*!< Payload is mounted on the first gimbal connector of aircraft. */
|
||||
#define PSDK_AIRCRAFT_INFO_PAYLOAD_MOUNT_POSITION_NO2 DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 /*!< Payload is mounted on the second gimbal connector of aircraft. */
|
||||
#define PSDK_AIRCRAFT_INFO_PAYLOAD_MOUNT_POSITION_NO3 DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3 /*!< Payload is mounted on the third gimbal connector of aircraft. */
|
||||
|
||||
/**
|
||||
* @brief Mobile APP system language.
|
||||
*/
|
||||
typedef E_DjiMobileAppLanguage E_PsdkAircraftInfoMobileAppLanguage;
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_LANGUAGE_UNKNOWN DJI_MOBILE_APP_LANGUAGE_UNKNOWN /*!< The system language of the mobile app is unknown */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_LANGUAGE_ENGLISH DJI_MOBILE_APP_LANGUAGE_ENGLISH /*!< The system language of the mobile app is English */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_LANGUAGE_CHINESE DJI_MOBILE_APP_LANGUAGE_CHINESE /*!< The system language of the mobile app is Chinese */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_LANGUAGE_JAPANESE DJI_MOBILE_APP_LANGUAGE_JAPANESE /*!< The system language of the mobile app is Japanese */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_LANGUAGE_FRENCH DJI_MOBILE_APP_LANGUAGE_FRENCH /*!< The system language of the mobile app is French */
|
||||
|
||||
/**
|
||||
* @brief Mobile APP screen size type.
|
||||
*/
|
||||
typedef E_DjiMobileAppScreenType E_PsdkAircraftInfoMobileAppScreenType;
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_SCREEN_TYPE_UNKNOWN DJI_MOBILE_APP_SCREEN_TYPE_UNKNOWN /*!< Mobile APP screen type is unknown. */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN /*!< The big screen of mobile device refers to a screen
|
||||
* size greater than or equal to 6 inches. */
|
||||
#define PSDK_AIRCRAFT_INFO_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN DJI_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN /*!< The little screen of mobile device refers to a
|
||||
* screen size less than 6 inches. */
|
||||
|
||||
/**
|
||||
* @brief Some base information of aircraft system, mainly including some constant parameters information of system.
|
||||
*/
|
||||
typedef struct {
|
||||
E_PsdkAircraftInfoType aircraftType; /*!< Aircraft type. */
|
||||
E_PsdkAircraftInfoPsdkAdapterType psdkAdapterType; /*!< PSDK adapter type. */
|
||||
E_PsdkAircraftInfoPayloadMountPosition payloadMountPosition; /*!< Payload mount position. */
|
||||
} T_PsdkAircraftInfoBaseInfo;
|
||||
|
||||
/**
|
||||
* @brief Information related to mobile APP.
|
||||
*/
|
||||
typedef T_DjiMobileAppInfo T_PsdkAircraftInfoMobileAppInfo;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Get base information of aircraft system, including aircraft type and PSDK adapter type.
|
||||
* @param baseInfo: pointer to memory space used to store base information of the aircraft system.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkAircraftInfo_GetBaseInfo(T_PsdkAircraftInfoBaseInfo *baseInfo);
|
||||
|
||||
/**
|
||||
* @brief Get information related to mobile APP.
|
||||
* @note The mobile APP language and screen type is unknown if RC or APP is not connected to the aircraft system.
|
||||
* @param mobileAppInfo: pointer to memory space used to store information related to mobile APP.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkAircraftInfo_GetMobileAppInfo(T_PsdkAircraftInfoMobileAppInfo *mobileAppInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_AIRCRAFT_INFO_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,72 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_core.h
|
||||
* @brief This is the header file for "psdk_core.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 DJI’s 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 PSDK_CORE_H
|
||||
#define PSDK_CORE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <legacy_psdk2.x/psdk_typedef.h>
|
||||
#include <dji_core.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef T_DjiUserInfo T_PsdkUserInfo;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @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
|
||||
* information correctly to ensure the initialization is successful. For additional instructions, please refer to the
|
||||
* tutorial“PSDK Initialization”.
|
||||
* @note This function does not return until the correct aircraft type and PSDK adapter type is obtained. The logic ensures
|
||||
* that aircraft and PSDK adapter have been started up normally before PSDK functional module and user's program run.
|
||||
* General execution time of this function is 2~4 seconds.
|
||||
* @param userInfo: pointer to the PSDK application information.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkCore_Init(const T_PsdkUserInfo *userInfo);
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkCore_ApplicationStart(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_CORE_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,72 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_data_channel.h
|
||||
* @brief This is the header file for "psdk_data_channel.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 DJI’s 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 PSDK_DATA_CHANNEL_H
|
||||
#define PSDK_DATA_CHANNEL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_high_speed_data_channel.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Percentage of bandwidth proportion of high-speed channel.
|
||||
*/
|
||||
typedef T_DjiDataChannelBandwidthProportionOfHighspeedChannel T_PsdkDataChannelBandwidthProportionOfHighspeedChannel;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Set bandwidth proportion for the data stream, video stream and download stream of high-speed channel.
|
||||
* @details Self-defined bandwidth distribution mechanism allows that user can control bandwidth limitation
|
||||
* freely. System multiplies total bandwidth limitation of the high-speed channel by a proportion of the corresponding stream to
|
||||
* get realtime bandwidth limitation of the specified stream. Realtime bandwidth limitation of data and video stream can be
|
||||
* gotten by PsdkDataTransmission_GetDataStreamState() and PsdkPayloadCamera_GetVideoStreamState() interfaces. Total
|
||||
* bandwidth of the high-speed channel is determined by the environment in which the system located and loading of system. If
|
||||
* user does not set bandwidth proportion for each stream, the default proportion is 33% (data stream), 33% (video
|
||||
* stream) and 34% (download stream).
|
||||
* @note The bandwidth proportion will be effective after a while, the max value is 1s. If you want use this interface, should calling
|
||||
* PsdkPlatform_RegHalNetworkHandler interface firstly, otherwise this interface will not work.
|
||||
* @param bandwidthProportion: bandwidth proportion of each stream of high-speed channel. The Sum of bandwidth proportion
|
||||
* must equal 100.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataChannel_SetBandwidthProportionForHighspeedChannel(
|
||||
T_PsdkDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_DATA_CHANNEL_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,434 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_data_subscription.h
|
||||
* @brief This is the header file for "psdk_data_subscription.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 DJI’s 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 PSDK_DATA_SUBSCRIPTION_H
|
||||
#define PSDK_DATA_SUBSCRIPTION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_fc_subscription.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Name of topics that can be subscribed. Topic is minimum data item subscribed.
|
||||
*/
|
||||
typedef E_DjiFcSubscriptionTopic E_PsdkDataSubscriptionTopicName;
|
||||
/*!
|
||||
* @brief Quaternion of aircraft topic name. Quaternion topic provides aircraft body frame (FRD) to ground frame
|
||||
* (NED) rotation. Please refer to ::T_PsdkDataSubscriptionQuaternion for information about data structure.
|
||||
* @details The DJI quaternion follows Hamilton convention (q0 = w, q1 = x, q2 = y, q3 = z).
|
||||
* | Angle | Unit | Accuracy | Notes |
|
||||
|--------------|------|------------|-------------------------------------------------|
|
||||
| pitch, roll | deg | <1 | in NON-AHRS mode |
|
||||
| yaw | deg | <3 | in well-calibrated compass with fine aligned |
|
||||
| yaw with rtk | deg | around 1.2 | in RTK heading fixed mode with 1 meter baseline |
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_QUATERNION DJI_FC_SUBSCRIPTION_TOPIC_QUATERNION
|
||||
|
||||
/*!
|
||||
* @brief Velocity of aircraft topic name. Velocity topic provides aircraft's velocity in a ground-fixed NEU frame.
|
||||
* Please refer to ::T_PsdkDataSubscriptionVelocity for information about data structure.
|
||||
* @warning Please note that this data is not in a conventional right-handed frame of reference.
|
||||
* @details This velocity data is a fusion output from the aircraft. Original output is in a right-handed NED frame, but the
|
||||
* sign of the Z-axis velocity is flipped before publishing to this topic. So if you are looking to get velocity
|
||||
* in an NED frame, simply flip the sign of the z-axis value. Beyond that, you can convert using rotations to
|
||||
* any right-handed frame of reference.
|
||||
* | Axis | Unit | Accuracy |
|
||||
|----------|------|---------------------------------------------------------------------------------------------|
|
||||
| vgx, vgy | m/s | Around 5cm/s for GNSS navigation. Around 3cm/s with VO at 1 meter height |
|
||||
| vgz | m/s | 10cm/s only with barometer in steady air. 3cm/s with VO at 1 meter height with 8cm baseline |
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_VELOCITY DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY
|
||||
|
||||
/*!
|
||||
* @brief Fused altitude of aircraft topic name. Fused altitude topic provides aircraft's fused altitude from sea
|
||||
* level. Please refer to ::T_PsdkDataSubscriptionAltitudeFused for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_ALTITUDE_FUSED DJI_FC_SUBSCRIPTION_TOPIC_ALTITUDE_FUSED
|
||||
|
||||
/*!
|
||||
* @brief Relative height above ground of aircraft topic name. Please refer to
|
||||
* ::T_PsdkDataSubscriptionHeightRelative for information about data structure.
|
||||
* @details This data is a fusion output from aircraft. The height is a direct estimate of the closest large object
|
||||
* below the aircraft's ultrasonic sensors.
|
||||
* @warning This topic does not come with a 'valid' flag - so if the aircraft is too far from an object for the
|
||||
* ultrasonic sensors/VO to provide any meaningful data, the values will latch and there is no way for user to
|
||||
* determine if the data is valid or not. Please use with caution.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_HEIGHT_RELATIVE DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_RELATIVE
|
||||
|
||||
/*!
|
||||
* Fused position of aircraft topic name. Please refer to ::T_PsdkDataSubscriptionPositionFused for information
|
||||
* about data structure.
|
||||
* @warning Please note that if GPS signal is weak (low visibleSatelliteNumber, see below), the
|
||||
* latitude/longitude values won't be updated but the altitude might still be. There is currently no way to know if
|
||||
* the lat/lon update is healthy.
|
||||
* @details The most important component of this topic is the T_PsdkDataSubscriptionPositionFused::visibleSatelliteNumber.
|
||||
* Use this to track your GPS satellite coverage and build some heuristics for when you might expect to lose GPS updates.
|
||||
* | Axis | Unit | Position Sensor | Accuracy |
|
||||
|------|------|-----------------|--------------------------------------------------|
|
||||
| x, y | m | GPS | <3m with open sky without multipath |
|
||||
| z | m | GPS | <5m with open sky without multipath |
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_POSITION_FUSED DJI_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED
|
||||
|
||||
/*!
|
||||
* @brief GPS date topic name. Please refer to ::T_PsdkDataSubscriptionGpsDate for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_DATE DJI_FC_SUBSCRIPTION_TOPIC_GPS_DATE
|
||||
|
||||
/*!
|
||||
* @brief GPS time topic name. Please refer to ::T_PsdkDataSubscriptionGpsTime for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_TIME DJI_FC_SUBSCRIPTION_TOPIC_GPS_TIME
|
||||
|
||||
/*!
|
||||
* @brief GPS position topic name. Please refer to ::T_PsdkDataSubscriptionGpsPosition for information about data structure.
|
||||
* @details
|
||||
* | Axis | Accuracy |
|
||||
|------|--------------------------------------------------|
|
||||
| x, y | <3m with open sky without multipath |
|
||||
| z | <5m with open sky without multipath |
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_POSITION DJI_FC_SUBSCRIPTION_TOPIC_GPS_POSITION
|
||||
|
||||
/*!
|
||||
* @brief GPS velocity topic name. Please refer to ::T_PsdkDataSubscriptionGpsVelocity for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_VELOCITY DJI_FC_SUBSCRIPTION_TOPIC_GPS_VELOCITY
|
||||
|
||||
/*!
|
||||
* @brief GPS details topic name. GPS details topic provides GPS state and other detail information. Please refer
|
||||
* to ::T_PsdkDataSubscriptionGpsDetail for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_DETAILS DJI_FC_SUBSCRIPTION_TOPIC_GPS_DETAILS
|
||||
|
||||
/*!
|
||||
* @brief GPS signal level topic name. This topic provides a measure of the quality of GPS signal. Please refer to
|
||||
* ::T_PsdkDataSubscriptionGpsSignalLevel for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_GPS_SIGNAL_LEVEL DJI_FC_SUBSCRIPTION_TOPIC_GPS_SIGNAL_LEVEL
|
||||
|
||||
/*!
|
||||
* @brief RTK position topic name. Please refer to ::T_PsdkDataSubscriptionRtkPosition for information about data structure.
|
||||
* @details
|
||||
* | Axis | Accuracy |
|
||||
|------|--------------------------------------------------|
|
||||
| x, y | ~2cm with fine alignment and fix condition |
|
||||
| z | ~3cm with fine alignment and fix condition |
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_RTK_POSITION DJI_FC_SUBSCRIPTION_TOPIC_RTK_POSITION
|
||||
|
||||
/*!
|
||||
* @brief RTK velocity topic name. Please refer to ::T_PsdkDataSubscriptionRtkVelocity for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_RTK_VELOCITY DJI_FC_SUBSCRIPTION_TOPIC_RTK_VELOCITY
|
||||
|
||||
/*!
|
||||
* @brief RTK yaw topic name. Please refer to ::T_PsdkDataSubscriptionRtkYaw for information about data structure.
|
||||
* @details The RTK yaw will provide the vector from ANT1 to ANT2 as configured in DJI Assistant 2. This
|
||||
* means that the value of RTK yaw will be 90deg offset from the yaw of the aircraft.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_RTK_YAW DJI_FC_SUBSCRIPTION_TOPIC_RTK_YAW
|
||||
|
||||
/*!
|
||||
* @brief RTK position information topic name. RTK position information topic provides a state of RTK position
|
||||
* solution. Please refer to ::T_PsdkDataSubscriptionRtkPositionInfo for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_RTK_POSITION_INFO DJI_FC_SUBSCRIPTION_TOPIC_RTK_POSITION_INFO
|
||||
|
||||
/*!
|
||||
* @brief RTK yaw topic name. RTK yaw information topic provides a state of RTK yaw solution. Please refer to
|
||||
* ::T_PsdkDataSubscriptionRtkYawInfo for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_RTK_YAW_INFO DJI_FC_SUBSCRIPTION_TOPIC_RTK_YAW_INFO
|
||||
|
||||
/*!
|
||||
* @brief Flight status topic name. Please refer to ::T_PsdkDataSubscriptionFlightStatus for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_STATUS_FLIGHT DJI_FC_SUBSCRIPTION_TOPIC_STATUS_FLIGHT
|
||||
|
||||
/*!
|
||||
* @brief Battery information topic name. Please refer to ::T_PsdkDataSubscriptionBatteryInfo for information about data structure.
|
||||
*/
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_BATTERY_INFO DJI_FC_SUBSCRIPTION_TOPIC_BATTERY_INFO
|
||||
|
||||
/*! Total number of topics that can be subscribed. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_TOPIC_TOTAL_NUMBER DJI_FC_SUBSCRIPTION_TOPIC_TOTAL_NUMBER
|
||||
|
||||
|
||||
/**
|
||||
* @brief Health state of data subscribed.
|
||||
*/
|
||||
typedef E_DjiFcSubscriptionDataHealthFlag E_PsdkDataSubscriptionDataHealthFlag;
|
||||
#define PSDK_DATA_SUBSCRIPTION_DATA_NOT_HEALTH DJI_FC_SUBSCRIPTION_DATA_NOT_HEALTH /*!< Data subscribed is healthy and can be used. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_DATA_HEALTH DJI_FC_SUBSCRIPTION_DATA_HEALTH /*!< Data subscribed is not healthy and recommend not to use it. */
|
||||
|
||||
/**
|
||||
* @brief Position solution property.
|
||||
*/
|
||||
typedef E_DjiFcSubscriptionPositionSolutionProperty E_PsdkDataSubscriptionPositionSolutionProperty;
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NOT_AVAILABLE DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NOT_AVAILABLE /*!< Position solution is not available. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_POSITION DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_POSITION /*!< Position has been fixed by the FIX POSITION command. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_HEIGHT_AUTO DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_HEIGHT_AUTO /*!< Position has been fixed by the FIX HEIGHT/AUTO command. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_INSTANTANEOUS_DOPPLER_COMPUTE_VELOCITY DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_INSTANTANEOUS_DOPPLER_COMPUTE_VELOCITY /*!< Velocity computed using instantaneous Doppler. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SINGLE_PNT_SOLUTION DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SINGLE_PNT_SOLUTION /*!< Single point position solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_PSEUDORANGE_DIFFERENTIAL_SOLUTION DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_PSEUDORANGE_DIFFERENTIAL_SOLUTION /*!< Pseudorange differential solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SBAS_CORRECTION_CALCULATED DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SBAS_CORRECTION_CALCULATED /*!< Solution calculated using corrections from an SBAS. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_KALMAN_FILTER_WITHOUT_OBSERVATION_PROPAGATED DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_KALMAN_FILTER_WITHOUT_OBSERVATION_PROPAGATED /*!< Propagated by a Kalman filter without new observations. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_OMNISTAR_VBS_POSITION DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_OMNISTAR_VBS_POSITION /*!< OmniSTAR VBS position (L1 sub-metre). */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_L1_AMBIGUITY DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_L1_AMBIGUITY /*!< Floating L1 ambiguity solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_IONOSPHERIC_FREE_AMBIGUITY DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_IONOSPHERIC_FREE_AMBIGUITY /*!< Floating ionospheric-free ambiguity solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_SOLUTION DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_SOLUTION /*!< Float position solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_L1_AMBIGUITY_INT DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_L1_AMBIGUITY_INT /*!< Integer L1 ambiguity solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_WIDE_LANE_AMBIGUITY_INT DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_WIDE_LANE_AMBIGUITY_INT /*!< Integer wide-lane ambiguity solution. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NARROW_INT DJI_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NARROW_INT /*!< Narrow fixed point position solution. */
|
||||
|
||||
/**
|
||||
* @brief GPS fix state.
|
||||
*/
|
||||
typedef E_DjiFcSubscriptionGpsFixState E_PsdkDataSubscriptionGpsFixState;
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_NO_FIX DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_NO_FIX /*!< GPS position has not been fixed. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_DEAD_RECKONING_ONLY DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_DEAD_RECKONING_ONLY /*!< GPS position is dead reckoned only. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_2D_FIX DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_2D_FIX /*!< The horizontal position with latitude/longitude (or northing/easting or X/Y) is fixed. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_3D_FIX DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_3D_FIX /*!< The horizontal and vertical position with latitude/longitude/altitude (northing/easting/altitude or X/Y/Z) is fixed. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_GPS_PLUS_DEAD_RECKONING DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_GPS_PLUS_DEAD_RECKONING /*!< Position is calculated by GPS and combined with dead reckoning. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_GPS_FIX_STATE_TIME_ONLY_FIX DJI_FC_SUBSCRIPTION_GPS_FIX_STATE_TIME_ONLY_FIX /*!< Only time is fixed. */
|
||||
/**
|
||||
* @brief Flight status of aircraft.
|
||||
*/
|
||||
typedef E_DjiFcSubscriptionFlightStatus E_PsdkDataSubscriptionFlightStatus;
|
||||
#define PSDK_DATA_SUBSCRIPTION_FLIGHT_STATUS_STOPED DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_STOPED /*!< Aircraft is on ground and motors are still. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_FLIGHT_STATUS_ON_GROUND DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_ON_GROUND/*!< Aircraft is on ground but motors are rotating. */
|
||||
#define PSDK_DATA_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR /*!< Aircraft is in air. */
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/**
|
||||
* @brief Timestamp data structure.
|
||||
*/
|
||||
typedef T_DjiDataTimestamp T_PsdkDataSubscriptiontTimestamp;
|
||||
|
||||
/**
|
||||
* @brief Quaternion topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionQuaternion T_PsdkDataSubscriptionQuaternion;
|
||||
|
||||
/**
|
||||
* @brief Velocity topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionVelocity T_PsdkDataSubscriptionVelocity;
|
||||
|
||||
/**
|
||||
* @brief Fused altitude topic data structure, unit: m.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionAltitudeFused T_PsdkDataSubscriptionAltitudeFused;
|
||||
|
||||
/**
|
||||
* @brief Relative height above ground topic data structure, unit: m.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionHeightRelative T_PsdkDataSubscriptionHeightRelative;
|
||||
|
||||
/**
|
||||
* @brief Fused position topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionPositionFused T_PsdkDataSubscriptionPositionFused;
|
||||
|
||||
/**
|
||||
* @brief GPS date topic data structure, format: yyyymmdd.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsDate T_PsdkDataSubscriptionGpsDate;
|
||||
|
||||
/**
|
||||
* @brief GPS time topic data structure, format: hhmmss.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsTime T_PsdkDataSubscriptionGpsTime;
|
||||
|
||||
/**
|
||||
* @brief GPS position topic data structure. x = Longitude, y = Latitude, z = Altitude, unit: deg*10<SUP>-7</SUP>
|
||||
* (Lat,Lon), mm (Alt)
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsPosition T_PsdkDataSubscriptionGpsPosition;
|
||||
|
||||
/**
|
||||
* @brief GPS velocity topic data structure, unit: cm/s.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsVelocity T_PsdkDataSubscriptionGpsVelocity;
|
||||
|
||||
/**
|
||||
* @brief GPS details topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsDetails T_PsdkDataSubscriptionGpsDetail;
|
||||
|
||||
/**
|
||||
* @brief GPS signal level topic data structure. Signal level of GPS. The level varies from 0 to 5, with 0 being the
|
||||
* worst and 5 the best GPS signal.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionGpsSignalLevel T_PsdkDataSubscriptionGpsSignalLevel;
|
||||
|
||||
/**
|
||||
* @brief RTK position topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionRtkPosition T_PsdkDataSubscriptionRtkPosition;
|
||||
|
||||
/**
|
||||
* @brief RTK velocity topic data structure, unit: cm/s.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionRtkVelocity T_PsdkDataSubscriptionRtkVelocity;
|
||||
|
||||
/**
|
||||
* @brief RTK yaw topic data structure, unit: deg.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionRtkYaw T_PsdkDataSubscriptionRtkYaw;
|
||||
|
||||
/**
|
||||
* @brief RTK position information topic data structure. Specifies RTK position solution state, it can be any value of
|
||||
* ::E_PsdkDataSubscriptionPositionSolutionProperty.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionRtkPositionInfo T_PsdkDataSubscriptionRtkPositionInfo;
|
||||
|
||||
/**
|
||||
* @brief RTK yaw information topic data structure. Specifies RTK yaw solution state, it can be any value of
|
||||
* ::E_PsdkDataSubscriptionPositionSolutionProperty.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionRtkYawInfo T_PsdkDataSubscriptionRtkYawInfo;
|
||||
|
||||
/**
|
||||
* @brief Flight status information topic data structure. It can be any value of ::E_PsdkDataSubscriptionFlightStatus.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionFlightStatus T_PsdkDataSubscriptionFlightStatus;
|
||||
|
||||
/**
|
||||
* @brief Battery information topic data structure.
|
||||
*/
|
||||
typedef T_DjiFcSubscriptionWholeBatteryInfo T_PsdkDataSubscriptionBatteryInfo;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive data of topic.
|
||||
* @warning User can not execute blocking style operations or functions in the callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param data: pointer to data of the topic, user need transfer type of this pointer to the corresponding data structure
|
||||
* pointer for getting every item of the topic conveniently.
|
||||
* @param dataSize: the size of memory space pointed by data argument, equal to data structure size corresponding to the topic.
|
||||
* @param timestamp: pointer to timestamp corresponding this data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiReceiveDataOfTopicCallback ReceiveDataOfTopicCallback;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise data subscription module in blocking mode. This function has to be called before subscribing any
|
||||
* data, to initialize run environment of data subscription module, if need to subscribe data from aircraft.
|
||||
* @note Max execution time of this function is slightly larger than 500ms.
|
||||
* @note This function has to be called in user task, rather than main() function, and after scheduler being started.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataSubscription_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize data subscription module. When data subscription will no longer be used, can call this function
|
||||
* to deinitialize the data subscription module. Deinitialization function will help to release all system resource data
|
||||
* subscription has occupied.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataSubscription_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Subscribe a topic in blocking mode. Before subscribing any data from aircraft, PsdkDataSubscription_Init()
|
||||
* function has to be called.
|
||||
* @details User can subscribe a topic by specifying topic name, push frequency and callback function used to receive
|
||||
* data of topic (if needed). After subscribing successfully, the user can call
|
||||
* PsdkDataSubscription_GetValueOfTopicWithTimestamp() function to get the latest data of the topic have been
|
||||
* subscribed and the corresponding timestamp when aircraft sends the data out, and the callback function will be called to
|
||||
* push data of the topic and corresponding timestamp if the callback function is specified.
|
||||
* @note Max execution time of this function is slightly larger than 1200ms.
|
||||
* @note Topic to be subscribed can not have been subscribed, that is, one topic can not be subscribed repeatedly.
|
||||
* @note User must ensure that types of subscription frequency of all topics have been subscribed is less than or
|
||||
* equal to 4. Otherwise, the subscribing topic will fail.
|
||||
* @note User must ensure that the data length sum of all topics of the same subscription frequency is less than or equal to 242.
|
||||
* @param topic: topic name to be subscribed.
|
||||
* @param frequency: subscription frequency of topic to be subscribed. Subscription frequency can not beyond max
|
||||
* frequency limitation of the topic and must be a divisor of max subscription frequency limitation. And, subscription
|
||||
* frequency has to be larger than 0. Users can find max frequency of topics in data subscription part of PSDK
|
||||
* documentation on developer website (developer.dji.com).
|
||||
* @param callback: callback function used to receive data of topic to be subscribed. If the callback function is not needed,
|
||||
* this item can be set as NULL.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataSubscription_RegTopicSync(E_PsdkDataSubscriptionTopicName topic, uint16_t frequency,
|
||||
ReceiveDataOfTopicCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Unsubscribe a topic in blocking mode.
|
||||
* @details Users must specify frequency and callback function filled in when subscribe the topic. If frequency or
|
||||
* callback function is incorrect, unsubscribe operation will fail and the interface return error.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @param topic: topic name to be unsubscribed.
|
||||
* @param frequency: subscription frequency filled in when subscribe.
|
||||
* @param callback: callback function filled in when subscribe.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataSubscription_AntiRegTopicSync(E_PsdkDataSubscriptionTopicName topic, uint16_t frequency,
|
||||
ReceiveDataOfTopicCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Get the latest data value and timestamp in aircraft time system when sending the data from aircraft of specified
|
||||
* topic. If the specified topic has not been subscribed successfully, this function will return the error code.
|
||||
* @note After calling this function, user need transfer type of data pointer that pointer to data of topic to
|
||||
* corresponding data structure pointer for getting every item of the topic conveniently.
|
||||
* @param topicName: topic name to be gotten value.
|
||||
* @param data: pointer to memory space used to store data of the topic. The memory space used to store data of topic
|
||||
* have to have been allocated correctly and should ensure its size is equal to data structure size corresponding to
|
||||
* the topic, otherwise, this function will not be able to return data and timestamp (return error code).
|
||||
* @param dataSizeOfTopic: the size of memory space used to store data of topic. Normally, this size is equal to data
|
||||
* structure size corresponding to the topic. If this size is not equal to the size of the memory space, may cause memory
|
||||
* overflow event
|
||||
* @param timestamp: pointer to memory space used to store timestamps. The memory space used to store timestamps
|
||||
* have to have been allocated correctly, and should ensure its size is equal to data structure size of timestamp,
|
||||
* otherwise, this function will not be able to return data and timestamp (return error code) or even cause memory
|
||||
* overflow event. If the user does not need timestamp information, can fill in NULL.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataSubscription_GetValueOfTopicWithTimestamp(E_PsdkDataSubscriptionTopicName topicName,
|
||||
uint8_t *data, uint16_t dataSizeOfTopic,
|
||||
T_PsdkDataSubscriptiontTimestamp *timestamp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_DATA_SUBSCRIPTION_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,222 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_data_transmission.h
|
||||
* @brief This is the header file for "psdk_data_transmission.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 DJI’s 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 PSDK_DATA_TRANSMISSION_H
|
||||
#define PSDK_DATA_TRANSMISSION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_low_speed_data_channel.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive data that come from mobile end.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param data: pointer to data.
|
||||
* @param len: length of data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiLowSpeedDataChannelRecvDataCallback ReceiveDataFromMobileCallback;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive data that come from onboard computer.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param data: pointer to data.
|
||||
* @param len: length of data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiLowSpeedDataChannelRecvDataCallback ReceiveDataFromOsdkCallback;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise data transmission module in block mode. Should call this function before sending data to mobile
|
||||
* end/onboard computer or receiving data.
|
||||
* @note Max execution time of this function is slightly larger than 500ms.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize data transmission module. User can call this function to release all resources that data
|
||||
* transmission module have occupied from the system and restore the state of internal variables when functions of data
|
||||
* transmission module will no longer be used or exit program.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to receive data from mobile end. After registering this callback function,
|
||||
* callback function will be called automatically when system receive data from mobile end.
|
||||
* @param callback: pointer to callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_RegReceiveDataFromMobileCallback(ReceiveDataFromMobileCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to receive data from onboard computer. After registering this callback
|
||||
* function, callback function will be called automatically when system receive data from onboard computer.
|
||||
* @param callback: pointer to callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_RegReceiveDataFromOsdkCallback(ReceiveDataFromOsdkCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Send data to mobile end via command channel.
|
||||
* @warning If actual bandwidth is below limitation, data can be sent to the endpoint directly. If exceeds the limitation,
|
||||
* firstly data will be stored to buffer of the flow controller and be sent to endpoint after a period (an integer multiple of
|
||||
* 1s, the exact time depends on bandwidth limitation and buffer size). If the buffer is full, data be will discarded. The
|
||||
* capacity of flow controller buffer is 512 bytes.
|
||||
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
|
||||
* refer to developer documentation or state of channel/stream for details related to bandwidth limitation. User can
|
||||
* get state of "sendToMobile" command channel via PsdkDataTransmission_GetSendToMobileState() function. If actual
|
||||
* bandwidth exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data
|
||||
* to be sent.
|
||||
* @note Max size of data package sent to mobile end on a physical link of command channel is 128. If the length of data to
|
||||
* be sent is greater than 128, data to be sent will be divided into multiple packages to send, and the user will also
|
||||
* receive multiple data packages on the mobile end.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_SendDataToMobile(const uint8_t *data, uint8_t len);
|
||||
|
||||
/**
|
||||
* @brief Send data to the onboard computer via command channel.
|
||||
* @warning If actual bandwidth is below limitation, data can be sent to the endpoint directly. If exceeds the limitation,
|
||||
* firstly data will be stored to buffer of the flow controller and be sent to endpoint after a period (an integer multiple of
|
||||
* 1s, the exact time depends on bandwidth limitation and buffer size). If the buffer is full, data will be discarded. The
|
||||
* capacity of flow controller buffer is 512 bytes.
|
||||
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
|
||||
* refer to developer documentation or state of channel/stream for details related to bandwidth limitation. User can
|
||||
* get state of "sendToOsdk" command channel via PsdkDataTransmission_GetSendToOsdkState() function. If actual bandwidth
|
||||
* exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be
|
||||
* sent.
|
||||
* @note Max size of data package sent to an onboard computer on the physical link of command channel is 255. If the length of data
|
||||
* to be sent is greater than 255, data to be sent will be divided into multiple packages to send, and the user will also
|
||||
* receive multiple data packages on the onboard computer.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_SendDataToOsdk(const uint8_t *data, uint8_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "sendToMobile" command channel. User can use the state as base for controlling
|
||||
* data transmission between payload and mobile end.
|
||||
* @param state: pointer to "sendToMobile" command channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetSendToMobileState(T_PsdkDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "sendToOsdk" command channel. User can use the state as base for controlling data
|
||||
* transmission between payload and onboard computer.
|
||||
* @param state: pointer to "sendToOsdk" command channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetSendToOsdkState(T_PsdkDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Get the network remote address for sending data stream.
|
||||
* @note The interface is used to get the network remote address for sending data stream. You can get this info for another
|
||||
* heterogeneous system to do somethings. This interface should be used after calling PsdkCore_Init function.
|
||||
* @param ipAddr: the remote ip address for sending data stream.
|
||||
* @param port: the remote port for sending data stream.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetDataStreamRemoteAddress(char *ipAddr, uint16_t *port);
|
||||
|
||||
/**
|
||||
* @brief Send data to mobile end via data stream of the data channel.
|
||||
* @note This function can be used only in Linux operating system.
|
||||
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
|
||||
* refer to developer documentation and state of channel/stream for details related to bandwidth limitation. User can
|
||||
* get state of "dataStream" channel via PsdkDataTransmission_GetDataStreamState() function. If actual bandwidth
|
||||
* exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be
|
||||
* sent. Otherwise, data may be discarded.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_SendDataStream(const uint8_t *data, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "dataStream" channel. User can use the state as base for controlling data
|
||||
* transmission of data stream. This function exists and can be used only in Linux operation system.
|
||||
* @param state: pointer to "dataStream" channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetDataStreamState(T_PsdkDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Get the network remote address for sending data stream.
|
||||
* @note The interface is used to get the network remote address for sending data stream. You can get this info for another
|
||||
* heterogeneous system to do somethings. This interface should be used after calling PsdkCore_Init function.
|
||||
* @param ipAddr: the remote ip address for sending data stream.
|
||||
* @param port: the remote port for sending data stream.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetDataStreamRemoteAddress(char *ipAddr, uint16_t *port);
|
||||
|
||||
/**
|
||||
* @brief Send data to mobile end via data stream of the data channel.
|
||||
* @note This function can be used only in Linux operating system.
|
||||
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
|
||||
* refer to developer documentation and state of channel/stream for details related to bandwidth limitation. User can
|
||||
* get state of "dataStream" channel via PsdkDataTransmission_GetDataStreamState() function. If actual bandwidth
|
||||
* exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be
|
||||
* sent. Otherwise, data may be discarded.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_SendDataStream(const uint8_t *data, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "dataStream" channel. User can use the state as base for controlling data
|
||||
* transmission of data stream. This function exists and can be used only in Linux operation system.
|
||||
* @param state: pointer to "dataStream" channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkDataTransmission_GetDataStreamState(T_PsdkDataChannelState *state);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_DATA_TRANSMISSION_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,208 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_error.h
|
||||
* @brief This is the header file for "psdk_error.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 DJI’s 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 PSDK_ERROR_H
|
||||
#define PSDK_ERROR_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include "dji_error.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define PSDK_ERROR_MODULE_INDEX_OFFSET DJI_ERROR_MODULE_INDEX_OFFSET
|
||||
#define PSDK_ERROR_MODULE_INDEX_MASK DJI_ERROR_MODULE_INDEX_MASK
|
||||
#define PSDK_ERROR_RAW_CODE_OFFSET DJI_ERROR_RAW_CODE_OFFSET
|
||||
#define PSDK_ERROR_RAW_CODE_MASK DJI_ERROR_RAW_CODE_MASK
|
||||
|
||||
#define PSDK_ERROR_CODE(moduleIndex, rawErrCode) DJI_ERROR_CODE(moduleIndex, rawErrCode)
|
||||
|
||||
/**
|
||||
* @brief Error objects, specifying error code, error description, error reason and error recovery suggestion below.
|
||||
* @attention Require arrange by error code from small to large.
|
||||
*/
|
||||
#define PSDK_ERROR_OBJECTS DJI_ERROR_OBJECTS
|
||||
|
||||
#define PSDK_RETURN_CODE_OK DJI_RETURN_CODE_OK /*!< Payload SDK return code represents as status is ok. */
|
||||
#define PSDK_RETURN_CODE_ERR_ALLOC DJI_RETURN_CODE_ERR_ALLOC /*!< Payload SDK return code represents as status alloc error. */
|
||||
#define PSDK_RETURN_CODE_ERR_TIMEOUT DJI_RETURN_CODE_ERR_TIMEOUT /*!< Payload SDK return code represents as status timeout error. */
|
||||
#define PSDK_RETURN_CODE_ERR_NOT_FOUND DJI_RETURN_CODE_ERR_NOT_FOUND /*!< Payload SDK return code represents as status not found error. */
|
||||
#define PSDK_RETURN_CODE_ERR_OUT_OF_RANGE DJI_RETURN_CODE_ERR_OUT_OF_RANGE /*!< Payload SDK return code represents as status out of range error. */
|
||||
#define PSDK_RETURN_CODE_ERR_PARAM DJI_RETURN_CODE_ERR_PARAM /*!< Payload SDK return code represents as status parameter error. */
|
||||
#define PSDK_RETURN_CODE_ERR_SYSTEM DJI_RETURN_CODE_ERR_SYSTEM /*!< Payload SDK return code represents as status system error. */
|
||||
#define PSDK_RETURN_CODE_ERR_BUSY DJI_RETURN_CODE_ERR_BUSY /*!< Payload SDK return code represents as status busy error. */
|
||||
#define PSDK_RETURN_CODE_ERR_UNSUPPORT DJI_RETURN_CODE_ERR_UNSUPPORT /*!< Payload SDK return code represents as status nonsupport error. */
|
||||
#define PSDK_RETURN_CODE_ERR_UNKNOWN DJI_RETURN_CODE_ERR_UNKNOWN /*!< Payload SDK return code represents as status unknown error. */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief PSDK module enum for defining error code.
|
||||
*/
|
||||
typedef E_DjiErrorModule E_PsdkErrorModule;
|
||||
#define PSDK_ERROR_MODULE_SYSTEM DJI_ERROR_MODULE_SYSTEM
|
||||
#define PSDK_ERROR_MODULE_PLATFORM DJI_ERROR_MODULE_PLATFORM
|
||||
#define PSDK_ERROR_MODULE_LOGGER DJI_ERROR_MODULE_LOGGER
|
||||
#define PSDK_ERROR_MODULE_TIME_SYNC DJI_ERROR_MODULE_TIME_SYNC
|
||||
#define PSDK_ERROR_MODULE_COMMAND DJI_ERROR_MODULE_COMMAND
|
||||
#define PSDK_ERROR_MODULE_CAMERA DJI_ERROR_MODULE_CAMERA
|
||||
#define PSDK_ERROR_MODULE_GIMBAL DJI_ERROR_MODULE_GIMBAL
|
||||
#define PSDK_ERROR_MODULE_XPORT DJI_ERROR_MODULE_XPORT
|
||||
#define PSDK_ERROR_MODULE_PAYLOAD_COLLABORATION DJI_ERROR_MODULE_PAYLOAD_COLLABORATION
|
||||
#define PSDK_ERROR_MODULE_WIDGET DJI_ERROR_MODULE_WIDGET
|
||||
#define PSDK_ERROR_MODULE_CORE DJI_ERROR_MODULE_CORE
|
||||
#define PSDK_ERROR_MODULE_IDENTITY DJI_ERROR_MODULE_IDENTITY
|
||||
#define PSDK_ERROR_MODULE_TRANSMISSION DJI_ERROR_MODULE_TRANSMISSION
|
||||
#define PSDK_ERROR_MODULE_DATA_CHANNEL DJI_ERROR_MODULE_DATA_CHANNEL
|
||||
#define PSDK_ERROR_MODULE_SUBSCRIPTION DJI_ERROR_MODULE_SUBSCRIPTION
|
||||
#define PSDK_ERROR_MODULE_MOP_CHANNEL DJI_ERROR_MODULE_MOP_CHANNEL
|
||||
#define PSDK_ERROR_MODULE_POSITIONING DJI_ERROR_MODULE_POSITIONING
|
||||
#define PSDK_ERROR_MODULE_POWER_MANAGEMENT DJI_ERROR_MODULE_POWER_MANAGEMENT
|
||||
#define PSDK_ERROR_MODULE_AIRCRAFTINFO DJI_ERROR_MODULE_AIRCRAFTINFO
|
||||
#define PSDK_ERROR_MODULE_PRODUCTINFO DJI_ERROR_MODULE_PRODUCTINFO
|
||||
#define PSDK_ERROR_MODULE_FLOWCONTROLLER DJI_ERROR_MODULE_FLOWCONTROLLER
|
||||
#define PSDK_ERROR_MODULE_DOWNLOADER DJI_ERROR_MODULE_DOWNLOADER
|
||||
#define PSDK_ERROR_MODULE_PARAMETER DJI_ERROR_MODULE_PARAMETER
|
||||
#define PSDK_ERROR_MODULE_UTIL DJI_ERROR_MODULE_UTIL
|
||||
#define PSDK_ERROR_MODULE_USER DJI_ERROR_MODULE_USER
|
||||
#define PSDK_ERROR_MODULE_NEGOTIATE DJI_ERROR_MODULE_NEGOTIATE
|
||||
#define PSDK_ERROR_MODULE_UPGRADE DJI_ERROR_MODULE_UPGRADE
|
||||
#define PSDK_ERROR_MODULE_ERROR DJI_ERROR_MODULE_ERROR
|
||||
|
||||
/**
|
||||
* @brief Raw error code of system module.
|
||||
*/
|
||||
typedef E_DjiErrorSystemModuleRawCode E_PsdkErrorSystemModuleRawCode;
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_SUCCESS DJI_ERROR_SYSTEM_MODULE_RAW_CODE_SUCCESS
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_REQUEST_PARAMETER DJI_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_REQUEST_PARAMETER
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_EXECUTING_HIGHER_PRIORITY_TASK DJI_ERROR_SYSTEM_MODULE_RAW_CODE_EXECUTING_HIGHER_PRIORITY_TASK
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT DJI_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_TIMEOUT DJI_ERROR_SYSTEM_MODULE_RAW_CODE_TIMEOUT
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_MEMORY_ALLOC_FAILED DJI_ERROR_SYSTEM_MODULE_RAW_CODE_MEMORY_ALLOC_FAILED
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_PARAMETER DJI_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_PARAMETER
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT_IN_CURRENT_STATE DJI_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT_IN_CURRENT_STATE
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_SYSTEM_ERROR DJI_ERROR_SYSTEM_MODULE_RAW_CODE_SYSTEM_ERROR
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_HARDWARE_ERR DJI_ERROR_SYSTEM_MODULE_RAW_CODE_HARDWARE_ERR
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INSUFFICIENT_ELECTRICITY DJI_ERROR_SYSTEM_MODULE_RAW_CODE_INSUFFICIENT_ELECTRICITY
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_UNKNOWN DJI_ERROR_SYSTEM_MODULE_RAW_CODE_UNKNOWN
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NOT_FOUND DJI_ERROR_SYSTEM_MODULE_RAW_CODE_NOT_FOUND
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_OUT_OF_RANGE DJI_ERROR_SYSTEM_MODULE_RAW_CODE_OUT_OF_RANGE
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_BUSY DJI_ERROR_SYSTEM_MODULE_RAW_CODE_BUSY
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_DUPLICATE DJI_ERROR_SYSTEM_MODULE_RAW_CODE_DUPLICATE
|
||||
#define PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_ADAPTER_NOT_MATCH DJI_ERROR_SYSTEM_MODULE_RAW_CODE_ADAPTER_NOT_MATCH
|
||||
|
||||
/**
|
||||
* @brief Raw error code of gimbal module.
|
||||
*/
|
||||
typedef E_DjiErrorGimbalModuleRawCode E_PsdkErrorGimbalModuleRawCode;
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_POSITIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_POSITIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_NEGATIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_NEGATIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_POSITIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_POSITIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_NEGATIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_NEGATIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_POSITIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_POSITIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_NEGATIVE_LIMIT DJI_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_NEGATIVE_LIMIT
|
||||
#define PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_NON_CONTROL_AUTHORITY DJI_ERROR_GIMBAL_MODULE_RAW_CODE_NON_CONTROL_AUTHORITY
|
||||
|
||||
/**
|
||||
* @brief Raw error code of payload collaboration module.
|
||||
*/
|
||||
typedef E_DjiErrorPayloadCollaborationModuleRawCode E_PsdkErrorPayloadCollaborationModuleRawCode;
|
||||
#define PSDK_ERROR_PAYLOAD_COLLABORATION_MODULE_RAW_CODE_POSITION_NOT_MATCH DJI_ERROR_PAYLOAD_COLLABORATION_MODULE_RAW_CODE_POSITION_NOT_MATCH
|
||||
|
||||
/**
|
||||
* @brief Raw error code of subscription module.
|
||||
*/
|
||||
typedef E_DjiErrorSubscriptionModuleRawCode E_PsdkErrorSubscriptionModuleRawCode;
|
||||
#define PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_INVALID_TOPIC_FREQ DJI_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_INVALID_TOPIC_FREQ
|
||||
#define PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_DUPLICATE DJI_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_DUPLICATE
|
||||
#define PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_NOT_SUBSCRIBED DJI_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_NOT_SUBSCRIBED
|
||||
#define PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TIMESTAMP_NOT_ENABLE DJI_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TIMESTAMP_NOT_ENABLE
|
||||
|
||||
/**
|
||||
* @brief Raw error code of mop channel module.
|
||||
*/
|
||||
typedef E_DjiErrorMopChannelModuleRawCode E_PsdkErrorMopChannelModuleRawCode;
|
||||
#define PSDK_ERROR_MOP_CHANNEL_MODULE_RAW_CODE_CONNECTION_CLOSE DJI_ERROR_MOP_CHANNEL_MODULE_RAW_CODE_CONNECTION_CLOSE
|
||||
|
||||
//@formatter:off
|
||||
/**
|
||||
* @brief PSDK error code complete works. Users can search all error messages here.
|
||||
* @details Please get error description, error reason and error recovery suggestion of every error code from
|
||||
* ::PSDK_ERROR_OBJECTS macro.
|
||||
*/
|
||||
enum PsdkErrorCode {
|
||||
/* system module error code, including some common error code */
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_SUCCESS),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_REQUEST_PARAMETER = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_REQUEST_PARAMETER),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_EXECUTING_HIGHER_PRIORITY_TASK = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_EXECUTING_HIGHER_PRIORITY_TASK),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_TIMEOUT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_TIMEOUT),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_MEMORY_ALLOC_FAILED),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INVALID_PARAMETER),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT_IN_CURRENT_STATE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NONSUPPORT_IN_CURRENT_STATE),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_SYSTEM_ERROR),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_HARDWARE_ERR = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_HARDWARE_ERR),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_INSUFFICIENT_ELECTRICITY = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_INSUFFICIENT_ELECTRICITY),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_UNKNOWN),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_NOT_FOUND = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_NOT_FOUND),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_OUT_OF_RANGE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_OUT_OF_RANGE),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_BUSY = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_BUSY),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_DUPLICATE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_DUPLICATE),
|
||||
PSDK_ERROR_SYSTEM_MODULE_CODE_ADAPTER_NOT_MATCH = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SYSTEM, PSDK_ERROR_SYSTEM_MODULE_RAW_CODE_ADAPTER_NOT_MATCH),
|
||||
|
||||
/* gimbal module error code */
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_PITCH_REACH_POSITIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_POSITIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_PITCH_REACH_NEGATIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_PITCH_REACH_NEGATIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_ROLL_REACH_POSITIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_POSITIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_ROLL_REACH_NEGATIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_ROLL_REACH_NEGATIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_YAW_REACH_POSITIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_POSITIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_YAW_REACH_NEGATIVE_LIMIT = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_YAW_REACH_NEGATIVE_LIMIT),
|
||||
PSDK_ERROR_GIMBAL_MODULE_CODE_NON_CONTROL_AUTHORITY = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_GIMBAL, PSDK_ERROR_GIMBAL_MODULE_RAW_CODE_NON_CONTROL_AUTHORITY),
|
||||
|
||||
/* payload collaboration module error code */
|
||||
PSDK_ERROR_PAYLOAD_COLLABORATION_MODULE_CODE_POSITION_NOT_MATCH = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_PAYLOAD_COLLABORATION, PSDK_ERROR_PAYLOAD_COLLABORATION_MODULE_RAW_CODE_POSITION_NOT_MATCH),
|
||||
|
||||
/* subscription module error code */
|
||||
PSDK_ERROR_SUBSCRIPTION_MODULE_CODE_INVALID_TOPIC_FREQ = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SUBSCRIPTION, PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_INVALID_TOPIC_FREQ),
|
||||
PSDK_ERROR_SUBSCRIPTION_MODULE_CODE_TOPIC_DUPLICATE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SUBSCRIPTION, PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_DUPLICATE),
|
||||
PSDK_ERROR_SUBSCRIPTION_MODULE_CODE_TOPIC_NOT_SUBSCRIBED = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SUBSCRIPTION, PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TOPIC_NOT_SUBSCRIBED),
|
||||
PSDK_ERROR_SUBSCRIPTION_MODULE_CODE_TIMESTAMP_NOT_ENABLE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_SUBSCRIPTION, PSDK_ERROR_SUBSCRIPTION_MODULE_RAW_CODE_TIMESTAMP_NOT_ENABLE),
|
||||
|
||||
/* mop channel module error code */
|
||||
PSDK_ERROR_MOP_CHANNEL_MODULE_CODE_CONNECTION_CLOSE = PSDK_ERROR_CODE(PSDK_ERROR_MODULE_MOP_CHANNEL, PSDK_ERROR_MOP_CHANNEL_MODULE_RAW_CODE_CONNECTION_CLOSE),
|
||||
};
|
||||
//@formatter:on
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_ERROR_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,166 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_gimbal.h
|
||||
* @brief PSDK gimbal module is used to achieve the third gimbal for developer. The module can be used only when the PSDK
|
||||
* adapter is Skyport, rather than XPort.
|
||||
*
|
||||
* @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 DJI’s 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 PSDK_GIMBAL_H
|
||||
#define PSDK_GIMBAL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_gimbal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Gimbal work mode, specifies how gimbal follow aircraft movement.
|
||||
*/
|
||||
typedef E_DjiGimbalMode E_PsdkGimbalMode;
|
||||
/*!< Free mode, fix gimbal attitude in the ground coordinate, ignoring movement of aircraft. */
|
||||
#define PSDK_GIMBAL_MODE_FREE DJI_GIMBAL_MODE_FREE
|
||||
/*!< FPV (First Person View) mode, only control roll and yaw angle of gimbal in the ground coordinate to follow aircraft. */
|
||||
#define PSDK_GIMBAL_MODE_FPV DJI_GIMBAL_MODE_FPV
|
||||
/*!< Yaw follow mode, only control yaw angle of gimbal in the ground coordinate to follow aircraft. */
|
||||
#define PSDK_GIMBAL_MODE_YAW_FOLLOW DJI_GIMBAL_MODE_YAW_FOLLOW
|
||||
|
||||
/**
|
||||
* @brief Gimbal calibration stage and result.
|
||||
*/
|
||||
typedef E_DjiGimbalCalibrationStage E_PsdkGimbalCalibrationStage;
|
||||
/*!< Calibration have been completed and the result is successful. */
|
||||
#define PSDK_GIMBAL_CALIBRATION_STAGE_COMPLETE DJI_GIMBAL_CALIBRATION_STAGE_COMPLETE
|
||||
/*!< Gimbal is calibrating. */
|
||||
#define PSDK_GIMBAL_CALIBRATION_STAGE_PROCRESSING DJI_GIMBAL_CALIBRATION_STAGE_PROCRESSING
|
||||
/*!< Calibration have been completed and the result is failure. */
|
||||
#define PSDK_GIMBAL_CALIBRATION_STAGE_FAILED DJI_GIMBAL_CALIBRATION_STAGE_FAILED
|
||||
|
||||
/**
|
||||
* @brief Gimbal rotation mode, specifies control style.
|
||||
*/
|
||||
typedef E_DjiGimbalRotationMode E_PsdkGimbalRotationMode;
|
||||
#define PSDK_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE /*!< Relative angle rotation mode, represents rotating gimbal specified angles based on current angles. */
|
||||
#define PSDK_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE /*!< Absolute angle rotation mode, represents rotating gimbal to specified angles in the ground coordinate. */
|
||||
#define PSDK_GIMBAL_ROTATION_MODE_SPEED DJI_GIMBAL_ROTATION_MODE_SPEED /*!< Speed rotation mode, specifies rotation speed of gimbal in the ground coordinate. */
|
||||
|
||||
/**
|
||||
* @brief Axis of gimbal.
|
||||
*/
|
||||
typedef E_DjiGimbalAxis E_PsdkGimbalAxis;
|
||||
#define PSDK_GIMBAL_AXIS_PITCH DJI_GIMBAL_AXIS_PITCH /*!< Pitch axis. */
|
||||
#define PSDK_GIMBAL_AXIS_ROLL DJI_GIMBAL_AXIS_ROLL /*!< Roll axis. */
|
||||
#define PSDK_GIMBAL_AXIS_YAW DJI_GIMBAL_AXIS_YAW /*!< Yaw axis. */
|
||||
|
||||
/**
|
||||
* @brief Reset mode of gimbal.
|
||||
*/
|
||||
typedef E_DjiGimbalResetMode E_PsdkGimbalResetMode;
|
||||
/*! Only reset yaw axis of gimbal. Reset angle of yaw axis to the sum of yaw axis angle of aircraft and fine tune angle
|
||||
* of yaw axis of gimbal. */
|
||||
#define PSDK_GIMBAL_RESET_MODE_YAW DJI_GIMBAL_RESET_MODE_YAW
|
||||
/*! Reset yaw axis and pitch axis of gimbal. Reset angle of yaw axis to sum of yaw axis angle of aircraft and fine tune
|
||||
* angle of yaw axis of gimbal, and reset pitch axis angle to the fine tune angle. */
|
||||
#define PSDK_GIMBAL_RESET_MODE_PITCH_AND_YAW DJI_GIMBAL_RESET_MODE_PITCH_AND_YAW
|
||||
/*! Reset yaw axis and pitch axis of gimbal. Reset angle of yaw axis to sum of yaw axis angle of aircraft and fine tune
|
||||
* angle of yaw axis of gimbal, and reset pitch axis angle to sum of -90 degree and fine tune angle if gimbal
|
||||
* downward, sum of 90 degree and fine tune angle if upward. */
|
||||
#define PSDK_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD_AND_YAW DJI_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD_AND_YAW
|
||||
/*! Reset pitch axis of gimbal. Reset pitch axis angle to sum of -90 degree and fine tune angle if gimbal downward,
|
||||
* sum of 90 degree and fine tune angle if upward. */
|
||||
#define PSDK_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD DJI_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD
|
||||
|
||||
/**
|
||||
* @brief Smooth factor of gimbal controller.
|
||||
*/
|
||||
typedef T_DjiGimbalControllerSmoothFactor T_PsdkGimbalControllerSmoothFactor;
|
||||
|
||||
/**
|
||||
* @brief Max speed percentage of every axis of gimbal.
|
||||
*/
|
||||
typedef T_DjiGimbalControllerMaxSpeedPercentage T_PsdkGimbalControllerMaxSpeedPercentage;
|
||||
|
||||
/**
|
||||
* @brief Data structure describes gimbal system state.
|
||||
*/
|
||||
typedef T_DjiGimbalSystemState T_PsdkGimbalSystemState;
|
||||
|
||||
/**
|
||||
* @brief Reach limit flag.
|
||||
*/
|
||||
typedef T_DjiGimbalReachLimitFlag T_PsdkGimbalReachLimitFlag;
|
||||
|
||||
/**
|
||||
* @brief Gimbal attitude related information.
|
||||
*/
|
||||
typedef T_DjiGimbalAttitudeInformation T_PsdkGimbalAttitudeInformation;
|
||||
|
||||
/**
|
||||
* @brief Gimbal calibration state.
|
||||
*/
|
||||
typedef T_DjiGimbalCalibrationState T_PsdkGimbalCalibrationState;
|
||||
|
||||
/**
|
||||
* @brief Gimbal rotation command property.
|
||||
*/
|
||||
typedef T_DjiGimbalRotationProperty T_PsdkGimbalRotationProperty;
|
||||
|
||||
/**
|
||||
* @brief Common handler function prototypes of gimbal, that is, some common callback function prototypes of gimbal.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiGimbalCommonHandler T_PsdkGimbalCommonHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise gimbal module, and user should call this function before using gimbal features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkGimbal_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise gimbal module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkGimbal_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Register common handler functions/callback functions of gimbal. After registering, callback functions will be
|
||||
* called automatically.
|
||||
* @param commonHandler: pointer to common handler functions of gimbal.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkGimbal_RegCommonHandler(const T_PsdkGimbalCommonHandler *commonHandler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_GIMBAL_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,113 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_logger.h
|
||||
* @brief This is the header file for "psdk_logger.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 DJI’s 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 PSDK_LOGGER_H
|
||||
#define PSDK_LOGGER_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_logger.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef E_DjiLoggerConsoleLogLevel E_PsdkLoggerConsoleLogLevel;
|
||||
|
||||
/*!< Logger console error level. The method and level of the console are associated with each other. If the level of the
|
||||
* registered console method is lower than this level, the level interface will not be printed successfully. */
|
||||
#define PSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR
|
||||
|
||||
/*!< Logger console warning level.The method and level of the console are associated with each other. If the level of the
|
||||
* registered console method is lower than this level, the level interface will not be printed successfully. */
|
||||
#define PSDK_LOGGER_CONSOLE_LOG_LEVEL_WARNING DJI_LOGGER_CONSOLE_LOG_LEVEL_WARNING
|
||||
/*!< Logger console info level. The method and level of the console are associated with each other. If the level of the
|
||||
* registered console method is lower than this level, the level interface will not be printed successfully. */
|
||||
#define PSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO
|
||||
/*!< Logger console debug level. The method and level of the console are associated with each other. If the level of the
|
||||
* registered console method is lower than this level, the level interface will not be printed successfully. */
|
||||
#define PSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG
|
||||
|
||||
typedef T_DjiLoggerConsole T_PsdkLoggerConsole;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Add the console function and level for Payload SDK.
|
||||
* @note When registering the console, you need to provide the method of the console and the level corresponding to
|
||||
* the method. Log levels from high to low are Debug, Info, Warn, and Error, the log function module can print all
|
||||
* logs not higher than the specified level. Maximum support for registering eight different console methods at the
|
||||
* same time.Before registering the console method, you should test the registration method ensure that all the method
|
||||
* are normally. If you registered multiple methods at the same time, all the methods will be print.
|
||||
* @param console: pointer to the console function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkLogger_AddConsole(T_PsdkLoggerConsole *console);
|
||||
|
||||
/**
|
||||
* @brief Print out the info log of the specified format by the registration method.
|
||||
* @note The registered method is printed according to the corresponding level. If the level of the console is lower
|
||||
* than the level at which the log needs to be printed, it will not be printed successfully.
|
||||
* @param fmt: pointer to the format string that needs print out.
|
||||
* @param ...: Variable parameters, consistent with the use of the system interface print out.
|
||||
*/
|
||||
void PsdkLogger_UserLogInfo(const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* @brief Print out the warning log of the specified format by the registration method.
|
||||
* @note The registered method is printed according to the corresponding level. If the level of the console is lower
|
||||
* than the level at which the log needs to be printed, it will not be printed successfully.
|
||||
* @param fmt: pointer to the format string that needs print out.
|
||||
* @param ...: Variable parameters, consistent with the use of the system interface print out.
|
||||
*/
|
||||
void PsdkLogger_UserLogWarn(const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* @brief Print out the debug log of the specified format by the registration method.
|
||||
* @note The registered method is printed according to the corresponding level. If the level of the console is lower
|
||||
* than the level at which the log needs to be printed, it will not be printed successfully.
|
||||
* @param fmt: pointer to the format string that needs print out.
|
||||
* @param ...: Variable parameters, consistent with the use of the system interface print out.
|
||||
*/
|
||||
void PsdkLogger_UserLogDebug(const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* @brief Print out the error log of the specified format by the registration method.
|
||||
* @note The registered method is printed according to the corresponding level. If the level of the console is lower
|
||||
* than the level at which the log needs to be printed, it will not be printed successfully.
|
||||
* @param fmt: pointer to the format string that needs print out.
|
||||
* @param ...: Variable parameters, consistent with the use of the system interface print out.
|
||||
*/
|
||||
void PsdkLogger_UserLogError(const char *fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_LOGGER_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,150 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_mop_channel.h
|
||||
* @brief This is the header file for "psdk_mop_channel.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 DJI’s 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 PSDK_MOP_CHANNEL_H
|
||||
#define PSDK_MOP_CHANNEL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_mop_channel.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Mop channel handle.
|
||||
*/
|
||||
typedef T_DjiMopChannelHandle T_PsdkMopChannelHandle;
|
||||
|
||||
/**
|
||||
* @brief Mop channel transmission type.
|
||||
*/
|
||||
typedef E_DjiMopChannelTransType E_PsdkMopChannelTransType;
|
||||
#define PSDK_MOP_CHANNEL_TRANS_RELIABLE DJI_MOP_CHANNEL_TRANS_RELIABLE
|
||||
#define PSDK_MOP_CHANNEL_TRANS_UNRELIABLE DJI_MOP_CHANNEL_TRANS_UNRELIABLE
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the mop channel for operation about mop channel handle later.
|
||||
* @note This interface needs to be called before calling other mop channel interfaces. Please make sure the network port
|
||||
* is connected properly before calling this interface. Mop channel feature currently only supports linux platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Create the mop channel handle by specified transmission type.
|
||||
* @note After calling this interface, you should follow below cases:
|
||||
* 1. When mop channel handle created successfully, you need bind channel id to this created mop channel handle and
|
||||
* accept other client device connections, such as MSDK or OSDK device;
|
||||
* 2. When mop channel accept successfully, you can use send or receive data interface to write or read data by accepted
|
||||
* output channel handle;
|
||||
* 3. When the mop channel handle do not used, you can use close or destroy interface to release the resource;
|
||||
* @param channelHandle: pointer to the created mop channel.
|
||||
* @param transType: the transmission type for mop channel ::E_PsdkMopChannelTransType.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Create(T_PsdkMopChannelHandle *channelHandle, E_PsdkMopChannelTransType transType);
|
||||
|
||||
/**
|
||||
* @brief Destroy the created mop channel and release the resource that referenced by the channel handle.
|
||||
* @note After calling this interface, we can not do any operation about this channel handle expect create channel handle.
|
||||
* @param channelHandle: pointer to the created mop channel.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Destroy(T_PsdkMopChannelHandle channelHandle);
|
||||
|
||||
/**
|
||||
* @brief Bind the channel id to the created mop channel handle.
|
||||
* @note When mop channel handle created successfully, you can bind channel id to this created mop handle and calling
|
||||
* interface ::PsdkMopChannel_Accept, then other client device can use this binded channel id to connect created mop handle.
|
||||
* @param channelHandle: pointer to the created mop channel handle.
|
||||
* @param channelId: the channel id of mop handle for accepting client device connection.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Bind(T_PsdkMopChannelHandle channelHandle,
|
||||
uint16_t channelId);
|
||||
|
||||
/**
|
||||
* @brief Accept the connection by binded channel id for created mop channel.
|
||||
* @note The mop accept channel extracts the connection request on the queue of pennding connections for listening channel
|
||||
* handle ::channelHandle. Create a new connected channel handle and return to user ::outChannelHandle by referrng to a new
|
||||
* connection. Payload can be a server that allow multiple client connections by binded channel id.
|
||||
* @param channelHandle: pointer to the created mop channel.
|
||||
* @param outChannelHandle: pointer to the accepted output mop channel.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Accept(T_PsdkMopChannelHandle channelHandle,
|
||||
T_PsdkMopChannelHandle *outChannelHandle);
|
||||
|
||||
/**
|
||||
* @brief Close the created mop channel.
|
||||
* @note After calling this interface, we can not do any operation about this channel handle expect destroy channel handle.
|
||||
* @param channelHandle: pointer to the created mop channel.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_Close(T_PsdkMopChannelHandle channelHandle);
|
||||
|
||||
/**
|
||||
* @brief Send data by the accepted output mop channel.
|
||||
* @note This interface should be called after successfully calling the interface ::PsdkMopChannel_Accept. It is recommended
|
||||
* to send more bytes of data at a time to improve read and write efficiency. Need to determine whether the send is
|
||||
* successful according to the return code and the actual sent data length.
|
||||
* @param channelHandle: pointer to accepted output mop handle ::outChannelHandle by calling interface ::PsdkMopChannel_Accept.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent via accepted output mop handle, unit: byte.
|
||||
* @param realLen: pointer to real length of data that already sent.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_SendData(T_PsdkMopChannelHandle channelHandle,
|
||||
uint8_t *data,
|
||||
uint32_t len,
|
||||
uint32_t *realLen);
|
||||
|
||||
/**
|
||||
* @brief Receive data from the accepted output mop channel.
|
||||
* @note This interface should be called after successfully calling the interface ::PsdkMopChannel_Accept. It is recommended
|
||||
* to receive more bytes of data at a time to improve read and write efficiency. Need to determine whether the receive
|
||||
* is successful according to the return code and the actual received data length.
|
||||
* @param channelHandle: pointer to accepted output mop handle ::outChannelHandle by calling interface ::PsdkMopChannel_Accept.
|
||||
* @param data: pointer to data to store the received data.
|
||||
* @param len: length of data to be received via accepted output mop handle, unit: byte.
|
||||
* @param realLen: pointer to real length of data that already received.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkMopChannel_RecvData(T_PsdkMopChannelHandle channelHandle,
|
||||
uint8_t *data,
|
||||
uint32_t len,
|
||||
uint32_t *realLen);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_MOP_CHANNEL_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,421 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_payload_camera.h
|
||||
* @brief This is the header file for "psdk_payload_camera.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 DJI’s 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 PSDK_PAYLOAD_CAMERA_H
|
||||
#define PSDK_PAYLOAD_CAMERA_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_payload_camera.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Camera work mode.
|
||||
*/
|
||||
typedef E_DjiCameraMode E_PsdkCameraMode;
|
||||
#define PSDK_CAMERA_MODE_SHOOT_PHOTO DJI_CAMERA_MODE_SHOOT_PHOTO /*!< Shoot photo work mode. */
|
||||
#define PSDK_CAMERA_MODE_RECORD_VIDEO DJI_CAMERA_MODE_RECORD_VIDEO/*!< Record video work mode. */
|
||||
#define PSDK_CAMERA_MODE_PLAYBACK DJI_CAMERA_MODE_PLAYBACK /*!< Media playback work mode. */
|
||||
|
||||
/**
|
||||
* @brief Camera shoot photo mode.
|
||||
*/
|
||||
typedef E_DjiCameraShootPhotoMode E_PsdkCameraShootPhotoMode;
|
||||
#define PSDK_CAMERA_SHOOT_PHOTO_MODE_SINGLE DJI_CAMERA_SHOOT_PHOTO_MODE_SINGLE /*!< Single photographing mode. */
|
||||
#define PSDK_CAMERA_SHOOT_PHOTO_MODE_BURST DJI_CAMERA_SHOOT_PHOTO_MODE_BURST/*!< Burst photographing mode. */
|
||||
#define PSDK_CAMERA_SHOOT_PHOTO_MODE_INTERVAL DJI_CAMERA_SHOOT_PHOTO_MODE_INTERVAL/*!< Interval photographing mode. */
|
||||
|
||||
/**
|
||||
* @brief Camera shooting state when photographing.
|
||||
*/
|
||||
typedef E_DjiCameraShootingState E_PsdkCameraShootingState;
|
||||
#define PSDK_CAMERA_SHOOTING_PHOTO_IDLE DJI_CAMERA_SHOOTING_PHOTO_IDLE /*!< Photographing in idle state. */
|
||||
#define PSDK_CAMERA_SHOOTING_SINGLE_PHOTO DJI_CAMERA_SHOOTING_SINGLE_PHOTO /*!< Photographing in single photograph state . */
|
||||
#define PSDK_CAMERA_SHOOTING_BURST_PHOTO DJI_CAMERA_SHOOTING_BURST_PHOTO /*!< Photographing in burst photograph state. */
|
||||
#define PSDK_CAMERA_SHOOTING_INTERVAL_PHOTO DJI_CAMERA_SHOOTING_INTERVAL_PHOTO /*!< Photographing in interval photograph state. */
|
||||
|
||||
/**
|
||||
* @brief Camera burst count setting when photographing.
|
||||
*/
|
||||
typedef E_DjiCameraBurstCount E_PsdkCameraBurstCount;
|
||||
#define PSDK_CAMERA_BURST_COUNT_2 DJI_CAMERA_BURST_COUNT_2 /*!< Photo number of burst photographing: 2. */
|
||||
#define PSDK_CAMERA_BURST_COUNT_3 DJI_CAMERA_BURST_COUNT_3 /*!< Photo number of burst photographing: 3. */
|
||||
#define PSDK_CAMERA_BURST_COUNT_5 DJI_CAMERA_BURST_COUNT_5 /*!< Photo number of burst photographing: 5. */
|
||||
#define PSDK_CAMERA_BURST_COUNT_7 DJI_CAMERA_BURST_COUNT_7/*!< Photo number of burst photographing: 7. */
|
||||
#define PSDK_CAMERA_BURST_COUNT_10 DJI_CAMERA_BURST_COUNT_10 /*!< Photo number of burst photographing: 10. */
|
||||
#define PSDK_CAMERA_BURST_COUNT_14 DJI_CAMERA_BURST_COUNT_14 /*!< Photo number of burst photographing: 14. */
|
||||
|
||||
/**
|
||||
* @brief Camera metering mode.
|
||||
*/
|
||||
typedef E_DjiCameraMeteringMode E_PsdkCameraMeteringMode;
|
||||
#define PSDK_CAMERA_METERING_MODE_CENTER DJI_CAMERA_METERING_MODE_CENTER /*!< Center metering mode. */
|
||||
#define PSDK_CAMERA_METERING_MODE_AVERAGE DJI_CAMERA_METERING_MODE_AVERAGE /*!< Average metering mode. */
|
||||
#define PSDK_CAMERA_METERING_MODE_SPOT DJI_CAMERA_METERING_MODE_SPOT /*!< Spot metering mode. */
|
||||
|
||||
/**
|
||||
* @brief Camera focus mode.
|
||||
*/
|
||||
typedef E_DjiCameraFocusMode E_PsdkCameraFocusMode;
|
||||
#define PSDK_CAMERA_FOCUS_MODE_MANUAL DJI_CAMERA_FOCUS_MODE_MANUAL /*!< Manual focus mode. */
|
||||
#define PSDK_CAMERA_FOCUS_MODE_AUTO DJI_CAMERA_FOCUS_MODE_AUTO /*!< Auto focus mode. */
|
||||
|
||||
/**
|
||||
* @brief Camera zoom direction.
|
||||
*/
|
||||
typedef E_DjiCameraZoomDirection E_PsdkCameraZoomDirection;
|
||||
#define PSDK_CAMERA_ZOOM_DIRECTION_OUT DJI_CAMERA_ZOOM_DIRECTION_OUT /*!< The lens moves in the far direction, the zoom factor becomes smaller. */
|
||||
#define PSDK_CAMERA_ZOOM_DIRECTION_IN DJI_CAMERA_ZOOM_DIRECTION_IN /*!< The lens moves in the near direction, the zoom factor becomes larger. */
|
||||
|
||||
/**
|
||||
* @brief Camera zoom speed.
|
||||
*/
|
||||
typedef E_DjiCameraZoomSpeed E_PsdkCameraZoomSpeed;
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_SLOWEST DJI_CAMERA_ZOOM_SPEED_SLOWEST/*!< Lens zooms in slowest speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_SLOW DJI_CAMERA_ZOOM_SPEED_SLOW /*!< Lens zooms in slow speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_MODERATELY_SLOW DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW /*!< Lens zooms in speed slightly slower than normal speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_NORMAL DJI_CAMERA_ZOOM_SPEED_NORMAL /*!< Lens zooms in normal speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_MODERATELY_FAST DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST /*!< Lens zooms very in speed slightly faster than normal speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_FAST DJI_CAMERA_ZOOM_SPEED_FAST /*!< Lens zooms very in fast speed. */
|
||||
#define PSDK_CAMERA_ZOOM_SPEED_FASTEST DJI_CAMERA_ZOOM_SPEED_FASTEST /*!< Lens zooms very in fastest speed. */
|
||||
|
||||
/**
|
||||
* @brief Camera supported media file type.
|
||||
*/
|
||||
typedef E_DjiCameraMediaFileType E_PsdkCameraMediaFileType;
|
||||
#define PSDK_CAMERA_FILE_TYPE_JPEG DJI_CAMERA_FILE_TYPE_JPEG /*!< Media file JPEG type. */
|
||||
#define PSDK_CAMERA_FILE_TYPE_DNG DJI_CAMERA_FILE_TYPE_DNG /*!< Media file DNG type. */
|
||||
#define PSDK_CAMERA_FILE_TYPE_MOV DJI_CAMERA_FILE_TYPE_MOV /*!< Media file MOV type. */
|
||||
#define PSDK_CAMERA_FILE_TYPE_MP4 DJI_CAMERA_FILE_TYPE_MP4 /*!< Media file MP4 type. */
|
||||
|
||||
/**
|
||||
* @brief Camera playback mode in playback process.
|
||||
*/
|
||||
typedef E_DjiCameraPlaybackMode E_PsdkCameraPlaybackMode;
|
||||
#define PSDK_CAMERA_PLAYBACK_MODE_PLAY DJI_CAMERA_PLAYBACK_MODE_PLAY /*!< Play playbacking mode. */
|
||||
#define PSDK_CAMERA_PLAYBACK_MODE_PAUSE DJI_CAMERA_PLAYBACK_MODE_PAUSE /*!< Pause playbacking mode. */
|
||||
#define PSDK_CAMERA_PLAYBACK_MODE_STOP DJI_CAMERA_PLAYBACK_MODE_STOP /*!< Stop playbacking mode. */
|
||||
|
||||
/**
|
||||
* @brief Camera supported video frames when working in playback mode.
|
||||
*/
|
||||
typedef E_DjiCameraVideoFrameRate E_PsdkCameraVideoFrameRate;
|
||||
#define PSDK_CAMERA_VIDEO_FRAME_RATE_24_FPS DJI_CAMERA_VIDEO_FRAME_RATE_24_FPS /*!< The camera's video frame rate is 24fps (frames per second) */
|
||||
#define PSDK_CAMERA_VIDEO_FRAME_RATE_25_FPS DJI_CAMERA_VIDEO_FRAME_RATE_25_FPS /*!< The camera's video frame rate is 25fps (frames per second) */
|
||||
#define PSDK_CAMERA_VIDEO_FRAME_RATE_30_FPS DJI_CAMERA_VIDEO_FRAME_RATE_30_FPS /*!< The camera's video frame rate is 30fps (frames per second) */
|
||||
#define PSDK_CAMERA_VIDEO_FRAME_RATE_UNKNOWN DJI_CAMERA_VIDEO_FRAME_RATE_UNKNOWN /*!< The camera's video frame rate is unknown (frames per second) */
|
||||
|
||||
/**
|
||||
* @brief Camera supported video resolutions when working in playback mode.
|
||||
*/
|
||||
typedef E_DjiCameraVideoResolution E_PsdkCameraVideoResolution;
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_640x480 DJI_CAMERA_VIDEO_RESOLUTION_640x480 /*!< /The camera's video resolution is 640x480. */
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_1280x720 DJI_CAMERA_VIDEO_RESOLUTION_1280x720 /*!< /The camera's video resolution is 1280x720. */
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_1920x1080 DJI_CAMERA_VIDEO_RESOLUTION_1920x1080 /*!< /The camera's video resolution is 1920x1080. */
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_2048x1080 DJI_CAMERA_VIDEO_RESOLUTION_2048x1080 /*!< /The camera's video resolution is 2048x1080. */
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_3840x2160 DJI_CAMERA_VIDEO_RESOLUTION_3840x2160 /*!< /The camera's video resolution is 3840x2160. */
|
||||
#define PSDK_CAMERA_VIDEO_RESOLUTION_UNKNOWN DJI_CAMERA_VIDEO_RESOLUTION_UNKNOWN /*!< /The camera's video resolution is unknown. */
|
||||
|
||||
/**
|
||||
* @brief Camera zoom state in tap zoom process.
|
||||
*/
|
||||
typedef E_DjiCameraTapZoomState E_PsdkCameraTapZoomState;
|
||||
#define PSDK_CAMERA_TAP_ZOOM_STATE_IDLE DJI_CAMERA_TAP_ZOOM_STATE_IDLE /*!< Camera is not in tap zoom process. */
|
||||
#define PSDK_CAMERA_TAP_ZOOM_STATE_ZOOM_IN DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_IN /*!< Camera is zooming in. */
|
||||
#define PSDK_CAMERA_TAP_ZOOM_STATE_ZOOM_OUT DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_OUT /*!< Camera is zooming out. */
|
||||
#define PSDK_CAMERA_TAP_ZOOM_STATE_ZOOM_LIMITED DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_LIMITED /*!< Camera has reached zoom limit. */
|
||||
|
||||
/**
|
||||
* @brief Camera video stream type.
|
||||
*/
|
||||
typedef E_DjiCameraVideoStreamType E_PsdkCameraVideoStreamType;
|
||||
/*! Camera video stream by h264 custom format, which needs to comply with the user document Custom-H264 video stream format standard.
|
||||
* When using this format to send a video stream, the bit rate of the video stream needs must not exceed the real-time bandwidth
|
||||
* limit of the channel that feedback by interface #PsdkPayloadCamera_GetVideoStreamState.*/
|
||||
#define PSDK_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT DJI_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT
|
||||
/*! Camera video stream by h264 DJI format, which needs to comply with the user document DJI-H264 video stream format standard.
|
||||
* When using this format to send a video stream, the video stream will be recoded by aircraft. No need to dynamically adjust
|
||||
* the bit rate to ensure the quality of transmission. But the bit rate of video stream can not exceed 8Mbps. */
|
||||
#define PSDK_CAMERA_VIDEO_STREAM_TYPE_H264_DJI_FORMAT DJI_CAMERA_VIDEO_STREAM_TYPE_H264_DJI_FORMAT
|
||||
|
||||
/**
|
||||
* @brief Camera sdcard state.
|
||||
*/
|
||||
typedef T_DjiCameraSDCardState T_PsdkCameraSDCardState;
|
||||
|
||||
/**
|
||||
* @brief Camera time interval settings when in interval shootPhoto mode.
|
||||
*/
|
||||
typedef T_DjiCameraPhotoTimeIntervalSettings T_PsdkCameraPhotoTimeIntervalSettings;
|
||||
|
||||
/**
|
||||
* @brief Camera metering target when in spot metering mode.
|
||||
*/
|
||||
typedef T_DjiCameraSpotMeteringTarget T_PsdkCameraSpotMeteringTarget;
|
||||
|
||||
/**
|
||||
* @brief Camera system state.
|
||||
*/
|
||||
typedef T_DjiCameraSystemState T_PsdkCameraSystemState;
|
||||
|
||||
/**
|
||||
* @brief Camera focus target point when in focus mode.
|
||||
*/
|
||||
typedef T_DjiCameraPointInScreen T_PsdkCameraPointInScreen;
|
||||
|
||||
/**
|
||||
* @brief Camera focus assistant settings.
|
||||
*/
|
||||
typedef T_DjiCameraFocusAssistantSettings T_PsdkCameraFocusAssistantSettings;
|
||||
|
||||
/**
|
||||
* @brief Camera playback status.
|
||||
*/
|
||||
typedef T_DjiCameraPlaybackStatus T_PsdkCameraPlaybackStatus;
|
||||
|
||||
/**
|
||||
* @brief Camera focus assistant settings.
|
||||
*/
|
||||
typedef T_DjiCameraMediaFileAttr T_PsdkCameraMediaFileAttr;
|
||||
|
||||
/**
|
||||
* @brief Camera media file info.
|
||||
*/
|
||||
typedef T_DjiCameraMediaFileInfo T_PsdkCameraMediaFileInfo;
|
||||
|
||||
/**
|
||||
* @brief Camera optical zoom specifies.
|
||||
*/
|
||||
typedef T_DjiCameraOpticalZoomSpec T_PsdkCameraOpticalZoomSpec;
|
||||
|
||||
/**
|
||||
* @brief Camera tap zoom state.
|
||||
*/
|
||||
typedef T_DjiCameraTapZoomState T_PsdkCameraTapZoomState;
|
||||
|
||||
/**
|
||||
* @brief Camera common features handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraCommonHandler T_PsdkCameraCommonHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera metering feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraExposureMeteringHandler T_PsdkCameraExposureMeteringHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera focus feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraFocusHandler T_PsdkCameraFocusHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera digital zoom feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraDigitalZoomHandler T_PsdkCameraDigitalZoomHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera optical zoom feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraOpticalZoomHandler T_PsdkCameraOpticalZoomHandler;
|
||||
|
||||
/**
|
||||
* @brief Prototype of handler functions for media file download and playback.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraMediaDownloadPlaybackHandler T_PsdkCameraMediaDownloadPlaybackHandler;
|
||||
|
||||
/**
|
||||
* @brief Prototype of handler functions for tap zooming.
|
||||
* @note User can not execute blocking style operations or functions in callback function, like PsdkXPort_RotateSync()
|
||||
* function, because that will block PSDK root thread, causing problems such as slow system response, payload
|
||||
* disconnection or infinite loop.
|
||||
*/
|
||||
typedef T_DjiCameraTapZoomHandler T_PsdkCameraTapZoomHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the payload camera module.
|
||||
* @note The interface is the total initialization interface of the camera module. The following interfaces are optional
|
||||
* functions and can be freely selected according to the actual load device condition of the user. Before registering
|
||||
* the optional interface, the interface must be initialized before the system can work normally. Interface initialization
|
||||
* needs to be after PsdkCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera common function interfaces.
|
||||
* @note This interface registers the camera's basic function interface, including camera camera, video, mode settings,
|
||||
* SD card operation, camera status interface. Registration of this interface needs to be after PsdkPayloadCamera_Init.
|
||||
* @param cameraCommonHandler: pointer to the handler for payload camera common functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegCommonHandler(const T_PsdkCameraCommonHandler *cameraCommonHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera exposure and metering function interfaces.
|
||||
* @note This interface registers the spot metering and exposure interface of the camera. It currently includes
|
||||
* setting and acquiring the metering mode and metering area. Special attention must be paid to the limitations
|
||||
* of the interface parameters. Registration of this interface needs to be after PsdkPayloadCamera_Init.
|
||||
* @param cameraExposureMeteringHandler: pointer to the handler for payload camera exposure and metering functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegExposureMeteringHandler(const T_PsdkCameraExposureMeteringHandler
|
||||
*cameraExposureMeteringHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera focus function interfaces.
|
||||
* @note This interface registers the camera's focus interface, which includes setting and acquiring the focus mode,
|
||||
* focus area, and focus settings. Special attention must be paid to the interface parameters. Registration of
|
||||
* this interface needs to be after PsdkPayloadCamera_Init.
|
||||
* @param cameraFocusHandler: pointer to the handler for payload camera focus functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegFocusHandler(const T_PsdkCameraFocusHandler *cameraFocusHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera digital zoom function interfaces.
|
||||
* @note This interface registers the camera's digital zoom interface, which includes setting and obtaining the digital
|
||||
* zoom zoom factor. Registering the load on this interface requires digital zoom. Registration of this interface
|
||||
* needs to be after PsdkPayloadCamera_Init.
|
||||
* @param cameraDigitalZoomHandler: pointer to the handler for payload camera digital zoom functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegDigitalZoomHandler(const T_PsdkCameraDigitalZoomHandler
|
||||
*cameraDigitalZoomHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera optical zoom function interfaces.
|
||||
* @note This interface registers the camera's optical zoom interface, which includes setting and acquiring optical zoom
|
||||
* parameters, and a continuous zoom interface. Registering the load on this interface requires support for optical
|
||||
* zoom. Registration of this interface needs to be after PsdkPayloadCamera_Init.
|
||||
* @param cameraOpticalZoomHandler: pointer to the handler for payload camera optical zoom functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegOpticalZoomHandler(const T_PsdkCameraOpticalZoomHandler
|
||||
*cameraOpticalZoomHandler);
|
||||
|
||||
/**
|
||||
* @brief Register handler functions for tap zoom function.
|
||||
* @details Registration specifies PSDK application support tap zoom function.
|
||||
* @param cameraTapZoomHandler: pointer to structure of handler functions for tap zoom function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegTapZoomHandler(const T_PsdkCameraTapZoomHandler *cameraTapZoomHandler);
|
||||
|
||||
/**
|
||||
* @brief Set the type of camera video stream.
|
||||
* @note The interface is used to set the camera video stream type. Must ensure the format of video stream conforms to
|
||||
* the specified type in E_PsdkCameraVideoStreamType, please refer to developer documentation for more details.
|
||||
* @attention Set video stream type must before calling PsdkCore_ApplicationStart function, when calling this interface
|
||||
* the thread will be blocked, and the maximum blocking time is 10s. If this interface is not called, the default video
|
||||
* stream type ::PSDK_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT will be used.
|
||||
* @param videoStreamType: camera video stream type.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_SetVideoStreamType(E_PsdkCameraVideoStreamType videoStreamType);
|
||||
|
||||
/**
|
||||
* @brief Get the network remote address for sending camera video stream.
|
||||
* @note The interface is used to get the network remote address for sending camera video stream. You can get this info for another
|
||||
* heterogeneous system to do somethings. This interface should be used after calling PsdkCore_Init function.
|
||||
* @attention If you want use this interface, should call PsdkPlatform_RegHalNetworkHandler interface firstly, otherwise
|
||||
* this interface will not work.
|
||||
* @param ipAddr: the remote ip address for sending camera video stream.
|
||||
* @param port: the remote port for sending camera video stream.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_GetVideoStreamRemoteAddress(char *ipAddr, uint16_t *port);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for payload camera media download and playback function interfaces.
|
||||
* @note Registering the camera playback and downloading related interfaces, mainly able to operate the media files of
|
||||
* the user storage device online through the playback interface of the pilot. It can playback and download files
|
||||
* of pictures and videos. Currently, only media files in MP4 and JPG formats are supported.
|
||||
* @param cameraMediaHandler: pointer to the handler for payload camera media download and playback functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_RegMediaDownloadPlaybackHandler(const T_PsdkCameraMediaDownloadPlaybackHandler
|
||||
*cameraMediaHandler);
|
||||
|
||||
/**
|
||||
* @brief Send the video to mobile end via video stream of the data channel. This function exists and can be used only in Linux.
|
||||
* @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please
|
||||
* refer to developer documentation and state of channel/stream for details related to bandwidth limitation. User can
|
||||
* get state of "videoStream" channel via PsdkPayloadCamera_GetVideoStreamState() function. If actual bandwidth
|
||||
* exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be
|
||||
* sent. Otherwise, data may be discarded.
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_SendVideoStream(const uint8_t *data, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "videoStream" channel. User can use the state as base for controlling data
|
||||
* transmission of video stream. This function exists and can be used only in Linux operation system.
|
||||
* @param state: pointer to "videoStream" channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_GetVideoStreamState(T_PsdkDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Push added media file information to aircraft system.
|
||||
* @details After photography or recording video, users must push information of created media file immediately using
|
||||
* this interface.
|
||||
* @param filePath: pointer to path of added media file. Guaranteed to end with '\0'. Length of path have to be less
|
||||
* than ::PSDK_FILE_PATH_SIZE_MAX bytes.
|
||||
* @param mediaFileInfo: information of added media file.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCamera_PushAddedMediaFileInfo(const char *filePath,
|
||||
T_PsdkCameraMediaFileInfo mediaFileInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_PAYLOAD_CAMERA_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,116 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_payload_collaboration.h
|
||||
* @brief This is the header file for "psdk_payload_collaboration.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 DJI’s 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 PSDK_PAYLOAD_COLLABORATION_H
|
||||
#define PSDK_PAYLOAD_COLLABORATION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "legacy_psdk2.x/psdk_payload_camera.h"
|
||||
#include "legacy_psdk2.x/psdk_aircraft_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Camera type.
|
||||
*/
|
||||
typedef E_DjiCameraType E_PsdkPayloadCollaborationCameraType;
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_UNKNOWN DJI_CAMERA_TYPE_UNKNOWN /*!< Camera type is unknown. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_XT DJI_CAMERA_TYPE_XT /*!< Camera type is XT. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_X4S DJI_CAMERA_TYPE_X4S /*!< Camera type is X4S. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_X5S DJI_CAMERA_TYPE_X5S /*!< Camera type is X5S. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_X7 DJI_CAMERA_TYPE_X7 /*!< Camera type is X7. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_Z30 DJI_CAMERA_TYPE_Z30 /*!< Camera type is Z30. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_XT2 DJI_CAMERA_TYPE_XT2/*!< Camera type is XT2. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_PSDK DJI_CAMERA_TYPE_PSDK /*!< Camera type is third party camera based on Payload SDK. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_XTS DJI_CAMERA_TYPE_XTS /*!< Camera type is XT S. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_H20 DJI_CAMERA_TYPE_H20 /*!< Camera type is H20. */
|
||||
#define PSDK_PAYLOAD_COLLABORATION_CAMERA_TYPE_H20T DJI_CAMERA_TYPE_H20T /*!< Camera type is H20T. */
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise payload collaboration module. User should call this function before using this module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCollaboration_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise payload collaboration module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCollaboration_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Get camera type of other payloads mounted on aircraft.
|
||||
* @note Please refer to PSDK documentation in DJI SDK developer website for details of conditions of use.
|
||||
* @note If there is empty in requested position or payload do not have camera type, the interface will return error.
|
||||
* @param payloadPosition: position where payload mounted on.
|
||||
* @param cameraType: Pointer to camera type of payload.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPayloadCollaboration_GetCameraTypeOfPayload(
|
||||
E_PsdkAircraftInfoPayloadMountPosition payloadPosition,
|
||||
E_PsdkPayloadCollaborationCameraType *cameraType);
|
||||
|
||||
/**
|
||||
* @brief Get optical zoom specification of other camera payloads mounted on aircraft.
|
||||
* @note Please refer to PSDK documentation in DJI SDK developer website for details of conditions of use.
|
||||
* @note If there is empty in requested position or payload do not have related information, the interface will return
|
||||
* error.
|
||||
* @param payloadPosition: position where payload mounted on.
|
||||
* @param opticalZoomSpec: pointer to optical zoom specification.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode
|
||||
PsdkPayloadCollaboration_GetCameraOpticalZoomSpecOfPayload(E_PsdkAircraftInfoPayloadMountPosition payloadPosition,
|
||||
T_PsdkCameraOpticalZoomSpec *opticalZoomSpec);
|
||||
|
||||
/**
|
||||
* @brief Get hybrid zoom focal length of other camera payloads mounted on aircraft.
|
||||
* @note Please refer to PSDK documentation in DJI SDK developer website for details of conditions of use.
|
||||
* @note If there is empty in requested position or payload do not have related information, the interface will return
|
||||
* error.
|
||||
* @param payloadPosition: position where payload mounted on.
|
||||
* @param focalLength: Pointer to optical focal length, unit: 0.1mm.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode
|
||||
PsdkPayloadCollaboration_GetCameraHybridZoomFocalLengthOfPayload(E_PsdkAircraftInfoPayloadMountPosition payloadPosition,
|
||||
uint16_t *focalLength);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // `PSDK_PAYLOAD_COLLABORATION`_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,216 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_platform.h
|
||||
* @brief This is the header file for define PSDK platform interfaces.
|
||||
*
|
||||
* @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 DJI’s 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 PSDK_PLATFORM_H
|
||||
#define PSDK_PLATFORM_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Platform handle of thread task operation.
|
||||
*/
|
||||
typedef T_DjiTaskHandle T_PsdkTaskHandle;
|
||||
/**
|
||||
* @brief Platform handle of mutex operation.
|
||||
*/
|
||||
typedef T_DjiMutexHandle T_PsdkMutexHandle;
|
||||
/**
|
||||
* @brief Platform handle of semaphore operation.
|
||||
*/
|
||||
typedef T_DjiSemaHandle T_PsdkSemHandle;
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef T_DjiHalUartHandler T_PsdkHalUartHandler;
|
||||
|
||||
typedef T_DjiHalNetworkHandler T_PsdkHalNetWorkHandler;
|
||||
|
||||
typedef T_DjiOsalHandler T_PsdkOsalHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Register the handler for hal uart interfaces by your platform.
|
||||
* @note It should be noted that the interface in hal is written and tested well. Users need to implement all the
|
||||
* interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
|
||||
* through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
|
||||
* sure that the feature is available after a successful registration. The interface needs to be called at the beginning of
|
||||
* the application for registration, otherwise, the subsequent functions will not work properly.
|
||||
* @param halUartHandler: pointer to the handler for hal uart interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPlatform_RegHalUartHandler(const T_PsdkHalUartHandler *halUartHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for osal interfaces by your platform.
|
||||
* @note It should be noted that the interface in osal is written and tested well. Users need to implement all the
|
||||
* interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
|
||||
* through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
|
||||
* sure that the feature is available after a successful registration. The interface needs to be called at the beginning of
|
||||
* the application for registration, otherwise, the subsequent functions will not work properly.
|
||||
* @param osalHandler: pointer to the handler for osal interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPlatform_RegOsalHandler(const T_PsdkOsalHandler *osalHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for hal network interfaces by your platform.
|
||||
* @note It should be noted that the interface in hal is written and tested well. Users need to implement all the
|
||||
* interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
|
||||
* through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
|
||||
* sure that the feature is available after a successful registration.
|
||||
* @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
|
||||
* subsequent functions will not work properly.
|
||||
* @param osalHandler: pointer to the handler for network handler interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPlatform_RegHalNetworkHandler(const T_PsdkHalNetWorkHandler *halNetWorkHandler);
|
||||
|
||||
/**
|
||||
* @brief Declare the task container, initialize the task, and create task ID.
|
||||
* @param task: pointer to the created task ID.
|
||||
* @param taskFunc: pointer to the created task function.
|
||||
* @param name: pointer to task name string, end with '\0'. If user do not specify name for task, fill in NULL.
|
||||
* @param stackSize: value of task stack size, unit: byte.
|
||||
* @param arg: pointer to the user defined data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_TaskCreate(T_PsdkTaskHandle *task, void *(*taskFunc)(void *), const char *name,
|
||||
uint32_t stackSize, void *arg);
|
||||
|
||||
/**
|
||||
* @brief Destroy the created task.
|
||||
* @param task: pointer to the created task ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_TaskDestroy(T_PsdkTaskHandle task);
|
||||
|
||||
/**
|
||||
* @brief Let task into a sleep state in a set time, uint:ms.
|
||||
* @param timeMs: value of time ms for task sleeping.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_TaskSleepMs(uint32_t timeMs);
|
||||
|
||||
/**
|
||||
* @brief Declare the mutex container, initialize the mutex, and create mutex ID.
|
||||
* @param mutex: pointer to the created mutex ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_MutexCreate(T_PsdkMutexHandle *mutex);
|
||||
|
||||
/**
|
||||
* @brief Destroy the created mutex.
|
||||
* @param mutex: pointer to the created mutex ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_MutexDestroy(T_PsdkMutexHandle mutex);
|
||||
|
||||
/**
|
||||
* @brief Acquire and lock the mutex when peripheral access is required.
|
||||
* @param mutex: pointer to the created mutex ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_MutexLock(T_PsdkMutexHandle mutex);
|
||||
|
||||
/**
|
||||
* @brief Unlock and release the mutex when done with the peripheral access.
|
||||
* @param mutex: pointer to the created mutex ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_MutexUnlock(T_PsdkMutexHandle mutex);
|
||||
|
||||
/**
|
||||
* @brief Declare the semaphore container, initialize the semaphore, and create semaphore ID.
|
||||
* @param semaphore: pointer to the created semaphore ID.
|
||||
* @param initValue: init value of semaphore for the created semaphore.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_SemaphoreCreate(T_PsdkSemHandle *semaphore, uint32_t initValue);
|
||||
|
||||
/**
|
||||
* @brief Destroy the created semaphore.
|
||||
* @param semaphore: pointer to the created semaphore ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_SemaphoreDestroy(T_PsdkSemHandle semaphore);
|
||||
|
||||
/**
|
||||
* @brief Wait the created semaphore forever.
|
||||
* @param semaphore: pointer to the created semaphore ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_SemaphoreWait(T_PsdkSemHandle semaphore);
|
||||
|
||||
/**
|
||||
* @brief Wait the created semaphore and set the value of timeout.
|
||||
* @param semaphore: pointer to the created semaphore ID.
|
||||
* @param waitTimeMs: value of timeout for waiting created semaphore.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_SemaphoreTimedWait(T_PsdkSemHandle semaphore, uint32_t waitTimeMs);
|
||||
|
||||
/**
|
||||
* @brief Post the created semaphore.
|
||||
* @param semaphore: pointer to the created semaphore ID.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_SemaphorePost(T_PsdkSemHandle semaphore);
|
||||
|
||||
/**
|
||||
* @brief Get the system millisecond time, uint:ms.
|
||||
* @param ms: pointer to the got time ms.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkOsal_GetTimeMs(uint32_t *ms);
|
||||
|
||||
/**
|
||||
* @brief Allocate size bytes of memory.
|
||||
* @note Users need to apply for memory according to the actual situation of the platform and application. If you do not
|
||||
* use the memory after applying for it, please call #PsdkOsal_Free to release the memory.
|
||||
* @param size: uint32_t size that needs allocate.
|
||||
* @return a void pointer to the allocated memory, if equal to NULL, please do related processing to avoid null pointer crash.
|
||||
*/
|
||||
void *PsdkOsal_Malloc(uint32_t size);
|
||||
|
||||
/**
|
||||
* @brief Release allocated memory.
|
||||
* @note After calling the #PsdkOsal_Malloc interface, if you do not use memory, please remember to use this interface
|
||||
* to release the memory.
|
||||
* @param ptr: pointer to the need allocated memory.
|
||||
*/
|
||||
void PsdkOsal_Free(void *ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_PLATFORM_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,113 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_positioning.h
|
||||
* @brief This is the header file for "psdk_positioning.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 DJI’s 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 PSDK_POSITIONING_H
|
||||
#define PSDK_POSITIONING_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "legacy_psdk2.x/psdk_time_sync.h"
|
||||
#include "dji_positioning.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Data structure that describes a positioning event.
|
||||
*/
|
||||
typedef T_DjiPositioningEventInfo T_PsdkPositioningEventInfo;
|
||||
|
||||
/**
|
||||
* @brief Data structure that describes position of a point.
|
||||
*/
|
||||
typedef T_DjiPositioningPosition T_PsdkPositioningPosition;
|
||||
|
||||
/**
|
||||
* @brief Position value standard deviation.
|
||||
*/
|
||||
typedef T_DjiPositioningPositionStandardDeviation T_PsdkPositioningPositionStandardDeviation;
|
||||
|
||||
/**
|
||||
* @brief Position of target point and other details returned by interface of requesting position.
|
||||
*/
|
||||
typedef T_DjiPositioningPositionInfo T_PsdkPositioningPositionInfo;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise positioning module in blocking mode. User should call this function before all other positioning
|
||||
* operations, just like setting task index, register callback function and requesting positions.
|
||||
* @note Max execution time of this function is slightly larger than 500ms.
|
||||
* @note This function has to be called in user task, rather than main() function, and after scheduler being started.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPositioning_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Set task index, specifying a sequence number of operations, using to write to mark the file for some post-process
|
||||
* flows.
|
||||
* @details One operation may be a precise surveying and mapping task or ten exposures of camera. The default task index
|
||||
* is 0.
|
||||
* @param index: task index.
|
||||
*/
|
||||
void PsdkPositioning_SetTaskIndex(uint8_t index);
|
||||
|
||||
/**
|
||||
* @brief The interface is used to get the position of target points and other information (refer to
|
||||
* ::T_PsdkPositioningPositionInfo) based on the timestamp in aircraft time system when some events (positioning events) are
|
||||
* triggered. The function uses blocking mode.
|
||||
* @details Users can request positions for multiple events (event set) conveniently, such as sync exposure of
|
||||
* multiple cameras. User must register callback function used to get the newest PPS triggered timestamp (refer to
|
||||
* PsdkPositioning_RegGetNewestPpsTriggerTimeCallback()) before requesting position. When users have set structure
|
||||
* parameters of payload and interest points (the points whose position user hope to get, e.g. center point of the camera
|
||||
* image sensor), the target points are interest points, otherwise the target points are main gimbal interface center.
|
||||
* Users can use position information of gimbal interface center, position offset between gimbal interface center and
|
||||
* RTK main antenna, UAV attitude, gimbal structure parameters ,and gimbal attitude to calculate the position of interest
|
||||
* points in the payload.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @note All requested timestamp have to be between the time point 2 seconds earlier than the newest synchronized
|
||||
* timestamp and the time point 1 seconds earlier than the newest synchronized timestamp.
|
||||
* @param eventCount: count of positioning event set specified by eventInfo parameter. Please ensure the count is less
|
||||
* than 5.
|
||||
* @param eventInfo: pointer to positioning event information array.
|
||||
* @param positionInfo: the position of target points. In Matrice 210 RTK V2 and Matrice 300 RTK aircraft system, it is
|
||||
* the position of the main gimbal interface always.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPositioning_GetPositionInformationSync(uint8_t eventCount, T_PsdkPositioningEventInfo *eventInfo,
|
||||
T_PsdkPositioningPositionInfo *positionInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_POSITIONING_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,105 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_power_management.h
|
||||
* @brief This is the header file for "psdk_power_management.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 DJI’s 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 PSDK_POWER_MANAGEMENT_H
|
||||
#define PSDK_POWER_MANAGEMENT_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <legacy_psdk2.x/psdk_typedef.h>
|
||||
#include <legacy_psdk2.x/psdk_aircraft_info.h>
|
||||
#include "dji_power_management.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief Pin state.
|
||||
*/
|
||||
typedef E_DjiPowerManagementPinState E_PsdkPowerManagementPinState;
|
||||
#define PSDK_POWER_MANAGEMENT_PIN_STATE_RESET DJI_POWER_MANAGEMENT_PIN_STATE_RESET /*!< Specifies pin is in low level state. */
|
||||
#define PSDK_POWER_MANAGEMENT_PIN_STATE_SET DJI_POWER_MANAGEMENT_PIN_STATE_SET /*!< Specifies pin is in high level state. */
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set level of high power application pin.
|
||||
* @param pinState: level state of pin to be set.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiWriteHighPowerApplyPinCallback WriteHighPowerApplyPinCallback;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to notify payload that the aircraft will power off soon and get state
|
||||
* whether the payload is ready to power off or not.
|
||||
* @warning User can not execute blocking style operations or functions in a callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param powerOffPreparationFlag: pointer to memory space used to store power off preparation flag. True represents
|
||||
* that payload has completed all work and is ready to power off. False represents that payload is not ready to power
|
||||
* off.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiPowerOffNotificationCallback PowerOffNotificationCallback;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Apply high power from aircraft in blocking mode.
|
||||
* @details Before applying, user should register callback function used to set level state of high power application
|
||||
* pin using PsdkPowerManagement_RegWriteHighPowerApplyPinCallback() function. After applying high power, power pin of
|
||||
* PSDK adapter will output high power based predetermined specification.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPowerManagement_ApplyHighPowerSync(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to set level state of high power application pin. Must be called before
|
||||
* applying high power.
|
||||
* @param callback: pointer to the callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPowerManagement_RegWriteHighPowerApplyPinCallback(WriteHighPowerApplyPinCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to notify payload that the aircraft will power off soon and get state
|
||||
* whether the payload is ready to power off or not.
|
||||
* @details After registering, the callback function will be called at a fixed frequency when aircraft will power off.
|
||||
* User fill in the power off preparation flag, and once the payload is ready to power off, the callback function will not
|
||||
* be called. After a specified time, if the payload is not ready to power off, the aircraft will power off immediately. The
|
||||
* specified time is 10s.
|
||||
* @param callback: pointer to callback function used to notify aircraft power off message and get payload power off
|
||||
* preparation flag.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkPowerManagement_RegPowerOffNotificationCallback(PowerOffNotificationCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_POWER_MANAGEMENT_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,63 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_product_info.h
|
||||
* @brief This is the header file for "psdk_product_info.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 DJI’s 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 PSDK_PRODUCT_INFO_H
|
||||
#define PSDK_PRODUCT_INFO_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <legacy_psdk2.x/psdk_typedef.h>
|
||||
#include <dji_core.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Set an alias that satisfies the condition for PSDK application or product.
|
||||
* @details Alias will display in DJI Pilot, if exist.
|
||||
* @note Still need to pass in correct PSDK APP name that is obtained from DJI SDK developer website to PsdkCore_Init()
|
||||
* interface. The PSDK APP name will be used to bind or verification.
|
||||
* @note Alias will be effective after a while, and the max value is 1s.
|
||||
* @param productAlias: pointer to product alias string, and alias end with '\0'. The max length of the string is 31. If
|
||||
* length of alias string is greater than 31, alias string will be truncated and passed in.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkProductInfo_SetAlias(const char *productAlias);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_PRODUCT_INFO_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,92 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_time_sync.h
|
||||
* @brief This is the header file for "psdk_time_synchronization.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 DJI’s 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 PSDK_TIME_SYNC_H
|
||||
#define PSDK_TIME_SYNC_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "dji_time_sync.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the newest PPS triggered timestamp.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param localTimeUs: pointer to memory space used to store PPS triggered timestamp.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiGetNewestPpsTriggerLocalTimeUsCallback GetNewestPpsTriggerLocalTimeUsCallback;
|
||||
|
||||
/**
|
||||
* @brief Data structure of time in aircraft time system.
|
||||
*/
|
||||
typedef T_DjiTimeSyncAircraftTime T_PsdkTimeSyncAircraftTime;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise time synchronization module in blocking mode. User should call this function before all other time
|
||||
* synchronization operations, just like transferring time.
|
||||
* @note Max execution time of this function is slightly larger than 2000ms.
|
||||
* @note This function have to be called in user task, rather than main() function, and after scheduler being started.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkTimeSync_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to get the newest timestamp in local time system when PPS rising edge signal
|
||||
* is detected.
|
||||
* @details PSDK uses the timestamp information to synchronise time of local time system and RTK navigation and
|
||||
* positioning system.
|
||||
* @param callback: pointer to the callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkTimeSync_RegGetNewestPpsTriggerTimeCallback(GetNewestPpsTriggerLocalTimeUsCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Transfer local time to time in aircraft time system.
|
||||
* @note Before calling the interface, users must call PsdkTimeSync_RegGetNewestPpsTriggerTimeCallback() to register
|
||||
* callback function used to report the latest triggered time of PPS signal.
|
||||
* @param localTimeUs: local time, unit: microsecond.
|
||||
* @param aircraftTime: pointer to memory space used to store time in aircraft time system.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkTimeSync_TransferToAircraftTime(uint64_t localTimeUs, T_PsdkTimeSyncAircraftTime *aircraftTime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_TIME_SYNC_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,88 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_typedef.h
|
||||
* @brief PSDK type define file.
|
||||
*
|
||||
* @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 DJI’s 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 PSDK_TYPEDEF_H
|
||||
#define PSDK_TYPEDEF_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_error.h"
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define PI DJI_PI
|
||||
#define PSDK_FILE_NAME_SIZE_MAX DJI_FILE_NAME_SIZE_MAX
|
||||
#define PSDK_FILE_PATH_SIZE_MAX DJI_FILE_PATH_SIZE_MAX
|
||||
#define PSDK_IP_ADDR_STR_SIZE_MAX DJI_IP_ADDR_STR_SIZE_MAX
|
||||
#define PSDK_MD5_BUFFER_LEN DJI_MD5_BUFFER_LEN
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Type define double as psdk_f64_t.
|
||||
*/
|
||||
typedef dji_f64_t psdk_f64_t;
|
||||
/**
|
||||
* @brief Type define float as psdk_f32_t.
|
||||
*/
|
||||
typedef dji_f32_t psdk_f32_t;
|
||||
/**
|
||||
* @brief Type define uint64 as T_PsdkReturnCode.
|
||||
* @details The type can be any value of ::PsdkErrorCode.
|
||||
*/
|
||||
typedef T_DjiReturnCode T_PsdkReturnCode;
|
||||
|
||||
#pragma pack (1)
|
||||
|
||||
typedef T_DjiVector3d T_PsdkVector3d;
|
||||
|
||||
typedef T_DjiVector3f T_PsdkVector3f;
|
||||
|
||||
typedef T_DjiAttitude3d T_PsdkAttitude3d;
|
||||
|
||||
typedef T_DjiAttitude3f T_PsdkAttitude3f;
|
||||
|
||||
typedef T_DjiQuaternion4f T_PsdkQuaternion4f;
|
||||
|
||||
typedef T_DjiDataChannelState T_PsdkDataChannelState;
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
/* define compiler specific symbols */
|
||||
#if defined (__ICCARM__)
|
||||
#elif defined (__CC_ARM)
|
||||
#pragma anon_unions
|
||||
#elif defined (__GNUC__)
|
||||
#elif defined (__TASKING__)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PSDK_TYPEDEF_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,140 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_upgrade.h
|
||||
* @brief This is the header file for "psdk_upgrade.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 DJI’s 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 PSDK_UPGRADE_H
|
||||
#define PSDK_UPGRADE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include <dji_typedef.h>
|
||||
#include <dji_upgrade.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef E_DjiFirmwareTransferType E_PsdkPayloadFirmwareTransferType;
|
||||
/*!
|
||||
* @brief FTP firmware transfer type.
|
||||
* @note This transfer type only support linux platform and use network port. Users need to deploy FTP service on
|
||||
* payload. The ftp user info used to transfer upgrade firmware is :
|
||||
* username:psdk_payload_ftp
|
||||
* password:DJi_#$31
|
||||
* You can get guide about FTP service deployment on https://developer.dji.com/payload-sdk/documentation
|
||||
*/
|
||||
#define PSDK_PAYLOAD_FIRMWARE_TRANSFER_TYPE_FTP DJI_FIRMWARE_TRANSFER_TYPE_FTP
|
||||
/*!
|
||||
* @brief DCFTP firmware transfer type.
|
||||
* @details DCFTP (DJI Common File Transfer Protocol) is a private protocol used to transfer file on DJI Product.
|
||||
* Users can get file data by command callbacks, see :: T_PsdkUpgradeDcftpFileTransferOpt.
|
||||
* @note This transfer type is used to support RTOS platform or payload don't have network port. The transfer speed
|
||||
* is very slow compare to FTP because it uses low speed transfer channel.
|
||||
*/
|
||||
#define PSDK_PAYLOAD_FIRMWARE_TRANSFER_TYPE_DCFTP DJI_FIRMWARE_TRANSFER_TYPE_DCFTP
|
||||
|
||||
typedef E_DjiUpgradeStage E_PsdkUpgradeStage;
|
||||
#define PSDK_UPGRADE_STAGE_IDLE DJI_UPGRADE_STAGE_IDLE /*!< Idle stage means not in upgrade mode. */
|
||||
#define PSDK_UPGRADE_STAGE_ONGOING DJI_UPGRADE_STAGE_ONGOING /*!< Ongoing stage means payload is upgrading. */
|
||||
#define PSDK_UPGRADE_STAGE_DEVICE_REBOOT DJI_UPGRADE_STAGE_DEVICE_REBOOT /*!< Device reboot stage means device is rebooting. */
|
||||
#define PSDK_UPGRADE_STAGE_END DJI_UPGRADE_STAGE_END /*!< End Stage means upgrade finish and reporting upgrade result to the terminal APP. */
|
||||
|
||||
typedef E_DjiUpgradeEndState E_PsdkUpgradeEndState;
|
||||
#define PSDK_UPGRADE_END_STATE_SUCCESS DJI_UPGRADE_END_STATE_SUCCESS /*!< Upgrade success. */
|
||||
#define PSDK_UPGRADE_END_STATE_UNKNOWN_ERROR DJI_UPGRADE_END_STATE_UNKNOWN_ERROR /*!< Upgrade failure due to unknown reason. */
|
||||
|
||||
/**
|
||||
* @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 T_DjiFirmwareVersion T_PsdkPayloadFirmwareVersion;
|
||||
|
||||
typedef T_DjiUpgradeOngoingInfo T_PsdkUpgradeOngoingInfo;
|
||||
|
||||
typedef T_DjiUpgradeRebootInfo T_PsdkUpgradeRebootInfo;
|
||||
|
||||
typedef T_DjiUpgradeEndInfo T_PsdkUpgradeEndInfo;
|
||||
|
||||
typedef T_DjiUpgradeFtpFileTransferInfo T_PsdkUpgradeFtpFileTransferInfo;
|
||||
|
||||
typedef T_DjiUpgradeFileInfo T_PsdkUpgradeFileInfo;
|
||||
|
||||
typedef T_DjiUpgradeDcftpFileTransferOpt T_PsdkUpgradeDcftpFileTransferOpt;
|
||||
|
||||
typedef T_DjiFirmwareTransferInfo T_PsdkPayloadFirmwareTransferInfo;
|
||||
|
||||
typedef T_DjiUpgradeState T_PsdkUpgradeState;
|
||||
|
||||
typedef T_DjiUpgradeConfig T_PsdkUpgradeConfig;
|
||||
|
||||
typedef T_DjiUpgradeHandler T_PsdkUpgradeHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise upgrade module, and user should call this function before using upgrade features.
|
||||
* @param upgradeConfig: upgrade init configuration.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkUpgrade_Init(const T_PsdkUpgradeConfig *upgradeConfig);
|
||||
|
||||
/**
|
||||
* @brief Enable local upgrade mode.
|
||||
* @details After enable local upgrade mode, DJI Assistant 2 will display payload upgrade interface. Users can choose
|
||||
* firmware file to upgrade payload.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkUpgrade_EnableLocalUpgrade(void);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for upgrade process.
|
||||
* @param upgradeHandler: pointer to structure of handler functions for upgrade process.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkUpgrade_RegHandler(const T_PsdkUpgradeHandler *upgradeHandler);
|
||||
|
||||
/**
|
||||
* @brief Push upgrade state to terminal app.
|
||||
* @param upgradeState: upgrade state in upgrade process.
|
||||
* @note When start upgrade, you need push upgrade state until finish upgrade. The upgrade state push logic is :
|
||||
* 1. StartUpgrade callback called;
|
||||
* 2. The upgrade stage change to :: PSDK_UPGRADE_STAGE_ONGOING. Push upgrade state upgradeOngoingInfo when upgradeOngoingInfo changed;
|
||||
* 3. After upgrade ongoing, change upgrade stage to PSDK_UPGRADE_STAGE_DEVICE_REBOOT and push upgrade state upgradeRebootInfo;
|
||||
* 4. Device reboot;
|
||||
* 4. After device reboot, change upgrade stage to PSDK_UPGRADE_STAGE_END and continuous push upgrade state upgradeEndInfo (recommended 1Hz);
|
||||
* 5. FinishUpgrade Callback called, stop push upgrade state. The upgrade process finished.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkUpgrade_PushUpgradeState(const T_PsdkUpgradeState *upgradeState);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_UPGRADE_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,54 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_version.h
|
||||
* @brief This is the header file for "psdk_version.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 DJI’s 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 PSDK_VERSION_H
|
||||
#define PSDK_VERSION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <dji_version.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define PSDK_VERSION_MAJOR DJI_VERSION_MAJOR /*!< Payload SDK major version num, when have incompatible API changes. Range from 0 to 99. */
|
||||
#define PSDK_VERSION_MINOR DJI_VERSION_MINOR /*!< Payload SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
|
||||
#define PSDK_VERSION_MODIFY DJI_VERSION_MODIFY /*!< Payload SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
|
||||
#define PSDK_VERSION_BETA DJI_VERSION_BETA /*!< Payload SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
|
||||
#define PSDK_VERSION_BUILD DJI_VERSION_BUILD /*!< Payload SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_VERSION_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,171 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_widget.h
|
||||
* @brief This is the header file for "psdk_widget.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 DJI’s 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 PSDK_WIDGET_H
|
||||
#define PSDK_WIDGET_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <legacy_psdk2.x/psdk_typedef.h>
|
||||
#include <legacy_psdk2.x/psdk_aircraft_info.h>
|
||||
#include <dji_widget.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/*! The maximum length of a message that can be displayed by the mobile app floating window */
|
||||
#define PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Widget types.
|
||||
*/
|
||||
typedef E_DjiWidgetType E_PsdkWidgetType;
|
||||
#define PSDK_WIDGET_TYPE_BUTTON DJI_WIDGET_TYPE_BUTTON /*!< button widget type */
|
||||
#define PSDK_WIDGET_TYPE_SWITCH DJI_WIDGET_TYPE_SWITCH /*!< switch widget type */
|
||||
#define PSDK_WIDGET_TYPE_SCALE DJI_WIDGET_TYPE_SCALE /*!< scale widget type */
|
||||
#define PSDK_WIDGET_TYPE_LIST DJI_WIDGET_TYPE_LIST /*!< list widget type */
|
||||
#define PSDK_WIDGET_TYPE_INT_INPUT_BOX DJI_WIDGET_TYPE_INT_INPUT_BOX /*!< integer input box widget type */
|
||||
|
||||
/**
|
||||
* @brief Button widget state.
|
||||
*/
|
||||
typedef E_DjiWidgetButtonState E_PsdkWidgetButtonState;
|
||||
#define PSDK_WIDGET_BUTTON_STATE_PRESS_DOWN DJI_WIDGET_BUTTON_STATE_PRESS_DOWN /*!< Button is pressed down */
|
||||
#define PSDK_WIDGET_BUTTON_STATE_RELEASE_UP DJI_WIDGET_BUTTON_STATE_RELEASE_UP /*!< Button is released up */
|
||||
|
||||
/**
|
||||
* @brief Switch widget state.
|
||||
*/
|
||||
typedef E_DjiWidgetSwitchState E_PsdkWidgetSwitchState;
|
||||
#define PSDK_WIDGET_SWITCH_STATE_OFF DJI_WIDGET_SWITCH_STATE_OFF /*!< Switch is turned off */
|
||||
#define PSDK_WIDGET_SWITCH_STATE_ON DJI_WIDGET_SWITCH_STATE_ON /*!< Switch is turned on */
|
||||
|
||||
/**
|
||||
* @brief Widget file binary array.
|
||||
*/
|
||||
typedef T_DjiWidgetFileBinaryArray T_PsdkWidgetFileBinaryArray;
|
||||
|
||||
/**
|
||||
* @brief Widget binary array config.
|
||||
*/
|
||||
typedef T_DjiWidgetBinaryArrayConfig T_PsdkWidgetBinaryArrayConfig;
|
||||
|
||||
/**
|
||||
* @brief Widget handler item.
|
||||
*/
|
||||
typedef T_DjiWidgetHandlerListItem T_PsdkWidgetHandlerListItem;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise widget module, and user should call this function before using widget features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Register default widget UI configuration file directory path.
|
||||
* @note Under Linux system, there are two functions to set the custom widget configuration directory path, function
|
||||
* PsdkWidget_RegDefaultConfigByDirPath and PsdkWidget_RegUiConfigByDirPath. When you don't need multi-language
|
||||
* and multi-screen size support, you can just use PsdkWidget_RegDefaultUiConfigByDirPath function set widget UI
|
||||
* Config directory path. If you need support multi-language and multi-screen size support, you can use function
|
||||
* PsdkWidget_RegUiConfigByDirPath to specify widget configuration. When the language and screen size is not
|
||||
* cover in your setting by PsdkWidget_RegUiConfigByDirPath, the widget UI configuration uses setting by
|
||||
* PsdkWiget_RegDefaultUiConfigByDirPath function.
|
||||
* @param widgetConfigDirPath: the widget UI configuration directory path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_RegDefaultUiConfigByDirPath(const char *widgetConfigDirPath);
|
||||
|
||||
/**
|
||||
* @brief Register widget UI configuration file directory path.
|
||||
* @note Different widget UI configurations for several language and screen size require the same widget type, index and
|
||||
* count.
|
||||
* @param appLanguage: mobile app language type.
|
||||
* @param appScreenType: mobile app screen type.
|
||||
* @param widgetConfigDirPath: the widget UI configuration directory path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_RegUiConfigByDirPath(E_PsdkAircraftInfoMobileAppLanguage appLanguage,
|
||||
E_PsdkAircraftInfoMobileAppScreenType appScreenType,
|
||||
const char *widgetConfigDirPath);
|
||||
|
||||
/**
|
||||
* @brief Register default widget UI config by binary array configuration.
|
||||
* @note In RTOS, most likely there is no file system. The widget config file content can use C array express. Use this
|
||||
* function and PsdkWidget_RegDefaultUiConfigBinaryArray set widget UI configuration. When the language and screen size
|
||||
* is not cover in your setting by PsdkWidget_RegUiConfigByBinaryArray, the widget UI configuration uses setting by this
|
||||
* function.
|
||||
* @param binaryArrayConfig: the binary array config for widget UI configuration.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_RegDefaultUiConfigByBinaryArray(const T_PsdkWidgetBinaryArrayConfig *binaryArrayConfig);
|
||||
|
||||
/**
|
||||
* @brief Register widget UI config by binary array configuration.
|
||||
* @note Different widget UI configurations for several language and screen size require the same widget type, index and
|
||||
* count.
|
||||
* @param appLanguage: mobile app language type.
|
||||
* @param screenType: mobile app screen type.
|
||||
* @param binaryArrayConfig: the binary array config for widget UI configuration.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_RegUiConfigByBinaryArray(E_PsdkAircraftInfoMobileAppLanguage appLanguage,
|
||||
E_PsdkAircraftInfoMobileAppScreenType screenType,
|
||||
const T_PsdkWidgetBinaryArrayConfig *binaryArrayConfig);
|
||||
|
||||
/**
|
||||
* @brief Register handler list for widgets.
|
||||
* @param widgetHandlerList: widget handler list for widgets.
|
||||
* @param itemCount: the item count of widget handler list.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidget_RegHandlerList(const T_PsdkWidgetHandlerListItem *widgetHandlerList, uint32_t itemCount);
|
||||
|
||||
/**
|
||||
* @brief Send message to mobile app floating window.
|
||||
* @note the message length can't more than PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN. The max data bandwidth of floating
|
||||
* windows message is 2KB/s.
|
||||
* @param str: pointer to message string.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidgetFloatingWindow_ShowMessage(const char *str);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of floating window channel. User can use the state as base for controlling
|
||||
* floating windows message send.
|
||||
* @param state: pointer to floating window channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkWidgetFloatingWindow_GetChannelState(T_PsdkDataChannelState *state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_WIDGET_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -1,223 +0,0 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file psdk_xport.h
|
||||
* @brief XPort module provides some interfaces used to control XPort and get states of XPort. The module can be used
|
||||
* only when the PSDK adapter is XPort, rather than Skyport.
|
||||
*
|
||||
* @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 DJI’s 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 PSDK_XPORT_H
|
||||
#define PSDK_XPORT_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "legacy_psdk2.x/psdk_typedef.h"
|
||||
#include "legacy_psdk2.x/psdk_gimbal.h"
|
||||
#include "dji_xport.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief XPort limit angle category.
|
||||
*/
|
||||
typedef E_DjiXPortLimitAngleCategory E_PsdkXPortLimitAngleCategory;
|
||||
/*!< Joint angle limit of roll axis. */
|
||||
#define PSDK_XPORT_LIMIT_ANGLE_CATEGORY_ROLL_JOINT_ANGLE DJI_XPORT_LIMIT_ANGLE_CATEGORY_ROLL_JOINT_ANGLE
|
||||
/*!< Joint angle limit of pitch axis. */
|
||||
#define PSDK_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE
|
||||
/*!< Euler angle limit of pitch axis, just is limitation of angle in ground coordinate. */
|
||||
#define PSDK_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE
|
||||
/*!< Extended euler angle limit of pitch axis, just is limitation of angle in ground coordinate. Extended euler
|
||||
angle limit is activated when enable extended pitch axis angle limit. */
|
||||
#define PSDK_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE_EXTENSION DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE_EXTENSION
|
||||
/*!< Joint angle limit of yaw axis. */
|
||||
#define PSDK_XPORT_LIMIT_ANGLE_CATEGORY_YAW_JOINT_ANGLE DJI_XPORT_LIMIT_ANGLE_CATEGORY_YAW_JOINT_ANGLE
|
||||
|
||||
/**
|
||||
* @brief Limit angle data structure.
|
||||
*/
|
||||
typedef T_DjiXPortLimitAngle T_PsdkXPortLimitAngle;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive system state of XPort.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param systemState: system state of XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiReceiveXPortSystemStateCallback ReceiveXPortSystemStateCallback;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive attitude information of XPort.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block PSDK
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param attitudeInformation: attitude information of XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef DjiReceiveXPortAttitudeInformationCallback ReceiveXPortAttitudeInformationCallback;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise XPort module.
|
||||
* @note The function have to be called before other functions related to XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize XPort module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to receive system state of XPort.
|
||||
* @note The callback function will be called after registering. The call frequency is 1Hz.
|
||||
* @param callback: pointer to the callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_RegReceiveSystemStateCallback(ReceiveXPortSystemStateCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to receive attitude information of XPort.
|
||||
* @note The callback function will be called after registering. The call frequency is 10Hz.
|
||||
* @param callback: pointer to the callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_RegReceiveAttitudeInformationCallback(ReceiveXPortAttitudeInformationCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Set gimbal mode of XPort in blocking mode.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @param mode: gimbal mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_SetGimbalModeSync(E_PsdkGimbalMode mode);
|
||||
|
||||
/**
|
||||
* @brief Rotate gimbal of XPort in blocking mode.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @note If rotation mode is ::PSDK_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::PSDK_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE,
|
||||
* range of yaw value in rotation value argument is [-1800, 1800]. Gimbal can rotate to any angle of yaw axis by the
|
||||
* range. Symbol of yaw value does not determine the rotation direction of the gimbal.
|
||||
* @note Attitude that gimbal can reach is also determined by angle limitation and angle limitation buffer of the gimbal.
|
||||
* When the gimbal is upward, angle limitation differs from limitation users set. For angle limitation and angle limitation
|
||||
* buffer, please refer to PSDK documentation for details. If gimbal attitude is within range limitation buffer and
|
||||
* control gimbal move towards limit direction still, or gimbal attitude is outside the angle limitation buffer but
|
||||
* control gimbal to the range limitation buffer, the gimbal will return an error. For the former case, the gimbal will not
|
||||
* move. In the latter case, the gimbal will try to move towards the direction of angle limit but it will stop at
|
||||
* somewhere in angle limitation buffer.
|
||||
* @note Rotation speed and rotation duration are also limited by the maximum speed of gimbal and maximum acceleration. The
|
||||
* maximum acceleration is determined by the smooth factor of the gimbal controller set by APP. The maximum speed is determined
|
||||
* by default maximum speed and maximum speed percentage set by APP, and the default maximum speed of XPort is
|
||||
* 90degree/s. For the detailed relationship, please refer to SetControllerSmoothFactor() and
|
||||
* SetControllerMaxSpeedPercentage() callback function prototype in psdk_gimbal.h file.
|
||||
* @note Only pitch and yaw axis of XPort is controllable.
|
||||
* @note XPort do not response rotation command in process of control parameters auto-tuning, coaxiality detection,
|
||||
* balance detection and resetting. And these operations will interrupt rotation of XPort.
|
||||
* @note Effective time of a speed control command is 500ms, that is, if XPort do not receive other control commands
|
||||
* within 500ms after speed control, XPort will stop rotation.
|
||||
* @param rotationMode: mode of rotation command.
|
||||
* @param rotationProperty: property of rotation command.
|
||||
* @param rotationValue: value of rotation command, unit: 0.1 degree (if rotation mode is
|
||||
* ::PSDK_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::PSDK_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE), 0.1 degree/s
|
||||
* (if rotation mode is ::PSDK_GIMBAL_ROTATION_MODE_SPEED).
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_RotateSync(E_PsdkGimbalRotationMode rotationMode,
|
||||
T_PsdkGimbalRotationProperty rotationProperty, T_PsdkAttitude3d rotationValue);
|
||||
|
||||
/**
|
||||
* @brief Release gimbal control permission out in blocking mode.
|
||||
* @details When PSDK application control XPort gimbal, PSDK application will capture and gain control permission of
|
||||
* gimbal if allowable. After PSDK application sending a sequence of the gimbal control command, PSDK application should
|
||||
* call this interface to release control permission of gimbal, to allow other modules (like APP, flight
|
||||
* controller) can control gimbal right now. For example, PSDK application can release control permission after tap
|
||||
* zooming. Of course, if PSDK application does not release control permission after controlling gimbal, the gimbal will also
|
||||
* release control permission automatically at some time point later than the completion of control commands. Undoubtedly,
|
||||
* this is inefficient.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @note XPort do not response release control permission command in process of control parameters auto-tuning,
|
||||
* coaxiality detection and balance detection.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_ReleaseControlPermissionSync(void);
|
||||
|
||||
/**
|
||||
* @brief Reset gimbal of XPort in blocking mode.
|
||||
* @details The interface reset angle of pitch axis to corresponding fine tune value in ground coordinate, and yaw axis
|
||||
* to superimposed value of yaw axis angle of aircraft and corresponding fine tune value in ground coordinate.
|
||||
* @note Max execution time of this function is slightly larger than 600ms.
|
||||
* @note XPort do not response reset command in process of control parameters auto-tuning, coaxiality detection and
|
||||
* balance detection.
|
||||
* @param mode: Reset mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_ResetSync(E_PsdkGimbalResetMode mode);
|
||||
|
||||
/**
|
||||
* @brief Set limit angle for XPort in blocking mode.
|
||||
* @details Please refer to XPort part of <a href="https://developer.dji.com/payload-sdk">developer website</a> for
|
||||
* details about default limit angle of XPort.
|
||||
* @note Max execution time of this function is slightly larger than 1200ms.
|
||||
* @note XPort do not response set limit angle command in process of control parameters auto-tuning, coaxiality
|
||||
* detection and balance detection.
|
||||
* @param limitAngleCategory: limit angle category.
|
||||
* @param limitAngle: limit angle.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_SetLimitAngleSync(E_PsdkXPortLimitAngleCategory limitAngleCategory,
|
||||
T_PsdkXPortLimitAngle limitAngle);
|
||||
|
||||
/**
|
||||
* @brief Get limit angle of XPort in blocking mode.
|
||||
* @note Max execution time of this function is slightly larger than 1200ms.
|
||||
* @param limitAngleCategory: limit angle category.
|
||||
* @param limitAngle: pointer to memory space used to store limit angle.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_GetLimitAngleSync(E_PsdkXPortLimitAngleCategory limitAngleCategory,
|
||||
T_PsdkXPortLimitAngle *limitAngle);
|
||||
|
||||
/**
|
||||
* @brief Set speed conversion factor for speed control from joystick and APP.
|
||||
* @details XPort convert speed control command from joystick and APP to rotation speed based on the speed conversion
|
||||
* factor. The formula is "speed = maximum rotation speed * conversion factor", and maximum rotation speed is a product of
|
||||
* default maximum speed and maximum speed percentage. The default maximum rotation speed is 90degree/s. The maximum
|
||||
* speed percentage is set by APP. The default speed conversion factor is 1.0.
|
||||
* @note The value will be effective after a while, and the max value is 100ms.
|
||||
* @param factor: Speed conversion factor and it has to be smaller than or equal to 1.0.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_PsdkReturnCode PsdkXPort_SetSpeedConversionFactor(psdk_f32_t factor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PSDK_XPORT_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
Reference in New Issue
Block a user