第一次提交
This commit is contained in:
88
PSDK/psdk_lib/include/dji_aircraft_info.h
Normal file
88
PSDK/psdk_lib/include/dji_aircraft_info.h
Normal file
@ -0,0 +1,88 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_aircraft_info.h
|
||||
* @brief This is the header file for "dji_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 DJI_AIRCRAFT_INFO_H
|
||||
#define DJI_AIRCRAFT_INFO_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Information related to mobile APP.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiMobileAppLanguage appLanguage; /*!< Mobile APP system language */
|
||||
E_DjiMobileAppScreenType appScreenType; /*!< Mobile APP screen size type. */
|
||||
} T_DjiMobileAppInfo;
|
||||
|
||||
/**
|
||||
* @brief Some base information of aircraft system, mainly including some constant parameters information of system.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiAircraftType aircraftType; /*!< Aircraft type. */
|
||||
E_DjiSdkAdapterType djiAdapterType; /*!< DJI adapter type. */
|
||||
E_DjiMountPosition mountPosition; /*!< Payload mount position. */
|
||||
} T_DjiAircraftInfoBaseInfo;
|
||||
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Get base information of aircraft system, including aircraft type and DJI adapter type.
|
||||
* @param baseInfo: pointer to memory space used to store base information of the aircraft system.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiAircraftInfo_GetBaseInfo(T_DjiAircraftInfoBaseInfo *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_DjiReturnCode DjiAircraftInfo_GetMobileAppInfo(T_DjiMobileAppInfo *mobileAppInfo);
|
||||
|
||||
/**
|
||||
* @brief Get connection status of payload and aircraft.
|
||||
* @note Update period: 1Hz
|
||||
* @param isConnected: pointer to connection status.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiAircraftInfo_GetConnectionStatus(bool *isConnected);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DJI_AIRCRAFT_INFO_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
1020
PSDK/psdk_lib/include/dji_camera_manager.h
Normal file
1020
PSDK/psdk_lib/include/dji_camera_manager.h
Normal file
File diff suppressed because it is too large
Load Diff
103
PSDK/psdk_lib/include/dji_core.h
Normal file
103
PSDK/psdk_lib/include/dji_core.h
Normal file
@ -0,0 +1,103 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dij_core.h
|
||||
* @brief This is the header file for "dij_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 DJI_CORE_H
|
||||
#define DJI_CORE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
char appName[32]; /*!< Specifies DJI SDK app name. This info can be obtained by logging in to the
|
||||
developer website https://developer.dji.com/user/apps/#all. End with '\0'. */
|
||||
char appId[16]; /*!< Specifies DJI SDK app ID. This info can be obtained by logging in to the
|
||||
developer website https://developer.dji.com/user/apps/#all. */
|
||||
char appKey[32]; /*!< Specifies DJI SDK app key. This info can be obtained by logging in to the
|
||||
developer website https://developer.dji.com/user/apps/#all. */
|
||||
char appLicense[512]; /*!< Specifies DJI SDK app license. This info can be obtained by logging in to the
|
||||
developer website https://developer.dji.com/user/apps/#all. */
|
||||
char developerAccount[64]; /*!< Specifies DJI SDK developer account email. This info can be obtained by
|
||||
logging in to the developer website https://developer.dji.com/user/apps/#all.
|
||||
Developer's account and other related information need to be able to correspond.
|
||||
End with '\0'. */
|
||||
char baudRate[7]; /*!< Specifies DJI SDK communication serial port baud rate. */
|
||||
} T_DjiUserInfo;
|
||||
|
||||
/* 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_DjiReturnCode DjiCore_Init(const T_DjiUserInfo *userInfo);
|
||||
|
||||
/**
|
||||
* @brief Set an alias that satisfies the condition for DJI application or product.
|
||||
* @details Alias will display in DJI Pilot, if exist.
|
||||
* @note Still need to pass in correct DJI APP name that is obtained from DJI SDK developer website to DjiCore_Init()
|
||||
* interface. The DJI 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_DjiReturnCode DjiCore_SetAlias(const char *productAlias);
|
||||
|
||||
/**
|
||||
* @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_DjiReturnCode DjiCore_ApplicationStart(void);
|
||||
|
||||
/**
|
||||
* @brief DeInitialize the Payload SDK core in blocking mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiCore_DeInit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DIJ_CORE_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
1029
PSDK/psdk_lib/include/dji_error.h
Normal file
1029
PSDK/psdk_lib/include/dji_error.h
Normal file
File diff suppressed because it is too large
Load Diff
1194
PSDK/psdk_lib/include/dji_fc_subscription.h
Normal file
1194
PSDK/psdk_lib/include/dji_fc_subscription.h
Normal file
File diff suppressed because it is too large
Load Diff
629
PSDK/psdk_lib/include/dji_flight_controller.h
Normal file
629
PSDK/psdk_lib/include/dji_flight_controller.h
Normal file
@ -0,0 +1,629 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_flight_controller.h
|
||||
* @brief This is the header file for "dji_flight_controller.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 DJI_FLIGHT_CONTROLLER_H
|
||||
#define DJI_FLIGHT_CONTROLLER_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH 10 /*!< Max length of emergency stop motor message. */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef uint16_t E_DjiFlightControllerGoHomeAltitude; /*!< Unit:meter, range 20~500 */
|
||||
|
||||
/**
|
||||
* @brief The UAV's actions when rc is lost.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_HOVER = 0, /*!< Aircraft will execute hover cation when rc is lost. */
|
||||
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_LANDING = 1, /*!< Aircraft will execute land cation when rc is lost. */
|
||||
DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME = 2, /*!< Aircraft will execute go-home cation when rc is lost. */
|
||||
} E_DjiFlightControllerRCLostAction;
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable RTK position enum
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_DISABLE_RTK_POSITION = 0, /*!< 0: The UAV will use GPS data instead of RTK data to execute
|
||||
* actions which require location information(waypoint、go home...)
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_ENABLE_RTK_POSITION = 1, /*!< 1:The UAV will use RTK data instead of GPS data to execute
|
||||
* actions which require location information(waypoint、go home...)*/
|
||||
} E_DjiFlightControllerRtkPositionEnableStatus;
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable obstacle avoidance enum
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_DISABLE_OBSTACLE_AVOIDANCE = 0, /*!< 0: The UAV will not perform obstacle avoidance in
|
||||
* the specified direction */
|
||||
DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE = 1, /*!< 0: The UAV will perform obstacle avoidance in the
|
||||
* specified direction */
|
||||
} E_DjiFlightControllerObstacleAvoidanceEnableStatus;
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable emergency stop motor function enum
|
||||
* @note Attention:Enable emergency-stop-motor function is very dangerous in the air.it will make the aircraft crash!!!
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_ENABLE_EMERGENCY_STOP_MOTOR = 0x01, /*!< Execute emergency-stop-motor action */
|
||||
DJI_FLIGHT_CONTROLLER_DISABLE_EMERGENCY_STOP_MOTOR = 0x02 /*!< Cancel emergency-stop-motor status */
|
||||
} E_DjiFlightControllerEmergencyStopMotor;
|
||||
|
||||
/**
|
||||
* @brief Obtain/Release joystick control authority command enum
|
||||
* @note You have obtain joystick control authority successfully before using joystick.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_RELEASE_JOYSTICK_CTRL_AUTHORITY = 0, /*!< Obtain joystick authority */
|
||||
DJI_FLIGHT_CONTROLLER_OBTAIN_JOYSTICK_CTRL_AUTHORITY = 1, /*!< Release joystick authority */
|
||||
} E_DjiFlightControllerJoystickCtrlAuthorityAction;
|
||||
|
||||
/**
|
||||
* @brief The UAV's joystick control authority owner enum
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_RC = 0, /*!< Rc could control UAV with joystick. */
|
||||
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_MSDK = 1, /*!< MSDK could control UAV with joystick. */
|
||||
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_INTERNAL = 2, /*!< Special Internal modules could control UAV
|
||||
* with joystick. */
|
||||
DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_OSDK = 4, /*!< OSDK could control UAV with joystick. */
|
||||
} E_DjiFlightControllerJoystickCtrlAuthority;
|
||||
|
||||
/**
|
||||
* @brief The UAV's joystick control authority switch reason enum
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_MSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 1, /*!< MSDK get joystick control authority. */
|
||||
DJI_FLIGHT_CONTROLLER_INTERNAL_GET_JOYSTICK_CTRL_AUTH_EVENT = 2, /*!< Special Internal modules get joystick control authority. */
|
||||
DJI_FLIGHT_CONTROLLER_OSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 3, /*!< OSDK get joystick control authority. */
|
||||
DJI_FLIGHT_CONTROLLER_RC_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 4, /*!< Reset joystick control authority to rc when executing rc lost action */
|
||||
DJI_FLIGHT_CONTROLLER_RC_NOT_P_MODE_RESET_JOYSTICK_CTRL_AUTH_EVENT = 5, /*!< Reset joystick control authority to rc when rc is not in P mode */
|
||||
DJI_FLIGHT_CONTROLLER_RC_SWITCH_MODE_GET_JOYSTICK_CTRL_AUTH_EVENT = 6, /*!< Set joystick control authority to rc when rc switch control mode(T/APS) */
|
||||
DJI_FLIGHT_CONTROLLER_RC_PAUSE_GET_JOYSTICK_CTRL_AUTH_EVENT = 7, /*!< Reset joystick control authority to rc when rc pausing */
|
||||
DJI_FLIGHT_CONTROLLER_RC_REQUEST_GO_HOME_GET_JOYSTICK_CTRL_AUTH_EVENT = 8, /*!< Reset joystick control authority to rc when rc requesting go home*/
|
||||
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_GO_HOME_RESET_JOYSTICK_CTRL_AUTH_EVENT = 9, /*!< Reset joystick control authority to rc when aircraft is executing low-battery-go-home*/
|
||||
DJI_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT = 10, /*!< Reset joystick control authority to rc when aircraft is executing low-battery-landing*/
|
||||
DJI_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 11, /*!< Reset joystick control authority to rc when osdk is lost*/
|
||||
DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT = 12, /*!< Reset joystick control authority to rc when aircraft is near boundary.*/
|
||||
} E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent;
|
||||
|
||||
/**
|
||||
* @brief The UAV's joystick control authority switch event info enum
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiFlightControllerJoystickCtrlAuthority curJoystickCtrlAuthority; /*!< The UAV's joystick control authority owner */
|
||||
E_DjiFlightControllerJoystickCtrlAuthoritySwitchEvent joystickCtrlAuthoritySwitchEvent; /*!< The UAV's joystick control authority switch reason */
|
||||
} T_DjiFlightControllerJoystickCtrlAuthorityEventInfo;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get joystick control authority switch event info.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*JoystickCtrlAuthorityEventCbFunc)(
|
||||
T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData);
|
||||
|
||||
/**
|
||||
* @brief Horizon control mode in joystick mode enum
|
||||
* @note Only when the GPS signal is good (health_flag >=3),horizontal position control (DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE)
|
||||
* related control modes can be used. only when GPS signal is good (health_flag >=3),or when advanced sensing system is working properly with Autopilot,
|
||||
* horizontal velocity control(DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE) related control modes can be used.
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* @brief Control pitch & roll & angle of the aircraft.
|
||||
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting.
|
||||
* Limit: -35 degree to 35 degree
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_ANGLE_CONTROL_MODE = 0,
|
||||
/**
|
||||
* @brief Set the control-mode to control horizontal vehicle velocities.
|
||||
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
|
||||
* Limit: -30m/s to 30 m/s
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE = 1,
|
||||
/**
|
||||
* @brief Set the control-mode to control position offsets of pitch & roll directions.
|
||||
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
|
||||
* Limit: N/A
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE = 2,
|
||||
/**
|
||||
* @brief Set the control-mode to control rate of change of the vehicle's attitude.
|
||||
* @note Need to be referenced to either the ground or body frame by E_DjiFlightControllerHorizontalCoordinate setting
|
||||
* Limit: -150deg/s to 150.0 deg/s
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_ANGULAR_RATE_CONTROL_MODE = 3
|
||||
} E_DjiFlightControllerHorizontalControlMode;
|
||||
|
||||
/**
|
||||
* @brief Vertical control mode in joystick mode enum
|
||||
* @note We suggest developers do not use VERTICAL_POSITION control mode indoor when your UAV flight height is larger than 3 meters.
|
||||
* This is because in indoor environments, barometer can be inaccurate, and the vertical controller may fail to keep
|
||||
* the height of the UAV.
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* @brief Set the control-mode to control the vertical speed of UAV, upward is positive/
|
||||
* @note Limit: -5m/s to 5 m/s
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_VERTICAL_VELOCITY_CONTROL_MODE = 0,
|
||||
|
||||
/**
|
||||
* @brief Set the control-mode to control the height of UAV
|
||||
* @note Limit: 0m to 120 m
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_VERTICAL_POSITION_CONTROL_MODE = 1,
|
||||
|
||||
/**
|
||||
* @brief Set the control-mode to directly control the thrust
|
||||
* @note Range: 0% to 100%
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_VERTICAL_THRUST_CONTROL_MODE = 2,
|
||||
} E_DjiFlightControllerVerticalControlMode;
|
||||
|
||||
/**
|
||||
* @brief Yaw control mode in joystick mode enum
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* @brief Set the control-mode to control yaw angle.
|
||||
* @note Yaw angle is referenced to the ground frame.In this control mode, Ground frame is enforced in Autopilot.
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_YAW_ANGLE_CONTROL_MODE = 0x00,
|
||||
|
||||
/**
|
||||
* @brief Set the control-mode to control yaw angular velocity
|
||||
* @note Same reference frame as YAW_ANGLE.
|
||||
* Limit: -150deg/s to 150 deg/s
|
||||
*/
|
||||
DJI_FLIGHT_CONTROLLER_YAW_ANGLE_RATE_CONTROL_MODE = 1
|
||||
} E_DjiFlightControllerYawControlMode;
|
||||
|
||||
/**
|
||||
* @brief Horizontal coordinate in joystick mode enum
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_GROUND_COORDINATE = 0, /*!< Set the x-y of ground frame as the horizontal frame (NEU) */
|
||||
DJI_FLIGHT_CONTROLLER_HORIZONTAL_BODY_COORDINATE = 1 /*!< Set the x-y of body frame as the horizontal frame (FRU) */
|
||||
} E_DjiFlightControllerHorizontalCoordinate;
|
||||
|
||||
/*!
|
||||
* @brief Stable mode in joystick mode enum.
|
||||
* @note Only works in Horizontal velocity control mode.In velocity stable mode, drone will brake and hover at one position once
|
||||
* the input command is zero.In velocity non-stable mode, drone will follow the velocity command and not hover when the command is zero.
|
||||
* That means drone will drift with the wind.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_DISABLE = 0, /*!< Disable the stable mode */
|
||||
DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_ENABLE = 1 /*!< Enable the stable mode */
|
||||
} E_DjiFlightControllerStableControlMode;
|
||||
|
||||
typedef enum {
|
||||
DJI_FLIGHT_CONTROLLER_ENABLE_RC_LOST_ACTION = 0,
|
||||
DJI_FLIGHT_CONTROLLER_DISABLE_RC_LOST_ACTION = 1,
|
||||
} E_DjiFlightControllerRCLostActionEnableStatus;
|
||||
|
||||
/**
|
||||
* @brief Joystick mode.
|
||||
* @note You need to set joystick mode first before start to send joystick command to aircraft.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiFlightControllerHorizontalControlMode horizontalControlMode; /*!< See reference of E_DjiFlightControllerHorizontalControlMode*/
|
||||
E_DjiFlightControllerVerticalControlMode verticalControlMode; /*!< See reference of E_DjiFlightControllerVerticalControlMode*/
|
||||
E_DjiFlightControllerYawControlMode yawControlMode; /*!< See reference of E_DjiFlightControllerYawControlMode*/
|
||||
E_DjiFlightControllerHorizontalCoordinate horizontalCoordinate; /*!< See reference of E_DjiFlightControllerHorizontalCoordinate*/
|
||||
E_DjiFlightControllerStableControlMode stableControlMode; /*!< See reference of E_DjiFlightControllerStableControlMode*/
|
||||
} T_DjiFlightControllerJoystickMode;
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
dji_f32_t x; /*!< Control with respect to the x axis.*/
|
||||
dji_f32_t y; /*!< Control with respect to the y axis.*/
|
||||
dji_f32_t z; /*!< Control with respect to the z axis, up is positive. */
|
||||
dji_f32_t yaw; /*!< Yaw position/velocity control w.r.t. the ground frame.*/
|
||||
} T_DjiFlightControllerJoystickCommand;// pack(1)
|
||||
|
||||
typedef struct {
|
||||
dji_f64_t latitude; /*!< unit: rad */
|
||||
dji_f64_t longitude; /*!< unit: rad */
|
||||
} T_DjiFlightControllerHomeLocation; // pack(1)
|
||||
|
||||
typedef struct {
|
||||
char serialNum[32];
|
||||
} T_DjiFlightControllerGeneralInfo;
|
||||
#pragma pack()
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise flight controller module, and user should call this function
|
||||
* before using flight controller features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_Init(void);
|
||||
|
||||
/**
|
||||
* @brief DeInitialise flight controller module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_Deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable RTK position function.
|
||||
* @details Enabling RTK means that RTK data will be used instead of GPS during flight.
|
||||
* @param rtkEnableStatus: see reference of "E_DjiFlightControllerRtkPositionEnableStatus".
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode
|
||||
DjiFlightController_SetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionEnableStatus rtkEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get RTK enable status.
|
||||
* @note Enabling RTK means that RTK data will be used during intelligent flight.
|
||||
* @param rtkEnableStatus: see reference of "E_DjiFlightControllerRtkPositionEnableStatus".
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode
|
||||
DjiFlightController_GetRtkPositionEnableStatus(E_DjiFlightControllerRtkPositionEnableStatus *rtkEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Set rc lost action.
|
||||
* @note It will be valid when rc and osdk is both lost.It only support M30.
|
||||
* @param rcLostAction: actions when rc is lost.(hover/landing/go home).It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetRCLostAction(E_DjiFlightControllerRCLostAction rcLostAction);
|
||||
|
||||
/**
|
||||
* @brief Get rc lost action(hover/landing/gohome).
|
||||
* @note It will be valid when rc and osdk is both lost.It only support M30.
|
||||
* @param rcLostAction: see reference of E_DjiFlightControllerRCLostAction.It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetRCLostAction(E_DjiFlightControllerRCLostAction *rcLostAction);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable horizontal visual(forwards,backwards,left,right) obstacle avoidance.
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get status of horizontal visual(forwards,backwards,left,right) obstacle avoidance switch.
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable horizontal radar obstacle avoidance.
|
||||
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
|
||||
* it is recommended to read the official user manual in https://www.dji.com/uk/matrice-300/downloads.
|
||||
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get status of horizontal radar obstacle avoidance switch.
|
||||
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
|
||||
* it is recommended to read the official user manual in https://www.dji.com/uk/matrice-300/downloads.
|
||||
* @param horizontalObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable upwards visual obstacle avoidance.
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get status of upwards visual obstacle avoidance switch.
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable upwards radar obstacle avoidance.
|
||||
* @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle avoidance,
|
||||
* it is recommended to read the official user manual in https://www.dji.com.
|
||||
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get status of upwards radar obstacle avoidance switch
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param upwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Enable/Disable downwards visual obstacle avoidance
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param downwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus downwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Get status of downwards visual obstacle avoidance switch
|
||||
* @note For detailed parameters of obstacle avoidance, it is recommended to read the official user manual in
|
||||
* https://www.dji.com.
|
||||
* @param downwardsObstacleAvoidanceEnableStatus: see reference of E_DjiFlightControllerObstacleAvoidanceEnableStatus.
|
||||
* It keeps in sync with pilot's param.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus(
|
||||
E_DjiFlightControllerObstacleAvoidanceEnableStatus *downwardsObstacleAvoidanceEnableStatus);
|
||||
|
||||
/**
|
||||
* @brief Arrest flying.
|
||||
* @note when the UAV is on the ground ,it will stop motors and display "hms description" on APP. when the UAV is
|
||||
* in the air, it will continue flying and display "hms description" on APP only.
|
||||
* If you use this interface, you need to use "DjiFlightController_CancelArrestFlying" to quit arrest-flying status, then
|
||||
* then the UAV can fly again.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_ArrestFlying(void);
|
||||
|
||||
/**
|
||||
* @brief Quit status of arrest-flying.
|
||||
* @note The UAV need to quit status of arrest-flying to continue flying after arresting flying.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_CancelArrestFlying(void);
|
||||
|
||||
/**
|
||||
* @brief Turn on motors when the UAV is on the ground.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_TurnOnMotors(void);
|
||||
|
||||
/**
|
||||
* @brief Turn off motors when the UAV is on the ground.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_TurnOffMotors(void);
|
||||
|
||||
/**
|
||||
* @brief Emergency stop motor in any case.
|
||||
* @note If you want to turn on motor after emergency stopping motor, you need to use the interface to send disable
|
||||
* command to quit lock-motor status.
|
||||
* @param cmd: see reference of E_DjiFlightControllerEmergencyStopMotor
|
||||
* @param debugMsg:inject debug message to flight control FW for logging, size limit: 10 bytes
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_EmergencyStopMotor(E_DjiFlightControllerEmergencyStopMotor cmd,
|
||||
char debugMsg[EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH]);
|
||||
/**
|
||||
* @brief Request take off action when the UAV is on the ground.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartTakeoff(void);
|
||||
|
||||
/**
|
||||
* @brief Request landing action when the UAV is in the air.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartLanding(void);
|
||||
|
||||
/**
|
||||
* @brief Request cancel landing action when the UAV is landing
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_CancelLanding(void);
|
||||
|
||||
/**
|
||||
* @brief Confirm the landing when the UAV is 0.7m above the ground.
|
||||
* @note When the clearance between the aircraft and the ground is less than 0.7m, the aircraft will pause landing and
|
||||
* wait for user's confirmation.This api use for confirm landing. If the ground is not suitable for landing ,user must
|
||||
* use RC to control it landing manually or force landing.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartConfirmLanding(void);
|
||||
|
||||
/**
|
||||
* @brief Force landing in any case.
|
||||
* @note This api will ignore the smart landing function,.When using this pi, it will landing directly (would not stop
|
||||
* at 0.7m and wait user's command). Attention:it may make the aircraft crash!!!
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartForceLanding(void);
|
||||
|
||||
/**
|
||||
* @brief Set customized GPS(not RTK) home location.
|
||||
* @note Set customized home location failed reason may as follows:
|
||||
* 1. The distance between new home location and last home location is larger than MAX_FLY_RADIUS(20km).
|
||||
* 2. Record initial home location failed after start aircraft.
|
||||
* @param homeLocation: homeLocation include latitude and longitude
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetHomeLocationUsingGPSCoordinates(T_DjiFlightControllerHomeLocation homeLocation);
|
||||
|
||||
/**
|
||||
* @brief Set home location using current aircraft GPS(not RTK) location.
|
||||
* @note Set home location failed reasons may as follows:
|
||||
* 1. Aircraft's gps level can't reach the condition of recording home location.
|
||||
* 2. Record initial home location failed after start aircraft.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation(void);
|
||||
|
||||
/**
|
||||
* @brief Set go home altitude.
|
||||
* @note If aircraft's current altitude is higher than the setting value of go home altitude, aircraft will go home
|
||||
* using current altitude. Otherwise, it will climb to setting of go home altitude ,and then execute go home action.
|
||||
* Go home altitude setting is 20m ~ 500m.
|
||||
* @param altitude: go home altitude, unit: meter
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_SetGoHomeAltitude(E_DjiFlightControllerGoHomeAltitude altitude);
|
||||
|
||||
/**
|
||||
* @brief Get go home altitude.
|
||||
* @param altitude: go home altitude, unit: meter
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetGoHomeAltitude(E_DjiFlightControllerGoHomeAltitude *altitude);
|
||||
|
||||
/**
|
||||
* @brief Request go home action when the UAV is in the air
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_StartGoHome(void);
|
||||
|
||||
/**
|
||||
* @brief Request cancel go home action when the UAV is going home
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_CancelGoHome(void);
|
||||
|
||||
/**
|
||||
* @brief Obtain UAV's joystick control authority.
|
||||
* @note 1.You have to obtain joystick control authority successfully before you using joystick to control UAV.
|
||||
* 2. RC must be in p-mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_ObtainJoystickCtrlAuthority(void);
|
||||
|
||||
/**
|
||||
* @brief Release UAV's joystick control authority.
|
||||
* @note RC must be in p-mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_ReleaseJoystickCtrlAuthority(void);
|
||||
|
||||
/**
|
||||
* @brief Subscribe to joystick control authority switch event with a callback function.
|
||||
* @note it will be triggered once the joystick control authority switch event occurs.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_RegJoystickCtrlAuthorityEventCallback(JoystickCtrlAuthorityEventCbFunc callback);
|
||||
|
||||
/**
|
||||
* @brief Set expected joystick mode before requesting joystick.
|
||||
* @param joystickMode: include horizontal/vertical/yaw control mode, stable control mode.
|
||||
*/
|
||||
void DjiFlightController_SetJoystickMode(T_DjiFlightControllerJoystickMode joystickMode);
|
||||
|
||||
/**
|
||||
* @brief Request execute joystick action.
|
||||
* @param joystickCommand: include x/y/z/yaw.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_ExecuteJoystickAction(T_DjiFlightControllerJoystickCommand joystickCommand);
|
||||
|
||||
/**
|
||||
* @brief Request emergency brake action.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_ExecuteEmergencyBrakeAction(void);
|
||||
|
||||
/**
|
||||
* @brief Request cancel emergency brake action.
|
||||
* @note It is only support on M30.If you use DjiFlightController_ExecuteEmergencyBrakeAction(), you need to use
|
||||
* "DjiFlightController_CancelEmergencyBrakeAction()" to allow aircraft to execute drone action again.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_CancelEmergencyBrakeAction(void);
|
||||
|
||||
/**
|
||||
* @brief Get general info of the aircraft.
|
||||
* @param generalInfo: the struct stored the serial num which contains a array of chars var in case the user gives an
|
||||
* illegal length character pointer
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiFlightController_GetGeneralInfo(T_DjiFlightControllerGeneralInfo *generalInfo);
|
||||
|
||||
/*! @brief The command decides whether execute RC lost action or not when osdk is running
|
||||
* @note This setting only affects the behavior of the drone when the RC lost and the OSDK is connected.
|
||||
* if the command is enable, the drone will not execute rc lost action when rc is lost but OSDK is running;
|
||||
* if the command is disable, the drone will execute rc lost action when rc is lost but OSDK is running
|
||||
* the drone will execute rc lost action when rc is lost and OSDK is lost whatever the command is.
|
||||
* default command is disable.
|
||||
* @param executeRCLostActionOrNotWhenOnboardOn enable:1;disable:0
|
||||
* @return T_DjiReturnCode error code
|
||||
*/
|
||||
T_DjiReturnCode
|
||||
DjiFlightController_SetRCLostActionEnableStatus(E_DjiFlightControllerRCLostActionEnableStatus command);
|
||||
|
||||
/*! @brief get rc lost action enable status(enable or disable)
|
||||
* @param command executeRCLostActionOrNotWhenOnboardOn, enable:1;disable:0
|
||||
* @return T_DjiReturnCode error code
|
||||
*/
|
||||
T_DjiReturnCode
|
||||
DjiFlightController_GetEnableRCLostActionStatus(E_DjiFlightControllerRCLostActionEnableStatus *command);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_FLIGHT_CONTROLLER_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
316
PSDK/psdk_lib/include/dji_gimbal.h
Normal file
316
PSDK/psdk_lib/include/dji_gimbal.h
Normal file
@ -0,0 +1,316 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_gimbal.h
|
||||
* @brief DJI gimbal module is used to achieve the third gimbal for developer. The module can be used only when the DJI
|
||||
* 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 DJI_GIMBAL_H
|
||||
#define DJI_GIMBAL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Gimbal calibration stage and result.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_GIMBAL_CALIBRATION_STAGE_COMPLETE = 0, /*!< Calibration have been completed and the result is successful. */
|
||||
DJI_GIMBAL_CALIBRATION_STAGE_PROCRESSING = 1, /*!< Gimbal is calibrating. */
|
||||
DJI_GIMBAL_CALIBRATION_STAGE_FAILED = 3, /*!< Calibration have been completed and the result is failure. */
|
||||
} E_DjiGimbalCalibrationStage;
|
||||
|
||||
/**
|
||||
* @brief Axis of gimbal.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_GIMBAL_AXIS_PITCH = 0, /*!< Pitch axis. */
|
||||
DJI_GIMBAL_AXIS_ROLL = 1, /*!< Roll axis. */
|
||||
DJI_GIMBAL_AXIS_YAW = 2, /*!< Yaw axis. */
|
||||
} E_DjiGimbalAxis;
|
||||
|
||||
/**
|
||||
* @brief Reset mode of gimbal.
|
||||
*/
|
||||
typedef enum {
|
||||
/*! 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. */
|
||||
DJI_GIMBAL_RESET_MODE_YAW = 1,
|
||||
/*! 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. */
|
||||
DJI_GIMBAL_RESET_MODE_PITCH_AND_YAW = 3,
|
||||
/*! 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. */
|
||||
DJI_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD_AND_YAW = 11,
|
||||
/*! 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. */
|
||||
DJI_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD = 12,
|
||||
} E_DjiGimbalResetMode;
|
||||
|
||||
/**
|
||||
* @brief Smooth factor of gimbal controller.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t pitch; /*!< Smooth factor of pitch axis, range from 0 to 30. */
|
||||
uint8_t yaw; /*!< Smooth factor of yaw axis, range from 0 to 30. */
|
||||
} T_DjiGimbalControllerSmoothFactor;
|
||||
|
||||
/**
|
||||
* @brief Max speed percentage of every axis of gimbal.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t pitch; /*!< Max speed percentage of pitch axis, range from 1 to 100. */
|
||||
uint8_t yaw; /*!< Max speed percentage of yaw axis, range from 1 to 100. */
|
||||
} T_DjiGimbalControllerMaxSpeedPercentage;
|
||||
|
||||
/**
|
||||
* @brief Data structure describes gimbal system state.
|
||||
*/
|
||||
typedef struct {
|
||||
bool resettingFlag; /*!< Specifies whether gimbal is resetting now or not. */
|
||||
bool mountedUpward; /*!< Specifies whether gimbal is upward or not. */
|
||||
bool blockingFlag; /*!< Specifies whether gimbal is stuck or not. */
|
||||
bool pitchRangeExtensionEnabledFlag; /*!< Specifies whether extended angle range of gimbal pitch axis is enabled or not. */
|
||||
E_DjiGimbalMode gimbalMode; /*!< Gimbal mode. */
|
||||
T_DjiAttitude3d fineTuneAngle; /*!< Fine tune angles, unit: 0.1 degree. */
|
||||
T_DjiGimbalControllerSmoothFactor smoothFactor; /*!< Smooth factor of gimbal controller. */
|
||||
T_DjiGimbalControllerMaxSpeedPercentage maxSpeedPercentage; /*!< Max speed percentage of gimbal controller. */
|
||||
} T_DjiGimbalSystemState;
|
||||
|
||||
/**
|
||||
* @brief Reach limit flag.
|
||||
*/
|
||||
typedef struct {
|
||||
bool pitch; /*!< Specifies whether gimbal has reached angle limit of pitch axis, if true, reached the limit. */
|
||||
bool roll; /*!< Specifies whether gimbal has reached angle limit of roll axis, if true, reached the limit. */
|
||||
bool yaw; /*!< Specifies whether gimbal has reached angle limit of yaw axis, if true, reached the limit. */
|
||||
} T_DjiGimbalReachLimitFlag;
|
||||
|
||||
/**
|
||||
* @brief Gimbal attitude related information.
|
||||
*/
|
||||
typedef struct {
|
||||
T_DjiAttitude3d attitude; /*!< Gimbal attitude in the ground coordinate, unit: 0.1 degree. */
|
||||
T_DjiGimbalReachLimitFlag reachLimitFlag; /*!< Reach limit flag, being set when the joint angles of gimbal reach limits. */
|
||||
} T_DjiGimbalAttitudeInformation;
|
||||
|
||||
/**
|
||||
* @brief Gimbal calibration state.
|
||||
*/
|
||||
typedef struct {
|
||||
bool calibratingFlag; /*!< Specifies whether gimbal is calibrating now or not. */
|
||||
bool lastCalibrationResult; /*!< Result of the last calibration, and true specifies success. */
|
||||
uint8_t currentCalibrationProgress; /*!< Progress percentage of current calibration. If gimbal is calibrating now and fill in real progress percentage, if not, fill in zero. The item ranges from 0 to 100. */
|
||||
E_DjiGimbalCalibrationStage currentCalibrationStage; /*!< Current calibration stage and result. If gimbal is calibrating now and fill in ::DJI_GIMBAL_CALIBRATION_STAGE_PROCRESSING, if not, fill in result of the last calibration. */
|
||||
} T_DjiGimbalCalibrationState;
|
||||
|
||||
/**
|
||||
* @brief Gimbal rotation command property.
|
||||
*/
|
||||
typedef struct {
|
||||
struct {
|
||||
bool pitch; /*!< Specifies whether ignore rotation command of pitch axis, and true specifies ignoring. */
|
||||
bool roll; /*!< Specifies whether ignore rotation command of roll axis, and true specifies ignoring. */
|
||||
bool yaw; /*!< Specifies whether ignore rotation command of yaw axis, and true specifies ignoring. */
|
||||
} rotationValueInvalidFlag; /*!< Specifies whether ignore rotation command of some axis, including pitch, roll and yaw. */
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint16_t actionTime; /*!< Action time during which gimbal move to target angles, unit: 0.01s. */
|
||||
} relativeAngleRotation; /*!< Property of relative angle rotation command. */
|
||||
struct {
|
||||
uint16_t actionTime; /*!< Action time during which gimbal move to target angles, unit: 0.01s. */
|
||||
/*! Joint angle valid flag, specifying whether
|
||||
* T_DjiGimbalRotationProperty::absoluteAngleRotation::jointAngle is valid when absolute angle control. */
|
||||
bool jointAngleValid;
|
||||
/*! Joint angles of gimbal, unit: 0.1 degree. If
|
||||
* T_DjiGimbalRotationProperty::absoluteAngleRotation::jointAngleValid is false, specifying here joint
|
||||
* angles are invalid, and please ignore the joint angles. If joint angles are valid, users should ensure
|
||||
* that target joint angles of gimbal is approximately the same as the specified value. */
|
||||
T_DjiAttitude3d jointAngle;
|
||||
} absoluteAngleRotation; /*!< Property of absolute angle rotation command. */
|
||||
};
|
||||
} T_DjiGimbalRotationProperty;
|
||||
|
||||
/**
|
||||
* @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 DJI
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/*!
|
||||
* @brief Prototype of callback function used to report system state of gimbal.
|
||||
* @param systemState: pointer to memory space used to store gimbal system state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetSystemState)(T_DjiGimbalSystemState *systemState);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to report attitude information of gimbal.
|
||||
* @param attitudeInformation: pointer to memory space used to store gimbal attitude information.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetAttitudeInformation)(T_DjiGimbalAttitudeInformation *attitudeInformation);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to report calibration state of gimbal.
|
||||
* @param calibrationState: pointer to memory space used to store gimbal calibration state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetCalibrationState)(T_DjiGimbalCalibrationState *calibrationState);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to rotate gimbal. Rotation callback function will be called when
|
||||
* other modules control gimbal.
|
||||
* @warning User should control execution time of the callback function to be short, because this callback function
|
||||
* may be called at very high frequency in some scenarios, just like 200Hz.
|
||||
* @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
|
||||
* ::DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE), 0.1 degree/s
|
||||
* (if rotation mode is ::DJI_GIMBAL_ROTATION_MODE_SPEED).
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*Rotate)(E_DjiGimbalRotationMode rotationMode, T_DjiGimbalRotationProperty rotationProperty,
|
||||
T_DjiAttitude3d rotationValue);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to start calibrating gimbal.
|
||||
* @note Maximum allowable time of gimbal calibration is 120s. If gimbal has not completed calibration during
|
||||
* 120s, DJI Pilot believe calibration failed.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartCalibrate)(void);
|
||||
|
||||
/**
|
||||
* @brief Set smooth factor for gimbal controller, using to smooth control.
|
||||
* @param smoothingFactor: smooth factor. The larger the value, the smaller the acceleration of gimbal. Recommended
|
||||
* calculation formula is "acc = 10000 * (0.8 ^ (1 + x)) deg/s^2", x is smooth factor. Range from 0 to 30.
|
||||
* @param axis: axis to be set.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetControllerSmoothFactor)(uint8_t smoothingFactor, E_DjiGimbalAxis axis);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to enable or disable extended pitch axis angle range.
|
||||
* @details Switching the gimbal limit euler angle of pitch axis to the extended limit angle or the default limit
|
||||
* angle.
|
||||
* @param enabledFlag: flag specified whether enable or disable extended pitch axis angle range.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetPitchRangeExtensionEnabled)(bool enabledFlag);
|
||||
|
||||
/**
|
||||
* @brief Set max speed percentage for gimbal controller.
|
||||
* @param maxSpeedPercentage: max speed value. Recommended calculation formula is "spd = default_max_spd * x / 100",
|
||||
* x is default max speed value. Range from 1 to 100.
|
||||
* @param axis: axis to be set.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetControllerMaxSpeedPercentage)(uint8_t maxSpeedPercentage, E_DjiGimbalAxis axis);
|
||||
|
||||
/**
|
||||
* @brief Restore factory settings of gimbal, including fine tune angle, pitch angle extension enable flag and max
|
||||
* speed etc.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*RestoreFactorySettings)(void);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to set gimbal work mode.
|
||||
* @param mode: gimbal work mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetMode)(E_DjiGimbalMode mode);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to reset gimbal.
|
||||
* @note Reset command will interrupt rotation process.
|
||||
* @param mode: Reset mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*Reset)(E_DjiGimbalResetMode mode);
|
||||
|
||||
/*!
|
||||
* @brief Prototype of callback function used to fine tune angle of gimbal.
|
||||
* @param fineTuneAngle: fine tune angle, unit: 0.1 degree. Angle value of greater than 0 specifies rotation
|
||||
* towards the positive direction of body coordinate.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*FineTuneAngle)(T_DjiAttitude3d fineTuneAngle);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to report rotation speed of gimbal.
|
||||
* @note The callback function will be called at 50 Hz. Developers should ensure that, the average rotation speed
|
||||
* of gimbal within 20 ms after the callback function is called is approximately equal to the reported rotation
|
||||
* speed.
|
||||
* @param rotationSpeed: pointer to memory space used to store rotation speed, in body coordinate, unit:
|
||||
* 0.1 degree/s.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetRotationSpeed)(T_DjiAttitude3d *rotationSpeed);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to report joint angle of gimbal.
|
||||
* @param jointAngle: pointer to memory space used to store joint angles, unit: 0.1 degree.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetJointAngle)(T_DjiAttitude3d *jointAngle);
|
||||
} T_DjiGimbalCommonHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise gimbal module, and user should call this function before using gimbal features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbal_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise gimbal module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbal_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_DjiReturnCode DjiGimbal_RegCommonHandler(const T_DjiGimbalCommonHandler *commonHandler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_GIMBAL_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
94
PSDK/psdk_lib/include/dji_gimbal_manager.h
Normal file
94
PSDK/psdk_lib/include/dji_gimbal_manager.h
Normal file
@ -0,0 +1,94 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_gimbal_manager.h
|
||||
* @brief This is the header file for "dji_gimbal_manager.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 DJI_GIMBAL_MANAGER_H
|
||||
#define DJI_GIMBAL_MANAGER_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Gimbal manager rotation command property.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiGimbalRotationMode rotationMode; /*!< Rotation gimbal mode. */
|
||||
dji_f32_t pitch; /*!< Pitch angle in degree, unit: deg */
|
||||
dji_f32_t roll; /*!< Roll angle in degree, unit: deg */
|
||||
dji_f32_t yaw; /*!< Yaw angle in degree, unit: deg */
|
||||
dji_f64_t time; /*!< Expect execution time of gimbal rotation, unit: second. */
|
||||
} T_DjiGimbalManagerRotation;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the gimbal manager module.
|
||||
* @note The interface initialization needs to be after DjiCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbalManager_Init(void);
|
||||
|
||||
/**
|
||||
* @brief DeInitialize the gimbal manager module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbalManager_Deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Set the work mode of the gimbal.
|
||||
* @param mountPosition: gimbal mount position, input limit see enum E_DjiMountPosition
|
||||
* @param mode: gimbal work mode, input limit see enum E_DjiGimbalMode
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbalManager_SetMode(E_DjiMountPosition mountPosition, E_DjiGimbalMode mode);
|
||||
|
||||
/**
|
||||
* @brief Reset the pitch and yaw of the gimbal.
|
||||
* @param mountPosition: gimbal mount position, input limit see enum E_DjiMountPosition
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbalManager_Reset(E_DjiMountPosition mountPosition);
|
||||
|
||||
/**
|
||||
* @brief Rotate the angle of the gimbal.
|
||||
* @param mountPosition: gimbal mount position, input limit see enum E_DjiMountPosition
|
||||
* @param rotation: the rotation parameters to be executed on the target gimbal, including the rotation mode, target
|
||||
* angle value and executed time, ref to T_DjiGimbalManagerRotation
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiGimbalManager_Rotate(E_DjiMountPosition mountPosition, T_DjiGimbalManagerRotation rotation);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_GIMBAL_MANAGER_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
103
PSDK/psdk_lib/include/dji_high_speed_data_channel.h
Normal file
103
PSDK/psdk_lib/include/dji_high_speed_data_channel.h
Normal file
@ -0,0 +1,103 @@
|
||||
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_high_speed_data_channel.h
|
||||
* @brief This is the header file for "dji_high_speed_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 DJI_HIGH_SPEED_DATA_CHANNEL_H
|
||||
#define DJI_HIGH_SPEED_DATA_CHANNEL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
uint8_t dataStream; /*!< Bandwidth proportion of data stream, range from 0 to 100. */
|
||||
uint8_t videoStream; /*!< Bandwidth proportion of video stream, range from 0 to 100. */
|
||||
uint8_t downloadStream; /*!< Bandwidth proportion of download stream, range from 0 to 100. */
|
||||
} T_DjiDataChannelBandwidthProportionOfHighspeedChannel;
|
||||
|
||||
/* 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_DjiReturnCode DjiHighSpeedDataChannel_SetBandwidthProportion(
|
||||
T_DjiDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion);
|
||||
|
||||
/**
|
||||
* @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_DjiReturnCode DjiHighSpeedDataChannel_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_DjiReturnCode DjiHighSpeedDataChannel_SendDataStreamData(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_DjiReturnCode DjiHighSpeedDataChannel_GetDataStreamState(T_DjiDataChannelState *state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_HIGH_SPEED_DATA_CHANNEL_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
80
PSDK/psdk_lib/include/dji_hms.h
Normal file
80
PSDK/psdk_lib/include/dji_hms.h
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_hms.h
|
||||
* @brief This is the header file for "dji_hms.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 DJI_HMS_H
|
||||
#define DJI_HMS_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
uint32_t errorCode;
|
||||
uint8_t componentIndex;
|
||||
uint8_t errorLevel;
|
||||
} T_DjiHmsInfo;
|
||||
|
||||
typedef struct {
|
||||
T_DjiHmsInfo *hmsInfo;
|
||||
uint32_t hmsInfoNum;
|
||||
} T_DjiHmsInfoTable;
|
||||
|
||||
typedef T_DjiReturnCode (*DjiHmsInfoCallback)(T_DjiHmsInfoTable hmsInfoTable);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise hms module, and user should call this function
|
||||
* before using hms features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiHms_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise hms module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiHms_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback to get hms info.
|
||||
* @note: Data is pushed with a frequency of 1Hz.
|
||||
* @param callback: see reference of DjiHmsInfoCallback.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiHms_RegHmsInfoCallback(DjiHmsInfoCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_HMS_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
733
PSDK/psdk_lib/include/dji_hms_info_table.h
Normal file
733
PSDK/psdk_lib/include/dji_hms_info_table.h
Normal file
@ -0,0 +1,733 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_hms_info_table.h
|
||||
* @brief This is the header file for "dji_hms_info_table.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 DJI_HMS_INFO_TABLE_H
|
||||
#define DJI_HMS_INFO_TABLE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
uint32_t alarmId; /*! error code*/
|
||||
const char *groundAlarmInfo; /*! alarm information when the flight is on the ground*/
|
||||
const char *flyAlarmInfo; /*! alarm information when the flight is in the air*/
|
||||
} T_DjiHmsErrCodeInfo;
|
||||
|
||||
/*! HMS's error code table*/
|
||||
const T_DjiHmsErrCodeInfo hmsErrCodeInfoTbl[] = {
|
||||
{0x16070035, "Aircraft D-RTK antenna error. Fly with caution", ""},
|
||||
{0x16070034, "RTK flight heading inconsistent with other sources. Fly with caution", ""},
|
||||
{0x16070033, "D-RTK mobile station moved. Check mobile station and restart aircraft", ""},
|
||||
{0x16070032, "D-RTK mobile station detached. Check mobile station and restart aircraft", ""},
|
||||
{0x16070031, "D-RTK mobile station switched signal source. Restart aircraft", ""},
|
||||
{0x16070030, "RTK firmware version does not match. Update required", ""},
|
||||
{0x16070029, "RTK position data changed slightly while aircraft was stationary. Restart aircraft", ""},
|
||||
{0x16070028, "RTK and GPS positions do not match. Restart aircraft", ""},
|
||||
{0x16070027, "RTK and sensor altitude data inconsistent. Restart aircraft", ""},
|
||||
{0x16070026, "Sudden RTK position data change. Restart aircraft", ""},
|
||||
{0x16070025, "Unable to refresh RTK position data. Restart aircraft", ""},
|
||||
{0x16070024, "RTK data error. Fly with caution", ""},
|
||||
{0x16070023, "RTK data refresh frequency error. Fly with caution", ""},
|
||||
{0x16070021, "RTK data error. Restart aircraft", ""},
|
||||
{0x16070020, "RTK data not received by aircraft. Restart aircraft", ""},
|
||||
{0x1a010040, "Downward-left vision sensor connection error", ""},
|
||||
{0x1a010041, "Downward-right vision sensor connection error", ""},
|
||||
{0x1a010042, "Forward-left vision sensor connection error", ""},
|
||||
{0x1a010043, "Forward-right vision sensor connection error", ""},
|
||||
{0x1a010044, "Backward-left vision sensor connection error", ""},
|
||||
{0x1a010045, "Backward-right vision sensor connection error", ""},
|
||||
{0x1a010046, "Upward-left vision sensor connection error", ""},
|
||||
{0x1a010047, "Upward-right vision sensor connection error", ""},
|
||||
{0x1a010048, "Left-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a010049, "Left-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a01004a, "Right-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a01004b, "Right-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a010080, "Downward-left vision sensor connection error ", ""},
|
||||
{0x1a010081, "Downward-right vision sensor connection error", ""},
|
||||
{0x1a010082, "Forward-left vision sensor connection error ", ""},
|
||||
{0x1a010083, "Forward-right vision sensor connection error ", ""},
|
||||
{0x1a010084, "Backward-left vision sensor connection error ", ""},
|
||||
{0x1a010085, "Backward-right vision sensor connection error", ""},
|
||||
{0x1a010086, "Upward-left vision sensor connection error ", ""},
|
||||
{0x1a010087, "Upward-right vision sensor connection error", ""},
|
||||
{0x1a010088, "Left-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a010089, "Left-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a01008a, "Right-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a01008b, "Right-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a0100c0, "Downward-left vision sensor connection error ", ""},
|
||||
{0x1a0100c1, "Downward-right vision sensor connection error", ""},
|
||||
{0x1a0100c2, "Forward-left vision sensor connection error ", ""},
|
||||
{0x1a0100c3, "Forward-right vision sensor connection error ", ""},
|
||||
{0x1a0100c4, "Backward-left vision sensor connection error ", ""},
|
||||
{0x1a0100c5, "Backward-right vision sensor connection error", ""},
|
||||
{0x1a0100c6, "Upward-left vision sensor connection error ", ""},
|
||||
{0x1a0100c7, "Upward-right vision sensor connection error", ""},
|
||||
{0x1a0100c8, "Left-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a0100c9, "Left-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a0100ca, "Right-front vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a0100cb, "Right-rear vision sensor connection error. Fly with caution", ""},
|
||||
{0x1a020040, "Downward infrared sensor connection error", ""},
|
||||
{0x1a020041, "Forward infrared sensor connection error", ""},
|
||||
{0x1a020042, "Right infrared sensor connection error", ""},
|
||||
{0x1a020043, "Backward infrared sensor connection error", ""},
|
||||
{0x1a020044, "Left infrared sensor connection error", ""},
|
||||
{0x1a020045, "Upward infrared sensor connection error", ""},
|
||||
{0x1a020080, "Downward Infrared Sensor Connection Error", ""},
|
||||
{0x1a020081, "Forward infrared sensor connection error", ""},
|
||||
{0x1a020082, "Right infrared sensor connection error", ""},
|
||||
{0x1a020083, "Backward infrared sensor connection error", ""},
|
||||
{0x1a020084, "Left infrared sensor connection error", ""},
|
||||
{0x1a020085, "Upward infrared sensor connection error", ""},
|
||||
{0x1a0200c0, "Downward Infrared Sensor Connection Error", ""},
|
||||
{0x1a0200c1, "Forward infrared sensor connection error", ""},
|
||||
{0x1a0200c2, "Right infrared sensor connection error", ""},
|
||||
{0x1a0200c3, "Backward infrared sensor connection error", ""},
|
||||
{0x1a0200c4, "Left infrared sensor connection error", ""},
|
||||
{0x1a0200c5, "Upward infrared sensor connection error", ""},
|
||||
{0x1a020100, "Downward infrared sensor calibration error", ""},
|
||||
{0x1a020101, "Forward infrared sensor calibration error", ""},
|
||||
{0x1a020102, "Right infrared sensor calibration error", ""},
|
||||
{0x1a020103, "Backward infrared sensor calibration error", ""},
|
||||
{0x1a020104, "Left infrared sensor calibration error", ""},
|
||||
{0x1a020105, "Upward infrared sensor calibration error", ""},
|
||||
{0x1a020140, "Infrared sensors blocked", ""},
|
||||
{0x1a310980, "Vision positioning system error", ""},
|
||||
{0x1a310981, "Vision positioning system error", ""},
|
||||
{0x1a420040, "Downward obstacle sensing system error", ""},
|
||||
{0x1a420041, "Forward obstacle sensing system error", ""},
|
||||
{0x1a420042, "Right obstacle sensing system error", ""},
|
||||
{0x1a420043, "Backward obstacle sensing system error", ""},
|
||||
{0x1a420044, "Left obstacle sensing system error", ""},
|
||||
{0x1a420045, "Upward obstacle sensing system error", ""},
|
||||
{0x1a420440, "Obstacle sensing system error", ""},
|
||||
{0x1a4205c0, "Obstacle sensing system error", ""},
|
||||
{0x1a420680, "Obstacle sensing system error", ""},
|
||||
{0x1a510380, "Downward vision sensor calibration error", ""},
|
||||
{0x1a510381, "Forward vision sensor calibration error", ""},
|
||||
{0x1a510382, "Backward vision sensor calibration error", ""},
|
||||
{0x1a510383, "Upward vision sensor calibration error", ""},
|
||||
{0x1a510384, "Left vision sensor calibration error", ""},
|
||||
{0x1a510385, "Right vision sensor calibration error", ""},
|
||||
{0x1a5103c0, "Downward vision sensor calibration error", ""},
|
||||
{0x1a5103c1, "Forward vision sensor calibration error", ""},
|
||||
{0x1a5103c2, "Backward vision sensor calibration error", ""},
|
||||
{0x1a5103c3, "Upward vision sensor calibration error", ""},
|
||||
{0x1a5103c4, "Left vision sensor calibration error", ""},
|
||||
{0x1a5103c5, "Right vision sensor calibration error", ""},
|
||||
{0x1a020180, "Infrared sensors overheated. Return to home or land promptly. Move away from high-temperature environment", ""},
|
||||
{0x1a420bc0, "Downward ambient light too low. Obstacle avoidance unavailable. Fly with caution", ""},
|
||||
{0x1a420bc1, "Forward ambient light too low. Obstacle avoidance unavailable. Fly with caution", ""},
|
||||
{0x1a420bc2, "Backward ambient light too low. Backward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420bc3, "Rightward ambient light too low. Rightward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420bc4, "Leftward ambient light too low. Leftward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420bc5, "Upward ambient light too low. Upward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420bc6, "Horizontal ambient light too low. Horizontal obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c00, "Downward ambient light too bright. Downward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c01, "Forward ambient light too bright. Forward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c02, "Backward ambient light too bright. Backward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c03, "Rightward ambient light too bright. Rightward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c04, "Leftward ambient light too bright. Leftward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c05, "Upward ambient light too bright. Upward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c06, "Horizontal ambient light too bright. Horizontal obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c40, "Downward sensor(s) blocked. Downward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c41, "Forward sensor(s) blocked. Forward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c42, "Backward sensor(s) blocked. Backward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c43, "Rightward sensor(s) blocked. Rightward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c44, "Leftward sensor(s) blocked. Leftward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c45, "Upward sensor(s) blocked. Upward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c80, "Downward sensor(s) blurry. Downward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c81, "Forward sensor(s) blurry. Forward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c82, "Backward sensor(s) blurry. Backward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c83, "Right sensor(s) blurry. Rightward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c84, "Left sensor(s) blurry. Leftward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420c85, "Upward sensor(s) blurry. Upward obstacle avoidance unavailable. Only infrared sensors available. Fly with caution", ""},
|
||||
{0x1a420cc0, "Aircraft attitude angle too large. Obstacle avoidance unavailable. Fly with caution", ""},
|
||||
{0x1a420d00, "Aircraft attitude angle too large. Landing protection unavailable. Land manually", ""},
|
||||
{0x1a420d40, "Aircraft approaching obstacle sensing blind spot and may be unable to detect obstacles. Fly with caution", ""},
|
||||
{0x1afe0040, "Vision system overloaded. Fly to open area", ""},
|
||||
{0x11000020, "Gimbal %index payload voltage too high", ""},
|
||||
{0x11000021, "Gimbal %index payload voltage too low", ""},
|
||||
{0x11000022, "Gimbal %index battery module overheated", ""},
|
||||
{0x11000023, "Gimbal %index battery module temperature too low", ""},
|
||||
{0x11000024, "Total payload power too high", ""},
|
||||
{0x11000025, "Gimbal %index payload transmission error", ""},
|
||||
{0x11000029, "OSDK voltage too high", ""},
|
||||
{0x1100002a, "OSDK voltage too low", ""},
|
||||
{0x1100002b, "OSDK battery module overheated", ""},
|
||||
{0x1100002c, "OSDK battery module temperature too low", ""},
|
||||
{0x1100002d, "Total payload power too high", ""},
|
||||
{0x16010001, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010005, "Sensor system initializing. Wait for initialization to complete", "Sensor system error. Return to home or land"},
|
||||
{0x16010007, "Sensor system error. Land promptly", "Sensor system error. Return to home or land"},
|
||||
{0x1601000a, "Sensor system initializing. Wait for initialization to complete", "Sensor system error. Return to home or land"},
|
||||
{0x1601000d, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010010, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010016, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010019, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010041, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010032, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1601002f, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010013, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1601001c, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1601001f, "Sensor system error. Restart aircraft", "Not Applicable. This string has been deleted"},
|
||||
{0x16010022, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010025, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16010028, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1601002b, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x16020001, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16020004, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16020007, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x1602000a, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x1602000d, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16020016, "IMU bias too large. Calibrate IMU", "IMU error. Return to home or land"},
|
||||
{0x1602002a, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16020027, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16030004, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16030007, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x1603000d, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16030016, "IMU bias too large. Calibrate IMU", "IMU error. Return to home or land"},
|
||||
{0x16030001, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16030013, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x1603000a, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16030010, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x1603001c, "IMU error. Restart aircraft", "IMU error. Return to home or land"},
|
||||
{0x16040001, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040004, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040007, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x1604000a, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040010, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040013, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040016, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16040019, "Barometer error. Restart aircraft", "Barometer error. Return to home or land"},
|
||||
{0x16050019, "GPS error. Restart aircraft", "GPS error. Return to home or land"},
|
||||
{0x16050001, "GPS error. Restart aircraft", "GPS error. Return to home or land"},
|
||||
{0x16050004, "GPS error. Restart aircraft", "GPS error. Return to home or land"},
|
||||
{0x1605001c, "GPS error. Restart aircraft", "GPS error. Return to home or land"},
|
||||
{0x16060001, "Compass error. Restart aircraft", "Compass error. Return to home or land"},
|
||||
{0x16060007, "Compass error. Restart aircraft", "Compass error. Return to home or land"},
|
||||
{0x1606000a, "Compass error. Restart aircraft", "Compass error. Return to home or land"},
|
||||
{0x1606000d, "Compass interference. Calibrate compass", "Compass interference. Move aircraft away from interference source"},
|
||||
{0x16060010, "Compass interference. Calibrate compass", "Compass interference. Move aircraft away from interference source"},
|
||||
{0x16100001, "Compass error. Unable to take off. Restart aircraft", "Compass error. Return to home or land"},
|
||||
{0x16100002, "DJI Assistant connected. Unable to take off. Disconnect before taking off", "DJI Assistant connected. Disconnect before taking off"},
|
||||
{0x16100003, "Aircraft not activated or firmware out-of-date. Unable to take off. Activate aircraft or update to latest firmware version", "Device activation or firmware update required"},
|
||||
{0x16100006, "Invalid IMU serial number. Unable to take off. Maintenance required", "Invalid IMU serial number. Return to home or land"},
|
||||
{0x16100008, "Compass calibrating. Unable to take off. Wait for calibration to complete before taking off(%alarmid)", "Compass calibrating. Wait for calibration to complete before taking off"},
|
||||
{0x16100009, "Sensor system initializing. Unable to take off. Wait for initialization to complete before taking off", "Sensor system initializing. Return to home or land"},
|
||||
{0x1610000a, "Aircraft in Beginner mode. Unable to take off. Take off in an open outdoor area when in Beginner mode", "Beginner mode enabled. When using Beginner mode, take off in an open, outdoor area"},
|
||||
{0x1610000b, "Battery cell error. Unable to take off. Contact DJI Support", "Battery cell error. Return to home or land"},
|
||||
{0x1610000c, "Battery communication error. Unable to take off. Reinstall battery", "Battery communication error. Return to home"},
|
||||
{0x1610000d, "Critical low battery voltage. Unable to take off. Charge promptly", "Critical low battery voltage. Return to home or land promptly"},
|
||||
{0x1610000e, "Critical low battery. Unable to take off. Charge promptly", "Critical low battery. Return to home or land promptly"},
|
||||
{0x1610000f, "Critical low battery voltage. Unable to take off. Charge promptly", "Critical low battery voltage. Return to home or land promptly"},
|
||||
{0x16100010, "Battery output power insufficient. Unable to take off. Charge promptly", "Battery power output insufficient. Return to home or land"},
|
||||
{0x16100011, "Critical low battery. Unable to take off. Charge promptly", "Critical low battery. Return to home or land promptly"},
|
||||
{0x16100012, "Battery initializing. Unable to take off. Wait for initialization to complete before taking off", "Battery initialization error. Return to home or land"},
|
||||
{0x16100013, "Running Flight Simulator. Unable to take off. Restart aircraft before taking off", "Running Flight Simulator. Restart aircraft before taking off"},
|
||||
{0x16100015, "Aircraft pitch angle too large. Unable to take off. Ensure aircraft is level before taking off", "Aircraft pitch angle too large. Ensure aircraft is level before taking off"},
|
||||
{0x16100016, "Aircraft not activated. Unable to take off. Restart DJI Pilot and activate aircraft", "Aircraft not activated. Restart DJI Pilot and activate aircraft"},
|
||||
{0x16100017, "Aircraft in GEO Zone. Unable to take off. Check map to find Recommended Zones", "Aircraft in GEO Zone. Check map to find Recommended Zones"},
|
||||
{0x16100018, "IMU error. Unable to take off. Calibrate IMU", "IMU initialization error. Return to home or land"},
|
||||
{0x16100019, "ESC error. Unable to take off. Contact DJI Support", "ESC error. Land immediately"},
|
||||
{0x1610001a, "Sensor system initializing. Unable to take off. Wait for initialization to complete before taking off", "Sensor system initializing. Return to home or land"},
|
||||
{0x1610001b, "System updating. Unable to take off. Wait for update to complete", "System updating. Wait for update to complete before taking off"},
|
||||
{0x1610001c, "Running Flight Simulator. Unable to take off. Restart aircraft before taking off", "Running Flight Simulator. Restart aircraft before taking off"},
|
||||
{0x1610001d, "IMU calibrating. Unable to take off. Wait for calibration to complete before takeoff", "Calibrating IMU. Wait for calibration to complete before taking off"},
|
||||
{0x1610001e, "Aircraft pitch angle too large. Unable to take off. Ensure aircraft is level before taking off", "Aircraft pitch angle too large. Ensure aircraft is level before taking off"},
|
||||
{0x16100029, "Invalid aircraft serial number. Unable to take off. Contact your local dealer or DJI Support", "Invalid aircraft serial number. Return to home or land"},
|
||||
{0x1610002d, "GPS disconnected. Unable to take off. Restart aircraft", "GPS disconnected. Return to home or land"},
|
||||
{0x1610002f, "Data recorder error. Unable to take off. Restart aircraft", "Data recorder error. Return to home or land"},
|
||||
{0x16100030, "Aircraft model and firmware version do not match. Unable to take off. Contact your local dealer or DJI Support.", "Aircraft model and firmware version do not match. Return to home or land"},
|
||||
{0x1610003d, "Sensor system disconnected. Unable to take off. Restart aircraft", "Sensor system disconnected. Return to home or land"},
|
||||
{0x1610004a, "Sensor system error. Unable to take off. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1610004b, "Sensor system error. Unable to take off. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x1610004d, "Flight controller data error. Unable to take off. Restart aircraft", "Flight controller data error. Return to home or land"},
|
||||
{0x1610004e, "Not enough batteries installed. Unable to take off. Insert two batteries before taking off", "Insufficient batteries. Install two batteries before taking off"},
|
||||
{0x1610004f, "Battery authentication failed. Unable to take off. Replace with DJI battery", "Battery authentication failed. Replace with standard DJI battery"},
|
||||
{0x16100051, "Large voltage difference between batteries. Unable to take off. Replace batteries with new ones of a similar capacity", "Large voltage difference between batteries. Return to home or land. Replace batteries with new ones of a similar capacity and try again"},
|
||||
{0x16100053, "Aircraft module firmware versions do not match. Unable to take off. Update to latest firmware versions.", "Aircraft module firmware versions do not match. Update to latest firmware versions"},
|
||||
{0x16100054, "Gimbal error. Unable to take off. Contact DJI Support", "Gimbal error. Return to home or land"},
|
||||
{0x16100055, "Gimbal error. Unable to take off. Contact DJI Support", "Gimbal error. Return to home or land"},
|
||||
{0x16100056, "Gimbal error. Unable to take off. Contact DJI Support", "Gimbal error. Return to home or land"},
|
||||
{0x16100057, "Gimbal error. Unable to take off. Contact DJI Support", "Gimbal error. Return to home or land"},
|
||||
{0x16100058, "Gimbal firmware updating. Unable to take off...", "Gimbal firmware update in progress"},
|
||||
{0x1610005d, "IMU calibration successful. Unable to take off. Restarting aircraft required", "IMU calibration error. Return to home or land"},
|
||||
{0x1610005e, "Aircraft rolled during takeoff. Unable to take off. Check whether propellers were installed correctly", "Aircraft rolled during takeoff. Check whether propellers are installed correctly"},
|
||||
{0x1610005f, "Motor stalled. Unable to take off. Power off aircraft and check whether motor can rotate freely", "Motor stalled. Land promptly. Power off airfcraft and check whether motor can rotate freely"},
|
||||
{0x16100060, "Motor rotation speed error. Unable to take off. Restart aircraft", "Motor rotation speed error. Land and restart aircraft"},
|
||||
{0x16100061, "Motor idle. Unable to take off. Check whether propellers are detached or installed incorrectly", "Motor idle. Unable to take off. Check whether propellers are detached or installed incorrectly"},
|
||||
{0x16100062, "Unable to turn on motor. Unable to take off. Check aircraft status and restart", "Unable to turn on aircraft motor(s). Check aircraft status and restart"},
|
||||
{0x16100063, "Auto Takeoff failed. Unable to take off", "Auto Takeoff failed"},
|
||||
{0x16100064, "Aircraft rolled over. Unable to take off. Restart aircraft and ensure it is level before taking off", "Aircraft rolled over. Return to home or land"},
|
||||
{0x16100065, "Battery firmware version error. Unable to take off. Replace battery or update battery firmware to latest version", "Battery firmware version error. Replace battery or update to the latest firmware version"},
|
||||
{0x16100066, "RTK signal weak. Unable to take off. Move to an open area for takeoff or turn off RTK", "RTK signal weak. Move to an open area for takeoff or turn off RTK"},
|
||||
{0x16100067, "Compass interference. Unable to take off. Calibrate compass", "Compass interference. Move away from interference source"},
|
||||
{0x16100068, "ESC short-circuited. Unable to take off. Restart aircraft", "ESC short-circuited. Restart aircraft"},
|
||||
{0x16100069, "ESC auto-check error. Unable to take off. Restart aircraft", "ESC auto-check error. Return to home or land"},
|
||||
{0x16100071, "GPS error. Unable to take off. Restart aircraft", "GPS error. Return to home or land"},
|
||||
{0x16100072, "Gimbal calibrating. Unable to take off", "Gimbal calibration error. Return to home or land"},
|
||||
{0x16100073, "Takeoff conditions not met. Unable to take off. Firmware out-of-date or flight route uploading to aircraft", "Firmware out of date or flight route uploading to aircraft. Return to home or land"},
|
||||
{0x16100074, "Takeoff altitude error. Unable to take off. Restart aircraft", "Takeoff altitude error. Restart aircraft"},
|
||||
{0x16100075, "ESC firmware versions do not match. Unable to take off. Update to latest firmware version", "ESC firmware versions do not match. Update to latest firmware versions"},
|
||||
{0x16100076, "IMU error. Unable to take off. Contact DJI Support", "IMU error. Return to home or land"},
|
||||
{0x16100078, "Compass error. Unable to take off. Contact DJI Support", "Compass error. Return to home or land"},
|
||||
{0x1610007a, "ESC beeping. Unable to take off. Restart aircraft before taking off", "ESC beeping. Return to home or land"},
|
||||
{0x1610007b, "ESC overheated. Unable to take off. Power off aircraft and wait for temperature to return to normal", "ESC overheated. Land promptly. Power off aircraft and wait for temperature to return to normal"},
|
||||
{0x1610007d, "Impact detected. Takeoff failed and aircraft landed. Unable to take off. Restart aircraft", "Impact detected. Aircraft landed. Restart aircraft"},
|
||||
{0x1610007f, "Impact detected. Unable to take off. Restart aircraft", "Impact detected. Return to home or land"},
|
||||
{0x16100080, "Aircraft altitude control error. Unable to take off. Restart aircraft", "Aircraft altitude control error. RTH or land"},
|
||||
{0x16100081, "Battery firmware out-of-date. Unable to take off. Update to latest firmware version", "Battery firmware version out of date. Return to home or land. Update to latest firmware version"},
|
||||
{0x16100082, "Large voltage different between battery cells. Unable to take off. Battery maintenance required", "Large difference in battery cell voltage detected. Return to home or land. Battery maintenance required"},
|
||||
{0x16100083, "Battery installed incorrectly. Unable to take off. Turn battery locker to its limit and ensure both batteries are installed correctly", "Battery installed incorrectly. Return to home or land. Turn battery locker to its limit and ensure both batteries are installed correctly"},
|
||||
{0x16100084, "Upper fan error. Unable to take off. Check whether fan is stalled or making strange noises", "Upper fan error. Return to home or land. Check whether fan is stalled or making strange noises"},
|
||||
{0x16100085, "Aircraft overheated. Unable to take off. Power off aircraft and wait for temperature to return to normal", "Aircraft overheated. Return to home or land. Power off aircraft and wait for temperature to return to normal"},
|
||||
{0x16100087, "Emergency Propeller Stop triggered. Unable to take off", "Emergency Propeller Stop triggered"},
|
||||
{0x16100088, " Control sticks not centered. Unable to take off. Ensure control sticks are centered", "Takeoff failed. Control sticks not centered. Ensure control sticks are centered"},
|
||||
{0x16100089, "Security code verification failed. Unable to take off. Re-enter code", "Security code verification failed. Unable to take off. Re-enter verification code"},
|
||||
{0x1610008a, "Flight controller unit error. Unable to take off. Restart aircraft", "Flight controller unit error. Return to home or land"},
|
||||
{0x1610008f, "Aircraft antenna satellite signal searching error. Unable to take off. Move to an open area for takeoff", "Aircraft antenna satellite signal searching error. Fly with caution"},
|
||||
{0x16100091, "Flight prohibited in current area. Unable to take off", "Flying prohibited in current area. Return to home or land"},
|
||||
{0x16100092, "Battery capacity error. Unable to take off. Battery maintenance required", "Battery capacity error. Return to home or land. Battery maintenance required"},
|
||||
{0x16100099, "Gimbal starting error. Unable to take off. Check whether gimbal can rotate freely and restart aircraft", "Gimbal startup error. Return to home or land. Check whether gimbal can rotate freely and restart aircraft"},
|
||||
{0x1610009a, "Excessive gimbal vibration. Unable to take off. Check whether gimbal can rotate freely or is damaged. Restart aircraft", "Excessive gimbal vibration. Return to home or land. Check whether gimbal can rotate freely or is damaged. Restart aircraft"},
|
||||
{0x1610009f, "Flight controller unit error. Unable to take off. Restart aircraft", "Flight controller unit error. Return to home or land"},
|
||||
{0x161000c8, "Unable to take off. Check whether aircraft is connected to DJI Assistant or system is updating", "Check whether aircraft is connected to DJI Assistant or system is updating"},
|
||||
{0x161000c9, "Unable to take off. Check whether aircraft is connected to DJI Assistant or system is updating", "Check whether aircraft is connected to DJI Assistant or system is updating"},
|
||||
{0x16000001, "Flight controller overloaded. Unable to take off. Restart aircraft", "Flight controller overloaded. If the issue persists, land aircraft promptly"},
|
||||
{0x16100090, "Sensor system error. Restart aircraft", "Sensor system error. Return to home or land"},
|
||||
{0x161000a1, "Unable to take off. Check whether frame arm sleeves are tightened securely", "Land promptly and check whether frame arm sleeves are tightened securely"},
|
||||
{0x161000a2, "Lower fan error. Unable to take off. Check whether fan is stalled or making strange noises", "Lower fan error. Land promptly and check whether fan is stalled or making strange noises"},
|
||||
{0x161000a6, "Remote controller battery low. Unable to take off. Recharge battery", "Remote controller battery low. Return to home or land promptly"},
|
||||
{0x16000002, "Flight data record abnorma.If the warning persists, contact your local dealer or DJI Support.", "Flight data record abnorma.If the warning persists, contact your local dealer or DJI Support."},
|
||||
{0x1d010001, "Gimbal stuck", ""},
|
||||
{0x1d010002, "Gimbal auto-check failed", ""},
|
||||
{0x1d010003, "Gimbal motor overloaded", ""},
|
||||
{0x1d020001, "Gimbal calibration error", ""},
|
||||
{0x1d030001, "Gimbal unable to retrieve aircraft data", ""},
|
||||
{0x1d040001, "Excessive gimbal vibration", ""},
|
||||
{0x1d040002, "Gimbal sensor error", ""},
|
||||
{0x1d040004, "Gimbal ESC malfunctioned", ""},
|
||||
{0x1d040003, "Gimbal ESC malfunctioned", ""},
|
||||
{0x1d040005, "Gimbal ESC malfunctioned", ""},
|
||||
{0x1d050003, "Gimbal %component_index pan axis endpoint reached", ""},
|
||||
{0x1d050002, "Gimbal %component_index pitch axis endpoint reached", ""},
|
||||
{0x1d050001, "Gimbal %component_index roll axis endpoint reached", ""},
|
||||
{0x1d001001, "Gimbal unresponsive after power on", ""},
|
||||
{0x1d100002, "Gimbal unresponsive after power on", ""},
|
||||
{0x1d100006, "Gimbal unresponsive after power on", ""},
|
||||
{0x1d001101, "Gimbal unable to complete auto check", ""},
|
||||
{0x1d110002, "Gimbal unable to complete auto check", ""},
|
||||
{0x1d110005, "Gimbal unable to complete auto check", ""},
|
||||
{0x1d120001, "Error detected during gimbal auto check", ""},
|
||||
{0x1d120002, "Error detected during gimbal auto check", ""},
|
||||
{0x1d120004, "Error detected during gimbal auto check", ""},
|
||||
{0x1d120006, "Error detected during gimbal auto check", ""},
|
||||
{0x1d130003, "Excessive gimbal vibration", ""},
|
||||
{0x1d130005, "Excessive gimbal vibration", ""},
|
||||
{0x1d13000a, "Excessive gimbal vibration", ""},
|
||||
{0x1d140001, "Gimbal motor overloaded", ""},
|
||||
{0x1d150002, "Gimbal drifting", ""},
|
||||
{0x1d150003, "Gimbal drifting", ""},
|
||||
{0x1d150004, "Gimbal drifting", ""},
|
||||
{0x1d150005, "Gimbal drifting", ""},
|
||||
{0x1d160004, "Camera tilted", ""},
|
||||
{0x1d170001, "Gimbal error", ""},
|
||||
{0x1d180001, "Gimbal calibration data error", ""},
|
||||
{0x1d190002, "Gimbal update failed", ""},
|
||||
{0x1d010003, "Gimbal motor overloaded", ""},
|
||||
{0x1d050a01, "Gimbal voltage too low", ""},
|
||||
{0x1d05030f, "Gimbal rotation count approaching max limit", ""},
|
||||
{0x1d050301, "Gimbal operation retry attempts limit exceeded", ""},
|
||||
{0x1d050302, "Camera exposure error", ""},
|
||||
{0x1d050a02, "Gimbal time synchronization error", ""},
|
||||
{0x110b0001, "Battery %index overcurrent. Check for heavy payload and reduce excessive motion during flight", ""},
|
||||
{0x110b0002, "Battery %index overheated. Return to home promptly and wait for battery temperature to return to normal before use", ""},
|
||||
{0x110b0003, "Battery %index temperature too low. Warm up battery to 5°C or higher", ""},
|
||||
{0x110b0006, "Battery %index cell damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b0011, "Battery %index data communication error. Reinstall battery. If the issue persists, replace battery", ""},
|
||||
{0x110b0004, "Battery %index short-circuited during discharge. Replace battery", ""},
|
||||
{0x110b0005, "Battery %index cell voltage low. Replace battery", ""},
|
||||
{0x110b0012, "Battery %index requires maintenance", ""},
|
||||
{0x110b0015, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b0016, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b0017, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b0018, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b0019, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b001a, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b001b, "Battery %index requires maintenance to ensure flight safety", ""},
|
||||
{0x110b0007, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b0008, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b0009, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b000a, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b000b, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b000c, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b000d, "Battery %index damaged. Stop using this battery and contact DJI Support", ""},
|
||||
{0x110b000f, "Battery %index capacity significantly decreased. Continuing use poses serious safety risks", ""},
|
||||
{0x110b0010, "Safety requirements not met. Dispose of Battery %index properly", ""},
|
||||
{0x110b0013, "Battery not detected in slot %index. Insert or replace battery", "Battery not detected in slot %index. Return to home or land promptly "},
|
||||
{0x110b001c, "Batteries do not match. Replace with matching batteries", ""},
|
||||
{0x110b0014, "Battery %index auto-heating", ""},
|
||||
{0x110b000e, "Battery %index self-discharged during storage", ""},
|
||||
{0x110b001d, "Discharge error detected for battery in slot %index. Return to home or land promptly", ""},
|
||||
{0x110b001e, "Discharge error detected for battery in slot %index. Return to home or land promptly", ""},
|
||||
{0x16080020, "Motor %index stalled. Land aircraft immediately", ""},
|
||||
{0x16080021, "ESC %index short-circuited. Land immediately and restart aircraft", ""},
|
||||
{0x16080022, "ESC %index overloaded. Land aircraft immediately", ""},
|
||||
{0x16080023, "Motor %index communication error. Land immediately and restart aircraft", ""},
|
||||
{0x16080024, "Motor %index over-accelerating. Stop pressing control stick", ""},
|
||||
{0x16080025, "Motor %index communication error", ""},
|
||||
{0x16080026, "Motor %index communication error", ""},
|
||||
{0x16080027, "Motor %index communication error", ""},
|
||||
{0x16080028, "Motor %index communication error", ""},
|
||||
{0x16080029, "Motor %index propeller detached or installed incorrectly", ""},
|
||||
{0x1608002a, "ESC %index overheated", ""},
|
||||
{0x1608002b, "ESC %index overheated", ""},
|
||||
{0x1608002c, "ESC %index voltage too high", ""},
|
||||
{0x1608002d, "ESC %index voltage too low", ""},
|
||||
{0x1608002e, "ESC %index flash memory error", ""},
|
||||
{0x1608002f, "ESC %index auto-check error", ""},
|
||||
{0x16080030, "ESC %index auto-check error", ""},
|
||||
{0x16080031, "ESC %index auto-check error", ""},
|
||||
{0x16080032, "ESC %index auto-check error", ""},
|
||||
{0x16080033, "ESC %index auto-check error", ""},
|
||||
{0x16080034, "ESC %index auto-check error", ""},
|
||||
{0x16080035, "ESC %index auto-check error", ""},
|
||||
{0x16080036, "ESC %index auto-check error", ""},
|
||||
{0x16080037, "ESC %index auto-check error", ""},
|
||||
{0x16080038, "ESC %index auto-check error", ""},
|
||||
{0x16080039, "ESC %index auto-check error", ""},
|
||||
{0x16080040, "ESC %index auto-check error", ""},
|
||||
{0x16080041, "ESC %index auto-check error", ""},
|
||||
{0x16080042, "ESC %index auto-check error", ""},
|
||||
{0x16080043, "ESC %index auto-check error", ""},
|
||||
{0x16080044, "ESC %index voltage too low", ""},
|
||||
{0x16080045, "ESC %index voltage too high", ""},
|
||||
{0x16080046, "ESC %index auto-check error", ""},
|
||||
{0x16080047, "ESC %index auto-check error", ""},
|
||||
{0x16080048, "ESC %index auto-check error", ""},
|
||||
{0x16080049, "ESC %index auto-check error", ""},
|
||||
{0x1e000001, "Payload %component_index startup error", ""},
|
||||
{0x1e000002, "Payload %component_index communication error", ""},
|
||||
{0x1e000003, "Payload %component_index overheated", ""},
|
||||
{0x1e000004, "Payload %component_index hardware error", ""},
|
||||
{0x1b010001, "Navigation system error. Restart aircraft", ""},
|
||||
{0x1b010002, "Smart Track unavailable for current payload", ""},
|
||||
{0x1b010003, "Camera mode error. Smart Track unavailable", ""},
|
||||
{0x1b010004, "Target too close", ""},
|
||||
{0x1b010005, "Target lost. Smart Track stopped", ""},
|
||||
{0x1b010006, "Switched to gimbal free mode. Use the RC to control aircraft yaw.", ""},
|
||||
{0x1b010007, "Smart Track stopped. Switch to P mode", ""},
|
||||
{0x1b010008, "Enabling Smart Track failed", ""},
|
||||
{0x1b010009, "Obstacle detected. Circling stopped. Manually control aircraft to avoid obstacle", ""},
|
||||
{0x1b01000a, "GEO Zone nearby. Circling stopped. Manually control aircraft to avoid GEO Zone", ""},
|
||||
{0x1b01000b, "Smart Track paused", ""},
|
||||
{0x1b01000c, "Target moving too fast. Circling stopped", ""},
|
||||
{0x1b010401, "Target too far away. Smart Track stopped", ""},
|
||||
{0x1b010402, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010403, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010404, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010405, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010406, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010407, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010408, "Camera data sending error. Smart Track paused. Restart camera", ""},
|
||||
{0x1b010801, "Camera parameters changed. Smart Track stopped", ""},
|
||||
{0x1b010802, "DJI Pilot error. Smart Track paused. Restart DJI Pilot", ""},
|
||||
{0x1b010803, "DJI Pilot error. Smart Track paused. Restart DJI Pilot", ""},
|
||||
{0x1b010c01, "Target lost. Smart Track stopped", ""},
|
||||
{0x1b010c02, "Flight Controller data sending error. Smart Track paused. Restart aircraft", ""},
|
||||
{0x1b010c03, "Flight Controller data sending error. Smart Track paused. Restart aircraft", ""},
|
||||
{0x1b011001, "Gimbal data sending error. Smart Track stopped. Reinstall payload", ""},
|
||||
{0x1b011002, "Gimbal data sending error. Smart Track paused. Reinstall payload", ""},
|
||||
{0x1b011003, "Gimbal data sending error. Smart Track paused. Reinstall payload", ""},
|
||||
{0x1b011801, "Remote controller data sending error. Smart Track stopped. Restart RC", ""},
|
||||
{0x1b011802, "Remote controller data sending error. Smart Track stopped. Check connection between RC and aircraft", ""},
|
||||
{0x1b030001, "Obstacle detected. RTH stopped. Manually control aircraft to avoid obstacle", ""},
|
||||
{0x1b030002, "GEO Zone nearby. RTH stopped. Manually control aircraft to avoid GEO Zone", ""},
|
||||
{0x1b030003, "RTH error. Fly aircraft manually", ""},
|
||||
{0x1b030004, "Remote controller disconnected. Failsafe RTH in progress", ""},
|
||||
{0x1b030005, "Enabling RTH Obstacle Check failed. Control aircraft to return to home manually", ""},
|
||||
{0x1b030c02, "GPS signal weak. RTH accuracy affected. Manual RTH recommended", ""},
|
||||
{0x1b033001, "RTH Obstacle Check error. Control aircraft to return to home manually", ""},
|
||||
{0x1b040001, "AI Spot-Check unavailable with current payload", ""},
|
||||
{0x1b040002, "AI Spot-Check failed. Switched to normal shooting mode", ""},
|
||||
{0x1b040003, "AI Spot-Check failed. Switched to normal shooting mode", ""},
|
||||
{0x1b040004, "Camera not mounted. AI Spot-Check failed", ""},
|
||||
{0x1b040401, "Camera focusing timed out. AI Spot-Check failed. Restart camera", ""},
|
||||
{0x1b040402, "Switching shooting modes failed. AI Spot-Check failed. Restart camera", ""},
|
||||
{0x1b040403, "Camera zoom timed out. AI Spot-Check failed. Restart camera", ""},
|
||||
{0x1b040801, "Unable to locate AI Spot-Check sample. Reupload flight route", ""},
|
||||
{0x1b040802, "Target box parameter error. Readjust target box", ""},
|
||||
{0x1b041001, "Gimbal error. AI Spot-Check failed. Reinstall payload", ""},
|
||||
{0x1b090001, "Smart Track stopped", ""},
|
||||
{0x1b090002, "Target tracking stopped", ""},
|
||||
{0x1b090003, "Target tracking stopped", ""},
|
||||
{0x1b092c01, "Target identification error", ""},
|
||||
{0x1b092c02, "Target identification error", ""},
|
||||
{0x1b092c03, "Target identification error", ""},
|
||||
{0x1b092c04, "Target identification error", ""},
|
||||
{0x1b092c05, "Target identification error", ""},
|
||||
{0x1b092c06, "Target identification error", ""},
|
||||
{0x1b092c07, "Target identification error", ""},
|
||||
{0x1b092c08, "Target identification error", ""},
|
||||
{0x1b092c09, "Target identification error", ""},
|
||||
{0x1b092c0a, "Target identification error", ""},
|
||||
{0x1b092c0b, "Target identification error", ""},
|
||||
{0x1b092c0c, "Target identification error", ""},
|
||||
{0x1b092c0d, "Target identification error", ""},
|
||||
{0x1b092c0e, "Target identification error", ""},
|
||||
{0x1b092c0f, "Target identification error", ""},
|
||||
{0x1b092c10, "Target identification error", ""},
|
||||
{0x1b092c11, "Target identification error", ""},
|
||||
{0x1b092c12, "Target identification error", ""},
|
||||
{0x1b092c13, "Target identification error", ""},
|
||||
{0x1b092c14, "Target identification error", ""},
|
||||
{0x1b092c15, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c16, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c17, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c18, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c19, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1a, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1b, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1c, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1d, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1e, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c1f, "Enabling Smart Track failed. Ensure selected target is valid", ""},
|
||||
{0x1b092c20, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b092c21, "Enabling Smart Track failed. Reduce selected area", ""},
|
||||
{0x1b092c22, "Enabling Smart Track failed. Increase selected area", ""},
|
||||
{0x1b092c23, "Enabling Smart Track failed. Ensure selected target is valid", ""},
|
||||
{0x1b092c24, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093001, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093002, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093003, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093004, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093005, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093006, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093007, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093008, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093009, "Enabling Smart Track failed. Increase selected area", ""},
|
||||
{0x1b09300a, "Enabling Smart Track failed. Ensure selected target is valid", ""},
|
||||
{0x1b09300b, "Target lost. Smart Track stopped", ""},
|
||||
{0x1b09300c, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b09300d, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b09300e, "Camera parameters changed. Smart Track stopped", ""},
|
||||
{0x1b09300f, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093010, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093011, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093012, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093013, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093014, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093015, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093016, "Target lost. Exited Smart Track", ""},
|
||||
{0x1b093017, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b093018, "Target too far away. Smart Track stopped", ""},
|
||||
{0x1b093019, "Camera parameters changed. Exited Smart Track", ""},
|
||||
{0x1b09301a, "Enabling Smart Track failed. Check and try again", ""},
|
||||
{0x1b01000d, "Unusual target movement. Drag-select target again", ""},
|
||||
{0x1b01000e, "GPS signal weak and vision positioning unavailable. Aircraft switched to A mode. Control aircraft manually", ""},
|
||||
{0x1b01000f, "Target lost. Searching...", ""},
|
||||
{0x1b010010, "During Smart Track, you can control gimbals within a certain limit", ""},
|
||||
{0x1b010011, "During Smart Track, you can control lens zoom within a certain limit", ""},
|
||||
{0x1f0b0001, "Aircraft unable to use LTE Transmission. Network connection unstable or SIM card unable to connect to network", ""},
|
||||
{0x1f0b0002, "Remote controller unable to use LTE Transmission. Network connection unstable or SIM card unable to connect to network", ""},
|
||||
{0x1f0b0003, "LTE Server and LTE Transmission unavailable", ""},
|
||||
{0x1f0b0004, "LTE Server and LTE Transmission unavailable", ""},
|
||||
{0x1f0b0005, "LTE Transmission unavailable. Check and ensure remote controller and aircraft are linked properly", ""},
|
||||
{0x1f0b0006, "LTE Transmission unavailable. Restart remote controller", ""},
|
||||
{0x1f0b0007, "LTE Transmission unavailable. Check aircraft 4G Dongle network connectivity", ""},
|
||||
{0x1f0b0008, "LTE Transmission unavailable. Restart aircraft and remote controller", ""},
|
||||
{0x1f0b0009, "LTE Transmission unavailable. Restart remote controller", ""},
|
||||
{0x1f0b001a, "LTE Transmission unavailable. Check aircraft 4G Dongle network connectivity", ""},
|
||||
{0x1f0b001b, "LTE Transmission unavailable. Restart aircraft and remote controller", ""},
|
||||
{0x1f0b0016, "LTE Transmission unavailable. Check remote controller network connectivity", ""},
|
||||
{0x1f0b0017, "LTE Transmission unavailable. Check remote controller network connectivity", ""},
|
||||
{0x1f0b0018, "LTE Transmission unavailable. Restart aircraft and remote controller", ""},
|
||||
{0x1c200001, "Camera %component_index overheated. Wait for temperature to return to normal before use", ""},
|
||||
{0x1c100001, "Camera %component_index overheated. Wait for temperature to return to normal before use", ""},
|
||||
{0x1c300001, "Camera %component_index overheated. Wait for temperature to return to normal before use", ""},
|
||||
{0x1c200101, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c200102, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c200103, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c200104, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c200105, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c100101, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c100102, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c100103, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c100104, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c100105, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c300101, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c300102, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c300103, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c300104, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c300105, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c200201, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c200202, "Camera %component_index error. Restart camera", ""},
|
||||
{0x1c200203, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c200204, "H20 camera image transmission sensor processor error", ""},
|
||||
{0x1c100201, "H20 camera image transmission sensor processor error", ""},
|
||||
{0x1c100202, "H20 camera image transmission sensor processor error", ""},
|
||||
{0x1c100203, "Camera chip overheated. Power off aircraft and wait for temperature to return to normal before use", "Camera processor overheated. Return to home or land promptly. Wait for temperature to return to normal before use"},
|
||||
{0x1c100204, "H20 camera image transmission sensor processor error", ""},
|
||||
{0x1c200301, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c200302, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c200303, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c200304, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c100301, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c100302, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c100303, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c100304, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c300301, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c300302, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c300303, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c300304, "H20 camera lens error. Restart camera", ""},
|
||||
{0x1c200401, "Invalid SD card. Replace card", ""},
|
||||
{0x1c200403, "SD card error. Replace card", ""},
|
||||
{0x1c100401, "Invalid SD card. Replace SD card", ""},
|
||||
{0x1c100403, "SD card error. Change card", ""},
|
||||
{0x1c300401, "Invalid SD card. Replace SD card", ""},
|
||||
{0x1c300403, "SD card error. Change card", ""},
|
||||
{0x1c300601, "Temperature of current environment too low. Enable temperature measurement when temperature is within normal range", ""},
|
||||
{0x1c300602, "Temperature of current evironment too high. Only enable temperature measurement when temperature is within normal range", ""},
|
||||
{0x1c300603, "Zenmuse H20T infrared thermal camera switching modes...", ""},
|
||||
{0x1c300604, "Zenmuse H20T infrared thermal camera calibration data missing", ""},
|
||||
{0x1c300605, "Zenmuse H20T infrared thermal camera initialization error. Restart camera", ""},
|
||||
{0x1c300606, "Temperature measurement failed. Adjust camera parameters and try again", ""},
|
||||
{0x1c300701, "Sensor protection enabled. Infrared thermal camera shutter closed", ""},
|
||||
{0x1c100405, "Confirm SD card read and write permissions", ""},
|
||||
{0x1c200405, "Confirm SD card read and write permissions", ""},
|
||||
{0x1c300405, "Confirm SD card read and write permissions", ""},
|
||||
{0x1c100406, "SD card not formatted. Format SD card before use", ""},
|
||||
{0x1c200406, "SD card not formatted. Format SD card before use", ""},
|
||||
{0x1c300406, "SD card not formatted. Format SD card before use", ""},
|
||||
{0x1c100407, "SD card formatting. Please wait", ""},
|
||||
{0x1c200407, "SD card formatting. Please wait", ""},
|
||||
{0x1c300407, "SD card formatting. Please wait", ""},
|
||||
{0x1c100408, "SD card file system not supported. Format card and try again", ""},
|
||||
{0x1c200408, "SD card file system not supported. Format card and try again", ""},
|
||||
{0x1c300408, "SD card file system not supported. Format card and try again", ""},
|
||||
{0x1c100409, "SD card refreshing. Please wait", ""},
|
||||
{0x1c200409, "SD card refreshing. Please wait", ""},
|
||||
{0x1c300409, "SD card refreshing. Please wait", ""},
|
||||
{0x1c10040a, "SD card full. Clear space", ""},
|
||||
{0x1c20040a, "SD card full. Clear space", ""},
|
||||
{0x1c30040a, "SD card full. Clear space", ""},
|
||||
{0x1c10040b, "SD card memory overflow. Format SD card and restart camera", ""},
|
||||
{0x1c20040b, "SD card memory overflow. Format SD card and restart camera", ""},
|
||||
{0x1c30040b, "SD card memory overflow. Format SD card and restart camera", ""},
|
||||
{0x1c10040c, "SD card initializing. Please wait", ""},
|
||||
{0x1c20040c, "SD card initializing. Please wait", ""},
|
||||
{0x1c30040c, "SD card initializing. Please wait", ""},
|
||||
{0x1c10040d, "SD card error. Format SD card before use", ""},
|
||||
{0x1c20040d, "SD card error. Format SD card before use", ""},
|
||||
{0x1c30040d, "SD card error. Format SD card before use", ""},
|
||||
{0x1c10040e, "SD card repair in progress. Please wait", ""},
|
||||
{0x1c20040e, "SD card repair in progress. Please wait", ""},
|
||||
{0x1c30040e, "SD card repair in progress. Please wait", ""},
|
||||
{0x1c10040f, "SD card read and write speed low. Please wait", ""},
|
||||
{0x1c20040f, "SD card read and write speed low. Please wait", ""},
|
||||
{0x1c30040f, "SD card read and write speed low. Please wait", ""},
|
||||
{0x1c000103, "Camera processor overheated. Power off aircraft. Wait for processor to cool down before use", "Camera processor overheated. Return to home or land promptly. Wait for processor to cool down before use"},
|
||||
{0x1c000401, "Invalid SD card. Replace card", ""},
|
||||
{0x1c000402, "SD card speed low. Replace with faster SD card", ""},
|
||||
{0x1c000403, "SD card error. Replace card", ""},
|
||||
{0x1c000404, "No SD card", ""},
|
||||
{0x1c000405, "Confirm SD card read and write permissions ", ""},
|
||||
{0x1c00040e, "SD card write speed slow", ""},
|
||||
{0x1c000407, "SD card formatting. Please wait ", ""},
|
||||
{0x1c000408, "SD card file system not supported. Format card before use ", ""},
|
||||
{0x1c00040a, "SD card full. Clear space ", ""},
|
||||
{0x1c00040b, "SD card memory overflow. Format card and restart camera ", ""},
|
||||
{0x1c00040c, "SD card initializing. Please wait ", ""},
|
||||
{0x1c00040d, "SD card error. Format card before use ", ""},
|
||||
{0x1c000303, "Camera lens error. Restart camera ", ""},
|
||||
{0x1c000305, "Shutter trigger count reached 100K design limit", ""},
|
||||
{0x1c000306, "Certain features unavailable for current camera", ""},
|
||||
{0x1c000d01, "Focusing failed", ""},
|
||||
{0x1c000204, "Camera image sensor overheated", ""},
|
||||
{0x1c000d03, "Infinity focus calibration data expired. Recalibrate", ""},
|
||||
{0x1c000d02, "Loading camera calibration file failed", ""},
|
||||
{0x1c000e01, "Calibration parameters do not match camera or lens", ""},
|
||||
{0x1c000e02, "Update camera intrinsic parameter calibration data", ""},
|
||||
{0x1c000901, "PPS signal sending error", ""},
|
||||
{0x1c000902, "Camera time synchronization error", ""},
|
||||
{0x14010042, "Payload IMU warming up. Wait until IMU is warmed up", ""},
|
||||
{0x14010043, "Payload IMU temperature controlling processor error. Restart payload", ""},
|
||||
{0x14010044, "Payload IMU overheated. Restart payload", ""},
|
||||
{0x14010045, "Payload IMU overheated. Restart payload", ""},
|
||||
{0x19000001, "Avionics system overloaded. Check whether logs are being transmitted. Restart aircraft to restore", "Avionics system overloaded. Fly with caution"},
|
||||
{0x19000002, "Avionics system overloaded. Check whether logs are being transmitted. Restart aircraft to restore", "Avionics system overloaded. Fly with caution"},
|
||||
{0x17000001, "Avionics system overloaded. Restart aircraft to restore", "Avionics system overloaded. Fly with caution"},
|
||||
{0x19000011, "Avionics system memory insufficient. Restart aircraft to restore", "Avionics system memory insufficient. Fly with caution"},
|
||||
{0x19000012, "Avionics system memory insufficient. Restart aircraft to restore", "Avionics system memory insufficient. Fly with caution"},
|
||||
{0x17000011, "Avionics system memory insufficient. Restart aircraft to restore", "Avionics system memory insufficient. Fly with caution"},
|
||||
{0x19000021, "Avionics system error. Restart aircraft to restore", "Avionics system error. Fly with caution"},
|
||||
{0x19000022, "Avionics system error. Restart aircraft to restore", "Avionics system error. Fly with caution"},
|
||||
{0x15000020, "Radar temperature too low. Check and make sure temperature of current environment is within normal range", ""},
|
||||
{0x15000021, "Radar overheated. Check and make sure temperature of current environment is within normal range", ""},
|
||||
{0x15080020, "Radar overheated. Check and make sure temperature of current environment is within normal range", ""},
|
||||
{0x15090020, "Radar overheated. Check and make sure temperature of current environment is within normal range", ""},
|
||||
{0x15020020, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15020021, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15020022, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15040020, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15040021, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15110020, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15060020, "Radar motor error. Check whether radar motor is blocked", ""},
|
||||
{0x15010020, "Radar internal power supply error. Restart radar", ""},
|
||||
{0x15010021, "Radar internal power supply error. Restart radar", ""},
|
||||
{0x15010022, "Radar internal power supply error. Restart radar", ""},
|
||||
{0x15010023, "Radar internal power supply error. Restart radar", ""},
|
||||
{0x15030020, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030021, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030022, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030023, "Starting radar timed out. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030024, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030025, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15030026, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15100020, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15100021, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15100022, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15070020, "Radar communication link unstable. Check for strong interference in the surrounding area", ""},
|
||||
{0x15140020, "Radar RF clock error. Return to home immediately and check radar", ""},
|
||||
{0x15020023, "Radar detection capability error. Check firmware version", ""},
|
||||
{0x15130021, "Radar detection capability error. Check firmware version", ""},
|
||||
{0x15090021, "Radar firmware error. Restart radar", ""},
|
||||
};
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_HMS_INFO_TABLE_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
115
PSDK/psdk_lib/include/dji_liveview.h
Normal file
115
PSDK/psdk_lib/include/dji_liveview.h
Normal file
@ -0,0 +1,115 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_liveview.h
|
||||
* @brief This is the header file for "dji_liveview.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 DJI_LIVEVIEW_H
|
||||
#define DJI_LIVEVIEW_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Liveview camera mount position.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_LIVEVIEW_CAMERA_POSITION_NO_1 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1,
|
||||
DJI_LIVEVIEW_CAMERA_POSITION_NO_2 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2,
|
||||
DJI_LIVEVIEW_CAMERA_POSITION_NO_3 = DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3,
|
||||
DJI_LIVEVIEW_CAMERA_POSITION_FPV = 7
|
||||
} E_DjiLiveViewCameraPosition;
|
||||
|
||||
/**
|
||||
* @brief Liveview camera stream source.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT = 0,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20_WIDE = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20_ZOOM = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20T_WIDE = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20T_ZOOM = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20T_IR = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20N_WIDE = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20N_ZOOM = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_H20N_IR = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M30_ZOOM = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M30_WIDE = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M30T_ZOOM = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M30T_WIDE = 2,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M30T_IR = 3,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3E_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3T_VIS = 1,
|
||||
DJI_LIVEVIEW_CAMERA_SOURCE_M3T_IR = 2,
|
||||
} E_DjiLiveViewCameraSource;
|
||||
|
||||
/**
|
||||
* @brief Liveview camera h264 stream callback.
|
||||
*/
|
||||
typedef void (*DjiLiveview_H264Callback)(E_DjiLiveViewCameraPosition position, const uint8_t *buf, uint32_t len);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the liveview module.
|
||||
* @note The interface initialization needs to be after DjiCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize the liveview module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_Deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Start the FPV or Camera H264 Stream by selected position.
|
||||
* @param position: point out which camera to output the H264 stream
|
||||
* @param source: point out which sub camera to output the H264 stream
|
||||
* @param callback: callback function that is called in a callback thread when a new h264 frame is received
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_StartH264Stream(E_DjiLiveViewCameraPosition position, E_DjiLiveViewCameraSource source,
|
||||
DjiLiveview_H264Callback callback);
|
||||
|
||||
/**
|
||||
* @brief Stop the FPV or Camera H264 Stream by selected position.
|
||||
* @param position: point out which camera to output the H264 stream
|
||||
* @param source: point out which sub camera to output the H264 stream
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLiveview_StopH264Stream(E_DjiLiveViewCameraPosition position, E_DjiLiveViewCameraSource source);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_LIVEVIEW_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
119
PSDK/psdk_lib/include/dji_logger.h
Normal file
119
PSDK/psdk_lib/include/dji_logger.h
Normal file
@ -0,0 +1,119 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_logger.h
|
||||
* @brief This is the header file for "dji_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 DJI_LOGGER_H
|
||||
#define DJI_LOGGER_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief The console method that needs to be registered.
|
||||
* @note Before registering the console method, you need to test the methods that need to be registered to ensure
|
||||
* that they can be used normally.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*ConsoleFunc)(const uint8_t *data, uint16_t dataLen);
|
||||
|
||||
/**
|
||||
* @brief Logger console level.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR = 0, /*!< 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. */
|
||||
DJI_LOGGER_CONSOLE_LOG_LEVEL_WARN = 1, /*!< 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. */
|
||||
DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO = 2, /*!< 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. */
|
||||
DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG = 3, /*!< 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. */
|
||||
} E_DjiLoggerConsoleLogLevel;
|
||||
|
||||
/**
|
||||
* @brief Logger console content.
|
||||
*/
|
||||
typedef struct {
|
||||
ConsoleFunc func;
|
||||
uint8_t consoleLevel;
|
||||
bool isSupportColor;
|
||||
} T_DjiLoggerConsole;
|
||||
|
||||
/* 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_DjiReturnCode DjiLogger_AddConsole(T_DjiLoggerConsole *console);
|
||||
|
||||
/**
|
||||
* @brief Remove the console function and level for Payload SDK.
|
||||
* @param console: pointer to the console function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLogger_RemoveConsole(T_DjiLoggerConsole *console);
|
||||
/**
|
||||
* @brief Print out the selected level 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 DjiLogger_UserLogOutput(E_DjiLoggerConsoleLogLevel level, const char *fmt, ...);
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define USER_LOG_DEBUG(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
#define USER_LOG_INFO(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
#define USER_LOG_WARN(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
#define USER_LOG_ERROR(fmt, ...) \
|
||||
DjiLogger_UserLogOutput(DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_LOGGER_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
111
PSDK/psdk_lib/include/dji_low_speed_data_channel.h
Normal file
111
PSDK/psdk_lib/include/dji_low_speed_data_channel.h
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_low_speed_data_channel.h
|
||||
* @brief This is the header file for "dji_low_speed_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 DJI_LOW_SPEED_DATA_CHANNEL_H
|
||||
#define DJI_LOW_SPEED_DATA_CHANNEL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive data that come from selected channel address.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param data: pointer to data.
|
||||
* @param len: length of data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*DjiLowSpeedDataChannelRecvDataCallback)(const uint8_t *data, uint16_t len);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the low speed data channel module.
|
||||
* @note The interface initialization needs to be after DjiCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLowSpeedDataChannel_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize the low speed data channel module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLowSpeedDataChannel_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Send data to selected channel address 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 "sendDataChannel" command channel via DjiLowSpeedDataChannel_GetSendDataState() 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 selected channel address 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 selected channel address end.
|
||||
* @param channelAddress: the channel address of the low speed channel
|
||||
* @param data: pointer to data to be sent.
|
||||
* @param len: length of data to be sent, unit: byte.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLowSpeedDataChannel_SendData(E_DjiChannelAddress channelAddress, const uint8_t *data,
|
||||
uint8_t len);
|
||||
|
||||
/**
|
||||
* @brief Get data transmission state of "sendToOsdk" command channel. User can use the state as base for controlling data
|
||||
* transmission between selected channel address and onboard computer.
|
||||
* @param channelAddress: the channel address of the low speed channel
|
||||
* @param state: pointer to low speed channel state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLowSpeedDataChannel_GetSendDataState(E_DjiChannelAddress channelAddress,
|
||||
T_DjiDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to receive data from selected channel address. After registering this callback
|
||||
* function, callback function will be called automatically when system receive data from selected channel address.
|
||||
* @param channelAddress: the channel address of the low speed channel
|
||||
* @param callback: pointer to callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiLowSpeedDataChannel_RegRecvDataCallback(E_DjiChannelAddress channelAddress,
|
||||
DjiLowSpeedDataChannelRecvDataCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_LOW_SPEED_DATA_CHANNEL_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
156
PSDK/psdk_lib/include/dji_mop_channel.h
Normal file
156
PSDK/psdk_lib/include/dji_mop_channel.h
Normal file
@ -0,0 +1,156 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_mop_channel.h
|
||||
* @brief This is the header file for "dji_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 DJI_MOP_CHANNEL_H
|
||||
#define DJI_MOP_CHANNEL_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
#include "dji_low_speed_data_channel.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Mop channel handle.
|
||||
*/
|
||||
typedef void *T_DjiMopChannelHandle;
|
||||
|
||||
/**
|
||||
* @brief Mop channel transmission type.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_MOP_CHANNEL_TRANS_RELIABLE = 0, /*!< Reliable transmission type. */
|
||||
DJI_MOP_CHANNEL_TRANS_UNRELIABLE, /*!< Unreliable transmission type. */
|
||||
} E_DjiMopChannelTransType;
|
||||
|
||||
/* 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_DjiReturnCode DjiMopChannel_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_DjiMopChannelTransType.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiMopChannel_Create(T_DjiMopChannelHandle *channelHandle, E_DjiMopChannelTransType 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_DjiReturnCode DjiMopChannel_Destroy(T_DjiMopChannelHandle 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 ::DjiMopChannel_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_DjiReturnCode DjiMopChannel_Bind(T_DjiMopChannelHandle 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_DjiReturnCode DjiMopChannel_Accept(T_DjiMopChannelHandle channelHandle,
|
||||
T_DjiMopChannelHandle *outChannelHandle);
|
||||
|
||||
T_DjiReturnCode DjiMopChannel_Connect(T_DjiMopChannelHandle channelHandle, E_DjiChannelAddress channelAddress,
|
||||
uint16_t channelId);
|
||||
|
||||
/**
|
||||
* @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_DjiReturnCode DjiMopChannel_Close(T_DjiMopChannelHandle channelHandle);
|
||||
|
||||
/**
|
||||
* @brief Send data by the accepted output mop channel.
|
||||
* @note This interface should be called after successfully calling the interface ::DjiMopChannel_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 ::DjiMopChannel_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_DjiReturnCode DjiMopChannel_SendData(T_DjiMopChannelHandle 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 ::DjiMopChannel_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 ::DjiMopChannel_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_DjiReturnCode DjiMopChannel_RecvData(T_DjiMopChannelHandle channelHandle,
|
||||
uint8_t *data,
|
||||
uint32_t len,
|
||||
uint32_t *realLen);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
|
906
PSDK/psdk_lib/include/dji_payload_camera.h
Normal file
906
PSDK/psdk_lib/include/dji_payload_camera.h
Normal file
@ -0,0 +1,906 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_payload_camera.h
|
||||
* @brief This is the header file for "dji_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 DJI_PAYLOAD_CAMERA_H
|
||||
#define DJI_PAYLOAD_CAMERA_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Camera work mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_MODE_SHOOT_PHOTO = 0, /*!< Shoot photo work mode. */
|
||||
DJI_CAMERA_MODE_RECORD_VIDEO = 1, /*!< Record video work mode. */
|
||||
DJI_CAMERA_MODE_PLAYBACK = 2, /*!< Media playback work mode. */
|
||||
} E_DjiCameraMode;
|
||||
|
||||
/**
|
||||
* @brief Camera shoot photo mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_SHOOT_PHOTO_MODE_SINGLE = 1, /*!< Single photographing mode. */
|
||||
DJI_CAMERA_SHOOT_PHOTO_MODE_BURST = 4, /*!< Burst photographing mode. */
|
||||
DJI_CAMERA_SHOOT_PHOTO_MODE_INTERVAL = 6, /*!< Interval photographing mode. */
|
||||
} E_DjiCameraShootPhotoMode;
|
||||
|
||||
/**
|
||||
* @brief Camera shooting state when photographing.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_SHOOTING_PHOTO_IDLE = 0, /*!< Photographing in idle state. */
|
||||
DJI_CAMERA_SHOOTING_SINGLE_PHOTO = 1, /*!< Photographing in single photograph state . */
|
||||
DJI_CAMERA_SHOOTING_BURST_PHOTO = 2, /*!< Photographing in burst photograph state. */
|
||||
DJI_CAMERA_SHOOTING_INTERVAL_PHOTO = 6, /*!< Photographing in interval photograph state. */
|
||||
} E_DjiCameraShootingState;
|
||||
|
||||
/**
|
||||
* @brief Camera metering mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_METERING_MODE_CENTER = 0, /*!< Center metering mode. */
|
||||
DJI_CAMERA_METERING_MODE_AVERAGE = 1, /*!< Average metering mode. */
|
||||
DJI_CAMERA_METERING_MODE_SPOT = 2, /*!< Spot metering mode. */
|
||||
} E_DjiCameraMeteringMode;
|
||||
|
||||
/**
|
||||
* @brief Camera focus mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_FOCUS_MODE_MANUAL = 0, /*!< Manual focus mode. */
|
||||
DJI_CAMERA_FOCUS_MODE_AUTO = 1, /*!< Auto focus mode. */
|
||||
} E_DjiCameraFocusMode;
|
||||
|
||||
/**
|
||||
* @brief Camera playback mode in playback process.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_PLAYBACK_MODE_PLAY = 2, /*!< Play playbacking mode. */
|
||||
DJI_CAMERA_PLAYBACK_MODE_PAUSE = 3, /*!< Pause playbacking mode. */
|
||||
DJI_CAMERA_PLAYBACK_MODE_STOP = 7, /*!< Stop playbacking mode. */
|
||||
} E_DjiCameraPlaybackMode;
|
||||
|
||||
/**
|
||||
* @brief Camera supported video frames when working in playback mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_VIDEO_FRAME_RATE_24_FPS = 13, /*!< The camera's video frame rate is 24fps (frames per second) */
|
||||
DJI_CAMERA_VIDEO_FRAME_RATE_25_FPS = 2, /*!< The camera's video frame rate is 25fps (frames per second) */
|
||||
DJI_CAMERA_VIDEO_FRAME_RATE_30_FPS = 14, /*!< The camera's video frame rate is 30fps (frames per second) */
|
||||
DJI_CAMERA_VIDEO_FRAME_RATE_UNKNOWN = 0, /*!< The camera's video frame rate is unknown (frames per second) */
|
||||
} E_DjiCameraVideoFrameRate;
|
||||
|
||||
/**
|
||||
* @brief Camera supported video resolutions when working in playback mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_640x480 = 0, /*!< /The camera's video resolution is 640x480. */
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_1280x720 = 4, /*!< /The camera's video resolution is 1280x720. */
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_1920x1080 = 10, /*!< /The camera's video resolution is 1920x1080. */
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_2048x1080 = 37, /*!< /The camera's video resolution is 2048x1080. */
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_3840x2160 = 41, /*!< /The camera's video resolution is 3840x2160. */
|
||||
DJI_CAMERA_VIDEO_RESOLUTION_UNKNOWN = 255, /*!< /The camera's video resolution is unknown. */
|
||||
} E_DjiCameraVideoResolution;
|
||||
|
||||
/**
|
||||
* @brief Camera zoom state in tap zoom process.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_TAP_ZOOM_STATE_IDLE = 0, /*!< Camera is not in tap zoom process. */
|
||||
DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_IN = 1, /*!< Camera is zooming in. */
|
||||
DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_OUT = 2, /*!< Camera is zooming out. */
|
||||
DJI_CAMERA_TAP_ZOOM_STATE_ZOOM_LIMITED = 3, /*!< Camera has reached zoom limit. */
|
||||
} E_DjiCameraTapZoomState;
|
||||
|
||||
/**
|
||||
* @brief Camera video stream type.
|
||||
*/
|
||||
typedef enum {
|
||||
/*! 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 #DjiPayloadCamera_GetVideoStreamState.*/
|
||||
DJI_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT = 0,
|
||||
/*! 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. */
|
||||
DJI_CAMERA_VIDEO_STREAM_TYPE_H264_DJI_FORMAT = 1,
|
||||
} E_DjiCameraVideoStreamType;
|
||||
|
||||
/**
|
||||
* @brief Camera sdcard state.
|
||||
*/
|
||||
typedef struct {
|
||||
bool isInserted; /*!< Specifies if the SD card is inserted in the camera. This parameter is boolean type. */
|
||||
bool isVerified; /*!< Specifies if the SD card is verified as genuine. This parameter is boolean type. */
|
||||
bool isInitializing; /*!< Specifies if the SD card is initializing. This parameter is boolean type. */
|
||||
bool isReadOnly; /*!< Specifies if the SD card is read only type. This parameter is boolean type. */
|
||||
bool isFormatting; /*!< Specifies if the SD card is in formatting process. This parameter is boolean type. */
|
||||
bool isFull; /*!< Specifies if the SD card's capacity is full. This parameter is boolean type. */
|
||||
bool isInvalidFormat;/*!< Specifies if the SD card is invalid formatted. This parameter is boolean type. */
|
||||
bool hasError; /*!< Specifies if the SD card has error. This parameter is boolean type. */
|
||||
uint32_t totalSpaceInMB; /*!< SD card total capacity, unit: MB. */
|
||||
uint32_t remainSpaceInMB; /*!< SD card remaining capacity, unit: MB. */
|
||||
uint32_t availableCaptureCount; /*!< Available capture photo count. */
|
||||
uint32_t availableRecordingTimeInSeconds; /*!< Available video recording second time, unit: s. */
|
||||
} T_DjiCameraSDCardState;
|
||||
|
||||
/**
|
||||
* @brief Camera metering target when in spot metering mode.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t col; /*!< Specifies column coordinate. This parameter is between 0 and 11. */
|
||||
uint8_t row; /*!< Specifies row coordinate. This parameter is between 0 and 7. */
|
||||
} T_DjiCameraSpotMeteringTarget;
|
||||
|
||||
/**
|
||||
* @brief Camera system state.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiCameraMode cameraMode; /*!< Specifies the camera current work mode, #E_DjiCameraMode. */
|
||||
E_DjiCameraShootingState shootingState; /*!< Specifies the camera state of shooting, #E_DjiCameraShootingState. */
|
||||
bool isStoring;/*!< Specifies if the camera is in storing status. This parameter is boolean type. */
|
||||
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 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. */
|
||||
uint16_t currentVideoRecordingTimeInSeconds; /*!< Specifies the current recording process time, uint:s. */
|
||||
bool isOverheating; /*!< Specifies if the camera is in overheating status. This parameter is boolean type. */
|
||||
bool hasError; /*!< Specifies if the camera in error status. This parameter is boolean type. */
|
||||
} T_DjiCameraSystemState;
|
||||
|
||||
/**
|
||||
* @brief Camera focus assistant settings.
|
||||
*/
|
||||
typedef struct {
|
||||
bool isEnabledMF; /*!< Specifies if the lens focus assistant is enabled for manual focusing. This parameter is boolean type. */
|
||||
bool isEnabledAF; /*!< Specifies if the lens focus assistant is enabled for auto focusing. This parameter is boolean type. */
|
||||
} T_DjiCameraFocusAssistantSettings;
|
||||
|
||||
/**
|
||||
* @brief Camera playback status.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiCameraPlaybackMode playbackMode; /*!< Specifies the duration of video media file, #E_DjiCameraPlaybackMode. */
|
||||
uint8_t videoPlayProcess; /*!< Specifies the current play process of video media file. This parameter is between 0 and 100. */
|
||||
uint32_t videoLengthMs; /*!< Specifies the total duration of video media file, uint:ms. */
|
||||
uint32_t playPosMs; /*!< Specifies the current play position of video media file, uint:ms. */
|
||||
} T_DjiCameraPlaybackStatus;
|
||||
|
||||
/**
|
||||
* @brief Camera focus assistant settings.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t attrVideoDuration; /*!< Specifies the playback duration of video media file, uint:s. */
|
||||
uint16_t attrVideoFrameRate; /*!< Specifies the frame rate of video media file, uint:fps. */
|
||||
uint16_t attrVideoResolution; /*!< Specifies the resolution of video media file, uint:px. */
|
||||
} T_DjiCameraMediaFileAttr;
|
||||
|
||||
/**
|
||||
* @brief Camera media file info.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiCameraMediaFileType type; /*!< Specifies the type of media file, #E_DjiCameraMediaFileType. */
|
||||
T_DjiCameraMediaFileAttr mediaFileAttr; /*!< Specifies the attributes of media file. */
|
||||
uint32_t fileSize; /*!< Specifies the size of media file, uint:byte. */
|
||||
} T_DjiCameraMediaFileInfo;
|
||||
|
||||
/**
|
||||
* @brief Camera tap zoom state.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiCameraTapZoomState zoomState; /*!< Camera zoom state. */
|
||||
bool isGimbalMoving; /*!< Flag that specifies whether gimbal is moving for tap zoom. */
|
||||
} T_DjiCameraTapZoomState;
|
||||
|
||||
/**
|
||||
* @brief Camera common features handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera system state.
|
||||
* @param systemState: pointer to memory space used to store camera system state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetSystemState)(T_DjiCameraSystemState *systemState);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera work mode.
|
||||
* @note Sets the camera's work mode to taking pictures, video, playback. Please note that you cannot change the mode
|
||||
* when a certain taskHandle is executing, such as taking photo(s), recording video, or downloading and saving files. Also
|
||||
* supported by thermal imaging camera.
|
||||
* @param mode: camera work mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetMode)(E_DjiCameraMode mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current work mode.
|
||||
* @param mode: pointer to memory space used to store camera work mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMode)(E_DjiCameraMode *mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to start record video.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartRecordVideo)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to stop record video.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StopRecordVideo)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to start shoot photo.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartShootPhoto)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to stop shoot photo.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StopShootPhoto)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera shoot photo mode.
|
||||
* @param mode: camera shoot photo mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetShootPhotoMode)(E_DjiCameraShootPhotoMode mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current shoot photo mode.
|
||||
* @param mode: pointer to memory space used to store camera shoot photo mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetShootPhotoMode)(E_DjiCameraShootPhotoMode *mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera shoot burst count.
|
||||
* @param burstCount: camera shoot burst count.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetPhotoBurstCount)(E_DjiCameraBurstCount burstCount);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current burst count.
|
||||
* @param burstCount: pointer to memory space used to store camera shoot burst count.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetPhotoBurstCount)(E_DjiCameraBurstCount *burstCount);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera shoot time interval settings.
|
||||
* @note The value range of interval photograph count is [2, 255]. If 255 is selected, then the camera will continue
|
||||
* to take pictures until StopShootPhoto is called.
|
||||
* @param settings: camera shoot time interval settings.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetPhotoTimeIntervalSettings)(T_DjiCameraPhotoTimeIntervalSettings settings);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera shoot time interval settings.
|
||||
* @param settings: pointer to memory space used to store camera shoot time interval settings.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetPhotoTimeIntervalSettings)(T_DjiCameraPhotoTimeIntervalSettings *settings);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current SDCard state.
|
||||
* @param sdCardState: pointer to memory space used to store camera SDCard state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetSDCardState)(T_DjiCameraSDCardState *sdCardState);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to format the SDCard inserted.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*FormatSDCard)(void);
|
||||
} T_DjiCameraCommonHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera metering feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera metering mode.
|
||||
* @param mode: camera metering mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetMeteringMode)(E_DjiCameraMeteringMode mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current metering mode.
|
||||
* @param mode: pointer to memory space used to store camera metering mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMeteringMode)(E_DjiCameraMeteringMode *mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera spot metering target area.
|
||||
* @param target: camera spot metering target area.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetSpotMeteringTarget)(T_DjiCameraSpotMeteringTarget target);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera spot metering target area.
|
||||
* @param target: pointer to memory space used to store camera spot metering target area.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetSpotMeteringTarget)(T_DjiCameraSpotMeteringTarget *target);
|
||||
} T_DjiCameraExposureMeteringHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera focus feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera focus mode.
|
||||
* @param mode: camera focus mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetFocusMode)(E_DjiCameraFocusMode mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current focus mode.
|
||||
* @param mode: pointer to memory space used to store camera focus mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetFocusMode)(E_DjiCameraFocusMode *mode);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera focus target area.
|
||||
* @param target: camera focus target area.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetFocusTarget)(T_DjiCameraPointInScreen target);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera focus target area.
|
||||
* @param target: pointer to memory space used to store camera focus target area.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetFocusTarget)(T_DjiCameraPointInScreen *target);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera focus assistant settings.
|
||||
* @param settings: camera focus assistant settings.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetFocusAssistantSettings)(T_DjiCameraFocusAssistantSettings settings);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera focus assistant settings.
|
||||
* @param settings: pointer to memory space used to store camera focus assistant settings.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetFocusAssistantSettings)(T_DjiCameraFocusAssistantSettings *settings);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera focus ring value.
|
||||
* @param value: camera focus ring value.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetFocusRingValue)(uint32_t value);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera focus ring value.
|
||||
* @param value: pointer to memory space used to store camera focus ring value.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetFocusRingValue)(uint32_t *value);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera focus upper bound ring value.
|
||||
* @param value: pointer to memory space used to store camera focus upper bound value.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetFocusRingValueUpperBound)(uint32_t *value);
|
||||
} T_DjiCameraFocusHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera digital zoom feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera digital zoom factor.
|
||||
* @param factor: camera digital zoom factor.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetDigitalZoomFactor)(dji_f32_t factor);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera current digital zoom factor.
|
||||
* @param factor: pointer to memory space used to store camera current digital zoom factor.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetDigitalZoomFactor)(dji_f32_t *factor);
|
||||
} T_DjiCameraDigitalZoomHandler;
|
||||
|
||||
/**
|
||||
* @brief Camera optical zoom feature handler.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to set camera optical zoom focal length.
|
||||
* @param focalLength: camera optical zoom focal length.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetOpticalZoomFocalLength)(uint32_t focalLength);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera optical zoom focal length.
|
||||
* @param focalLength: pointer to memory space used to store camera optical zoom focal length.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetOpticalZoomFocalLength)(uint32_t *focalLength);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera optical zoom factor.
|
||||
* @param factor: pointer to memory space used to store camera optical zoom factor.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetOpticalZoomFactor)(dji_f32_t *factor);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera optical zoom specifies.
|
||||
* @param spec: pointer to memory space used to store camera optical zoom specifies.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetOpticalZoomSpec)(T_DjiCameraOpticalZoomSpec *spec);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to start continuous optical zoom.
|
||||
* @param direction: camera zoom direction.
|
||||
* @param speed: camera zoom speed.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartContinuousOpticalZoom)(E_DjiCameraZoomDirection direction, E_DjiCameraZoomSpeed speed);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to stop continuous optical zoom.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StopContinuousOpticalZoom)(void);
|
||||
} T_DjiCameraOpticalZoomHandler;
|
||||
|
||||
/**
|
||||
* @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 dji
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera media file path.
|
||||
* @warning The maximum length of path that users can pass in is 256, including end character '\0'.
|
||||
* @param dirPath: pointer to memory space used to store camera media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileDir)(char *dirPath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the file info of the selected origin media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param fileInfo: pointer to memory space used to store file info of the selected origin media file.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileOriginInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the data of the selected origin media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param offset: the offset of origin file data that need get from the selected media file.
|
||||
* @param length: the length of origin file data that need get from the selected media file.
|
||||
* @param data: pointer to memory space used to store the selected origin media file.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileOriginData)(const char *filePath, uint32_t offset, uint32_t length, uint8_t *data);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to create the thumb nail of selected media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*CreateMediaFileThumbNail)(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the file info of the created thumbnail.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param fileInfo: pointer to memory space used to store file info of the created thumbnail.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileThumbNailInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the data of the created thumbnail.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param offset: the offset of thumb nail data that need get from the selected media file.
|
||||
* @param length: the length of thumb nail data that need get from the selected media file.
|
||||
* @param data: pointer to memory space used to store the created thumbnail data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileThumbNailData)(const char *filePath, uint32_t offset, uint32_t length,
|
||||
uint8_t *data);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to destroy the created thumb nail of selected media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*DestroyMediaFileThumbNail)(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to create the screen nail of selected media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*CreateMediaFileScreenNail)(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the data of the created screen nail.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param offset: the offset of screen nail data that need get from selected media file.
|
||||
* @param length: the length of screen nail data that need get from selected media file.
|
||||
* @param data: pointer to memory space used to store the created screen nail data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileScreenNailData)(const char *filePath, uint32_t offset, uint32_t length,
|
||||
uint8_t *data);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the file info of the created screen nail.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @param fileInfo: pointer to memory space used to store file info of the created screen nail.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaFileScreenNailInfo)(const char *filePath, T_DjiCameraMediaFileInfo *fileInfo);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to destroy the created screen nail of selected media file.
|
||||
* @param dirPath: pointer to memory space used to store camera current media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*DestroyMediaFileScreenNail)(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to notification when download starting.
|
||||
* @note You can adjust the bandwidth proportion of each high speed channel in the notification callback.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartDownloadNotification)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to notification when download stoping.
|
||||
* @note You can adjust the bandwidth proportion of each high speed channel in the notification callback.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StopDownloadNotification)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to delete the user's media files.
|
||||
* @param filePath: pointer to memory space used to store camera current media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*DeleteMediaFile)(char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get camera media playback status.
|
||||
* @param status: pointer to memory space used to store camera media file path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetMediaPlaybackStatus)(T_DjiCameraPlaybackStatus *status);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set the file path of media file that need playback.
|
||||
* @param filePath: pointer to memory space used to store the file path of media file that need playback.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetMediaPlaybackFile)(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to start media video playback when camera work in playback mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartMediaPlayback)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to stop media video playback when camera work in playback mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StopMediaPlayback)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to pause media video playback when camera work in playback mode.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*PauseMediaPlayback)(void);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to seek to the playback position of media video when camera work in playback mode.
|
||||
* @param playbackPosition: playback position of video media, unit: ms.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SeekMediaPlayback)(uint32_t playbackPosition);
|
||||
} T_DjiCameraMediaDownloadPlaybackHandler;
|
||||
|
||||
/**
|
||||
* @brief Prototype of handler functions for tap zooming.
|
||||
* @note User can not execute blocking style operations or functions in callback function, like djiXPort_RotateSync()
|
||||
* function, because that will block dji root thread, causing problems such as slow system response, payload
|
||||
* disconnection or infinite loop.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to get tap zoom state.
|
||||
* @param state: pointer to memory space used to store tap zoom state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetTapZoomState)(T_DjiCameraTapZoomState *state);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to enable or disable tap zoom function.
|
||||
* @details dji application should response tap zoom command only if tap zoom function is enabled.
|
||||
* @param enabledFlag: enabled flag.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetTapZoomEnabled)(bool enabledFlag);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get the flag that specifies whether tap zoom function has been
|
||||
* enabled,
|
||||
* @param enabledFlag: pointer to memory space used to store enabled flag.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetTapZoomEnabled)(bool *enabledFlag);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set multiplier of single tap zoom.
|
||||
* @param multiplier: multiplier of single tap zoom.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetTapZoomMultiplier)(uint8_t multiplier);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get multiplier of single tap zoom.
|
||||
* @param multiplier: pointer to memory space use to store multiplier of single tap zoom.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetTapZoomMultiplier)(uint8_t *multiplier);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to trigger tap zoom.
|
||||
* @details Users trigger tap zoom in screen of mobile end, this callback function will be called. Then, dji
|
||||
* application should rotate gimbal to orientation of target point and zoom by specified multiplier.
|
||||
* @param target: position information of target point in screen.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*TapZoomAtTarget)(T_DjiCameraPointInScreen target);
|
||||
} T_DjiCameraTapZoomHandler;
|
||||
|
||||
/* 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 djiCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_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 DjiPayloadCamera_Init.
|
||||
* @param cameraCommonHandler: pointer to the handler for payload camera common functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegCommonHandler(const T_DjiCameraCommonHandler *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 DjiPayloadCamera_Init.
|
||||
* @param cameraExposureMeteringHandler: pointer to the handler for payload camera exposure and metering functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegExposureMeteringHandler(const T_DjiCameraExposureMeteringHandler
|
||||
*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 DjiPayloadCamera_Init.
|
||||
* @param cameraFocusHandler: pointer to the handler for payload camera focus functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegFocusHandler(const T_DjiCameraFocusHandler *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 DjiPayloadCamera_Init.
|
||||
* @param cameraDigitalZoomHandler: pointer to the handler for payload camera digital zoom functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegDigitalZoomHandler(const T_DjiCameraDigitalZoomHandler
|
||||
*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 DjiPayloadCamera_Init.
|
||||
* @param cameraOpticalZoomHandler: pointer to the handler for payload camera optical zoom functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegOpticalZoomHandler(const T_DjiCameraOpticalZoomHandler
|
||||
*cameraOpticalZoomHandler);
|
||||
|
||||
/**
|
||||
* @brief Register handler functions for tap zoom function.
|
||||
* @details Registration specifies dji application support tap zoom function.
|
||||
* @param cameraTapZoomHandler: pointer to structure of handler functions for tap zoom function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_RegTapZoomHandler(const T_DjiCameraTapZoomHandler *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_DjiCameraVideoStreamType, please refer to developer documentation for more details.
|
||||
* @attention Set video stream type must before calling djiCore_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 ::DJI_CAMERA_VIDEO_STREAM_TYPE_H264_CUSTOM_FORMAT will be used.
|
||||
* @param videoStreamType: camera video stream type.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_SetVideoStreamType(E_DjiCameraVideoStreamType 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 djiCore_Init function.
|
||||
* @attention If you want use this interface, should call djiPlatform_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_DjiReturnCode DjiPayloadCamera_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_DjiReturnCode DjiPayloadCamera_RegMediaDownloadPlaybackHandler(const T_DjiCameraMediaDownloadPlaybackHandler
|
||||
*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 DjiPayloadCamera_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_DjiReturnCode DjiPayloadCamera_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_DjiReturnCode DjiPayloadCamera_GetVideoStreamState(T_DjiDataChannelState *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 ::dji_FILE_PATH_SIZE_MAX bytes.
|
||||
* @param mediaFileInfo: information of added media file.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPayloadCamera_PushAddedMediaFileInfo(const char *filePath, T_DjiCameraMediaFileInfo mediaFileInfo);
|
||||
|
||||
/**
|
||||
* @brief Get camera type of other payloads mounted on aircraft.
|
||||
* @note Please refer to DJI 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_DjiReturnCode DjiPayloadCamera_GetCameraTypeOfPayload(E_DjiMountPosition payloadPosition,
|
||||
E_DjiCameraType *cameraType);
|
||||
|
||||
/**
|
||||
* @brief Get optical zoom specification of other camera payloads mounted on aircraft.
|
||||
* @note Please refer to DJI 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_DjiReturnCode DjiPayloadCamera_GetCameraOpticalZoomSpecOfPayload(E_DjiMountPosition payloadPosition,
|
||||
T_DjiCameraOpticalZoomSpec *opticalZoomSpec);
|
||||
|
||||
/**
|
||||
* @brief Get hybrid zoom focal length of other camera payloads mounted on aircraft.
|
||||
* @note Please refer to DJI 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_DjiReturnCode DjiPayloadCamera_GetCameraHybridZoomFocalLengthOfPayload(E_DjiMountPosition payloadPosition,
|
||||
uint16_t *focalLength);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_PAYLOAD_CAMERA_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
167
PSDK/psdk_lib/include/dji_perception.h
Normal file
167
PSDK/psdk_lib/include/dji_perception.h
Normal file
@ -0,0 +1,167 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_perception.h
|
||||
* @brief This is the header file for "dji_perception.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 DJI_PERCEPTION_H
|
||||
#define DJI_PERCEPTION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define IMAGE_MAX_DIRECTION_NUM 6
|
||||
#define DJI_PERCEPTION_INTRINSICS_PARAM_ARRAY_NUM 9
|
||||
#define DJI_PERCEPTION_ROTATION_PARAM_ARRAY_NUM 9
|
||||
#define DJI_PERCEPTION_TRANSLATION_PARAM_ARRAY_NUM 3
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @bref Perception camera direction
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_PERCEPTION_RECTIFY_DOWN = 0,
|
||||
DJI_PERCEPTION_RECTIFY_FRONT = 1,
|
||||
DJI_PERCEPTION_RECTIFY_REAR = 2,
|
||||
DJI_PERCEPTION_RECTIFY_UP = 3,
|
||||
DJI_PERCEPTION_RECTIFY_LEFT = 4,
|
||||
DJI_PERCEPTION_RECTIFY_RIGHT = 5
|
||||
} E_DjiPerceptionDirection;
|
||||
|
||||
/**
|
||||
* @bref Perception camera design location
|
||||
*/
|
||||
typedef enum {
|
||||
RECTIFY_DOWN_LEFT = 1,
|
||||
RECTIFY_DOWN_RIGHT = 2,
|
||||
RECTIFY_FRONT_LEFT = 3,
|
||||
RECTIFY_FRONT_RIGHT = 4,
|
||||
RECTIFY_REAR_LEFT = 5,
|
||||
RECTIFY_REAR_RIGHT = 6,
|
||||
RECTIFY_UP_LEFT = 21,
|
||||
RECTIFY_UP_RIGHT = 22,
|
||||
RECTIFY_LEFT_LEFT = 23,
|
||||
RECTIFY_LEFT_RIGHT = 24,
|
||||
RECTIFY_RIGHT_LEFT = 25,
|
||||
RECTIFY_RIGHT_RIGHT = 26
|
||||
} E_DjiPerceptionCameraPosition;
|
||||
|
||||
#pragma pack(1)
|
||||
/**
|
||||
* @bref Perception camera ram image info
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t index;
|
||||
uint8_t direction;
|
||||
uint8_t bpp;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} T_DjiPerceptionRawImageInfo;
|
||||
|
||||
/**
|
||||
* @bref Perception camera image info
|
||||
*/
|
||||
typedef struct {
|
||||
T_DjiPerceptionRawImageInfo rawInfo;
|
||||
uint16_t dataId;
|
||||
uint16_t sequence;
|
||||
//see enum E_DjiPerceptionCamPosition
|
||||
uint32_t dataType;
|
||||
uint64_t timeStamp;
|
||||
} T_DjiPerceptionImageInfo;
|
||||
|
||||
/**
|
||||
* @bref Perception camera parameters
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t direction;
|
||||
float leftIntrinsics[DJI_PERCEPTION_INTRINSICS_PARAM_ARRAY_NUM];
|
||||
float rightIntrinsics[DJI_PERCEPTION_INTRINSICS_PARAM_ARRAY_NUM];
|
||||
float rotationLeftInRight[DJI_PERCEPTION_ROTATION_PARAM_ARRAY_NUM];
|
||||
float translationLeftInRight[DJI_PERCEPTION_TRANSLATION_PARAM_ARRAY_NUM];
|
||||
} T_DjiPerceptionCameraParameters;
|
||||
|
||||
/**
|
||||
* @bref Perception camera parameters packet
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t timeStamp;
|
||||
uint32_t directionNum;
|
||||
T_DjiPerceptionCameraParameters cameraParameters[IMAGE_MAX_DIRECTION_NUM];
|
||||
} T_DjiPerceptionCameraParametersPacket;
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
* @bref Callback type to receive stereo camera image
|
||||
*/
|
||||
typedef void(*DjiPerceptionImageCallback)(T_DjiPerceptionImageInfo imageInfo, uint8_t *imageRawBuffer,
|
||||
uint32_t bufferLen);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialize the perception module.
|
||||
* @note The interface initialization needs to be after DjiCore_Init.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize the perception module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_Deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Subscribe the raw images of both stereo cameras in the same direction. Default frequency at 20 Hz.
|
||||
* @param direction: direction to specify the direction of the subscription. Ref to E_DjiPerceptionDirection
|
||||
* @param callback callback to observer the stereo camera image and info.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPerception_SubscribePerceptionImage(E_DjiPerceptionDirection direction,
|
||||
DjiPerceptionImageCallback callback);
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_PERCEPTION_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
367
PSDK/psdk_lib/include/dji_platform.h
Normal file
367
PSDK/psdk_lib/include/dji_platform.h
Normal file
@ -0,0 +1,367 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_platform.h
|
||||
* @brief This is the header file for "dji_platform.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 DJI_PLATFORM_H
|
||||
#define DJI_PLATFORM_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Platform handle of uart operation.
|
||||
*/
|
||||
typedef void *T_DjiUartHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of usb bulk operation.
|
||||
*/
|
||||
typedef void *T_DjiUsbBulkHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of network operation.
|
||||
*/
|
||||
typedef void *T_DjiNetworkHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of thread task operation.
|
||||
*/
|
||||
typedef void *T_DjiTaskHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of mutex operation.
|
||||
*/
|
||||
typedef void *T_DjiMutexHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of semaphore operation.
|
||||
*/
|
||||
typedef void *T_DjiSemaHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of file operation.
|
||||
*/
|
||||
typedef void *T_DjiFileHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of dir operation.
|
||||
*/
|
||||
typedef void *T_DjiDirHandle;
|
||||
|
||||
/**
|
||||
* @brief Platform handle of socket operation.
|
||||
*/
|
||||
typedef void *T_DjiSocketHandle;
|
||||
|
||||
typedef enum {
|
||||
DJI_HAL_UART_NUM_0,
|
||||
DJI_HAL_UART_NUM_1,
|
||||
} E_DjiHalUartNum;
|
||||
|
||||
typedef enum {
|
||||
DJI_HAL_USB_BULK_NUM_0 = 0,
|
||||
DJI_HAL_USB_BULK_NUM_1,
|
||||
DJI_HAL_USB_BULK_NUM_MAX,
|
||||
} E_DjiHalUsbBulkNum;
|
||||
|
||||
typedef enum {
|
||||
DJI_SOCKET_MODE_UDP,
|
||||
DJI_SOCKET_MODE_TCP,
|
||||
} E_DjiSocketMode;
|
||||
|
||||
typedef struct {
|
||||
bool isConnect;
|
||||
} T_DjiUartStatus;
|
||||
|
||||
typedef struct {
|
||||
uint16_t year;
|
||||
uint8_t month;
|
||||
uint8_t day;
|
||||
uint8_t hour;
|
||||
uint8_t minute;
|
||||
uint8_t second;
|
||||
} T_DjiTime;
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
T_DjiTime createTime;
|
||||
T_DjiTime modifyTime;
|
||||
char path[DJI_FILE_PATH_SIZE_MAX];
|
||||
bool isDir;
|
||||
} T_DjiFileInfo;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UartInit)(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUartHandle *uartHandle);
|
||||
|
||||
T_DjiReturnCode (*UartDeInit)(T_DjiUartHandle uartHandle);
|
||||
|
||||
T_DjiReturnCode (*UartWriteData)(T_DjiUartHandle uartHandle, const uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UartReadData)(T_DjiUartHandle uartHandle, uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UartGetStatus)(E_DjiHalUartNum uartNum, T_DjiUartStatus *status);
|
||||
} T_DjiHalUartHandler;
|
||||
|
||||
typedef struct {
|
||||
uint16_t interfaceNum;
|
||||
uint16_t endPointIn;
|
||||
uint16_t endPointOut;
|
||||
} T_DjiHalUsbBulkChannelInfo;
|
||||
|
||||
typedef struct {
|
||||
bool isUsbHost;
|
||||
// attention: if 'isUsbHost' equals false, the following parameters is not valid.
|
||||
uint16_t pid;
|
||||
uint16_t vid;
|
||||
T_DjiHalUsbBulkChannelInfo channelInfo;
|
||||
} T_DjiHalUsbBulkInfo;
|
||||
|
||||
typedef struct {
|
||||
uint16_t pid;
|
||||
uint16_t vid;
|
||||
T_DjiHalUsbBulkChannelInfo channelInfo[DJI_HAL_USB_BULK_NUM_MAX];
|
||||
} T_DjiHalUsbBulkDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
uint16_t vid;
|
||||
uint16_t pid;
|
||||
} usbNetAdapter;
|
||||
} T_DjiHalNetworkDeviceInfo;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*UsbBulkInit)(T_DjiHalUsbBulkInfo usbBulkInfo, T_DjiUsbBulkHandle *usbBulkHandle);
|
||||
|
||||
T_DjiReturnCode (*UsbBulkDeInit)(T_DjiUsbBulkHandle usbBulkHandle);
|
||||
|
||||
T_DjiReturnCode (*UsbBulkWriteData)(T_DjiUsbBulkHandle usbBulkHandle, const uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UsbBulkReadData)(T_DjiUsbBulkHandle usbBulkHandle, uint8_t *buf,
|
||||
uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UsbBulkGetDeviceInfo)(T_DjiHalUsbBulkDeviceInfo *deviceInfo);
|
||||
} T_DjiHalUsbBulkHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*NetworkInit)(const char *ipAddr, const char *netMask, T_DjiNetworkHandle *networkHandle);
|
||||
|
||||
T_DjiReturnCode (*NetworkDeInit)(T_DjiNetworkHandle networkHandle);
|
||||
|
||||
T_DjiReturnCode (*NetworkGetDeviceInfo)(T_DjiHalNetworkDeviceInfo *deviceInfo);
|
||||
} T_DjiHalNetworkHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*TaskCreate)(const char *name, void *(*taskFunc)(void *),
|
||||
uint32_t stackSize, void *arg, T_DjiTaskHandle *task);
|
||||
|
||||
T_DjiReturnCode (*TaskDestroy)(T_DjiTaskHandle task);
|
||||
|
||||
T_DjiReturnCode (*TaskSleepMs)(uint32_t timeMs);
|
||||
|
||||
T_DjiReturnCode (*MutexCreate)(T_DjiMutexHandle *mutex);
|
||||
|
||||
T_DjiReturnCode (*MutexDestroy)(T_DjiMutexHandle mutex);
|
||||
|
||||
T_DjiReturnCode (*MutexLock)(T_DjiMutexHandle mutex);
|
||||
|
||||
T_DjiReturnCode (*MutexUnlock)(T_DjiMutexHandle mutex);
|
||||
|
||||
T_DjiReturnCode (*SemaphoreCreate)(uint32_t initValue, T_DjiSemaHandle *semaphore);
|
||||
|
||||
T_DjiReturnCode (*SemaphoreDestroy)(T_DjiSemaHandle semaphore);
|
||||
|
||||
T_DjiReturnCode (*SemaphoreWait)(T_DjiSemaHandle semaphore);
|
||||
|
||||
T_DjiReturnCode (*SemaphoreTimedWait)(T_DjiSemaHandle semaphore, uint32_t waitTimeMs);
|
||||
|
||||
T_DjiReturnCode (*SemaphorePost)(T_DjiSemaHandle semaphore);
|
||||
|
||||
T_DjiReturnCode (*GetTimeMs)(uint32_t *ms);
|
||||
|
||||
T_DjiReturnCode (*GetTimeUs)(uint64_t *us);
|
||||
|
||||
void *(*Malloc)(uint32_t size);
|
||||
|
||||
void (*Free)(void *ptr);
|
||||
} T_DjiOsalHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*FileOpen)(const char *fileName, const char *fileMode, T_DjiFileHandle *fileObj);
|
||||
|
||||
T_DjiReturnCode (*FileClose)(T_DjiFileHandle fileObj);
|
||||
|
||||
T_DjiReturnCode (*FileWrite)(T_DjiFileHandle fileObj, const uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*FileRead)(T_DjiFileHandle fileObj, uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*FileSeek)(T_DjiFileHandle fileObj, uint32_t offset);
|
||||
|
||||
T_DjiReturnCode (*FileSync)(T_DjiFileHandle fileObj);
|
||||
|
||||
T_DjiReturnCode (*DirOpen)(const char *filePath, T_DjiDirHandle *dirObj);
|
||||
|
||||
T_DjiReturnCode (*DirClose)(T_DjiDirHandle dirObj);
|
||||
|
||||
T_DjiReturnCode (*DirRead)(T_DjiDirHandle dirObj, T_DjiFileInfo *fileInfo);
|
||||
|
||||
T_DjiReturnCode (*Mkdir)(const char *filePath);
|
||||
|
||||
T_DjiReturnCode (*Unlink)(const char *filePath);
|
||||
|
||||
T_DjiReturnCode (*Rename)(const char *oldFilePath, const char *newFilePath);
|
||||
|
||||
T_DjiReturnCode (*Stat)(const char *filePath, T_DjiFileInfo *fileInfo);
|
||||
} T_DjiFileSystemHandler;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*Socket)(E_DjiSocketMode mode, T_DjiSocketHandle *socketHandle);
|
||||
|
||||
T_DjiReturnCode (*Close)(T_DjiSocketHandle socketHandle);
|
||||
|
||||
T_DjiReturnCode (*Bind)(T_DjiSocketHandle socketHandle, const char *ipAddr, uint32_t port);
|
||||
|
||||
T_DjiReturnCode (*UdpSendData)(T_DjiSocketHandle socketHandle, const char *ipAddr, uint32_t port,
|
||||
const uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*UdpRecvData)(T_DjiSocketHandle socketHandle, char *ipAddr, uint32_t *port,
|
||||
uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*TcpListen)(T_DjiSocketHandle socketHandle);
|
||||
|
||||
T_DjiReturnCode (*TcpAccept)(T_DjiSocketHandle socketHandle, char *ipAddr, uint32_t *port,
|
||||
T_DjiSocketHandle *outSocketHandle);
|
||||
|
||||
T_DjiReturnCode (*TcpConnect)(T_DjiSocketHandle socketHandle, const char *ipAddr, uint32_t port);
|
||||
|
||||
T_DjiReturnCode (*TcpSendData)(T_DjiSocketHandle socketHandle,
|
||||
const uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
|
||||
T_DjiReturnCode (*TcpRecvData)(T_DjiSocketHandle socketHandle,
|
||||
uint8_t *buf, uint32_t len, uint32_t *realLen);
|
||||
} T_DjiSocketHandler;
|
||||
|
||||
/* 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_DjiReturnCode DjiPlatform_RegHalUartHandler(const T_DjiHalUartHandler *halUartHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for usb bulk interfaces by your platform.
|
||||
* @param fileSystemHandler: pointer to the handler for usb bulk interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegHalUsbBulkHandler(const T_DjiHalUsbBulkHandler *halUsbBulkHandler);
|
||||
|
||||
/**
|
||||
* @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_DjiReturnCode DjiPlatform_RegHalNetworkHandler(const T_DjiHalNetworkHandler *halNetworkHandler);
|
||||
|
||||
/**
|
||||
* @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_DjiReturnCode DjiPlatform_RegOsalHandler(const T_DjiOsalHandler *osalHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for file-system interfaces by your platform.
|
||||
* @param fileSystemHandler: pointer to the handler for file-system interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegFileSystemHandler(const T_DjiFileSystemHandler *fileSystemHandler);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for socket interfaces by your platform.
|
||||
* @param fileSystemHandler: pointer to the handler for socket interfaces by your platform.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPlatform_RegSocketHandler(const T_DjiSocketHandler *socketHandler);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of osal interfaces.
|
||||
* @return Pointer to osal handler.
|
||||
*/
|
||||
T_DjiOsalHandler *DjiPlatform_GetOsalHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of usb bulk interfaces.
|
||||
* @return Pointer to usb bulk handler.
|
||||
*/
|
||||
T_DjiHalUsbBulkHandler *DjiPlatform_GetHalUsbBulkHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of network interfaces.
|
||||
* @return Pointer to network handler.
|
||||
*/
|
||||
T_DjiHalNetworkHandler *DjiPlatform_GetHalNetworkHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of file-system interfaces.
|
||||
* @return Pointer to file-system handler.
|
||||
*/
|
||||
T_DjiFileSystemHandler *DjiPlatform_GetFileSystemHandler(void);
|
||||
|
||||
/**
|
||||
* @brief Get the handler of socket interfaces.
|
||||
* @return Pointer to socket handler.
|
||||
*/
|
||||
T_DjiSocketHandler *DjiPlatform_GetSocketHandler(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_PLATFORM_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
137
PSDK/psdk_lib/include/dji_positioning.h
Normal file
137
PSDK/psdk_lib/include/dji_positioning.h
Normal file
@ -0,0 +1,137 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_positioning.h
|
||||
* @brief This is the header file for "dji_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 DJI_POSITIONING_H
|
||||
#define DJI_POSITIONING_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
#include "dji_time_sync.h"
|
||||
#include "dji_fc_subscription.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Data structure that describes a positioning event.
|
||||
*/
|
||||
typedef struct {
|
||||
/*! Index of event set in which positioning event is located. The item will be written to mark file in aircraft for
|
||||
* some post-precess work. If not needed, fill in 0. */
|
||||
uint16_t eventSetIndex;
|
||||
/*! Index of target point in payload whose position user is requesting. The item will be written to mark file in
|
||||
* aircraft for some post-precess work. If not needed, fill in 0. */
|
||||
uint8_t targetPointIndex;
|
||||
/*! Timestamp in aircraft time system when the positioning event occur. Users should transfer time in local time
|
||||
* system to time in aircraft time system by DjiTimeSync_TransferToAircraftTime() interface in time
|
||||
* synchronization module. */
|
||||
T_DjiTimeSyncAircraftTime eventTime;
|
||||
} T_DjiPositioningEventInfo;
|
||||
|
||||
/**
|
||||
* @brief Data structure that describes position of a point.
|
||||
*/
|
||||
typedef struct {
|
||||
dji_f64_t longitude; /*!< Specifies longitude, unit: degree. */
|
||||
dji_f64_t latitude; /*!< Specifies latitude, unit: degree. */
|
||||
dji_f64_t height; /*!< Specifies height above sea level, unit: m. */
|
||||
} T_DjiPositioningPosition;
|
||||
|
||||
/**
|
||||
* @brief Position value standard deviation.
|
||||
*/
|
||||
typedef struct {
|
||||
dji_f32_t longitude; /*!< Specifies longitude standard deviation, unit: degree. */
|
||||
dji_f32_t latitude; /*!< Specifies latitude standard deviation, unit: degree. */
|
||||
dji_f32_t height; /*!< Specifies height standard deviation, unit: m. */
|
||||
} T_DjiPositioningPositionStandardDeviation;
|
||||
|
||||
/**
|
||||
* @brief Position of target point and other details returned by interface of requesting position.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiFcSubscriptionPositionSolutionProperty positionSolutionProperty; /*!< Property of position solution. */
|
||||
T_DjiAttitude3d uavAttitude; /*!< Specifies UAV attitude, unit: degree. */
|
||||
T_DjiVector3d offsetBetweenMainAntennaAndTargetPoint; /*!< Specifies position offset from RTK main antenna to target points in NED coordinate system, unit: mm. */
|
||||
T_DjiPositioningPosition targetPointPosition; /*!< Specifies position of target points in GROUND coordinate system. */
|
||||
T_DjiPositioningPositionStandardDeviation targetPointPositionStandardDeviation; /*!< Specifies position standard deviation of target points. */
|
||||
} T_DjiPositioningPositionInfo;
|
||||
|
||||
/* 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_DjiReturnCode DjiPositioning_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 DjiPositioning_SetTaskIndex(uint8_t index);
|
||||
|
||||
/**
|
||||
* @brief The interface is used to get the position of target points and other information (refer to
|
||||
* ::T_DjiPositioningPositionInfo) 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
|
||||
* DjiPositioning_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_DjiReturnCode DjiPositioning_GetPositionInformationSync(uint8_t eventCount, T_DjiPositioningEventInfo *eventInfo,
|
||||
T_DjiPositioningPositionInfo *positionInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DJI_POSITIONING_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
111
PSDK/psdk_lib/include/dji_power_management.h
Normal file
111
PSDK/psdk_lib/include/dji_power_management.h
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_power_management.h
|
||||
* @brief This is the header file for "dji_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 DJI_POWER_MANAGEMENT_H
|
||||
#define DJI_POWER_MANAGEMENT_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Pin state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_POWER_MANAGEMENT_PIN_STATE_RESET = 0, /*!< Specifies pin is in low level state. */
|
||||
DJI_POWER_MANAGEMENT_PIN_STATE_SET = 1, /*!< Specifies pin is in high level state. */
|
||||
} E_DjiPowerManagementPinState;
|
||||
|
||||
/**
|
||||
* @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 T_DjiReturnCode (*DjiWriteHighPowerApplyPinCallback)(E_DjiPowerManagementPinState pinState);
|
||||
|
||||
/**
|
||||
* @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 DJI
|
||||
* 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 T_DjiReturnCode (*DjiPowerOffNotificationCallback)(bool *powerOffPreparationFlag);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise power management module, and user should call this function before using power management features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_Init(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.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiPowerManagement_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_DjiReturnCode DjiPowerManagement_RegWriteHighPowerApplyPinCallback(DjiWriteHighPowerApplyPinCallback 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_DjiReturnCode DjiPowerManagement_RegPowerOffNotificationCallback(DjiPowerOffNotificationCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_POWER_MANAGEMENT_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
99
PSDK/psdk_lib/include/dji_time_sync.h
Normal file
99
PSDK/psdk_lib/include/dji_time_sync.h
Normal file
@ -0,0 +1,99 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_time_sync.h
|
||||
* @brief This is the header file for "dji_time_sync.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 DJI_TIME_SYNC_H
|
||||
#define DJI_TIME_SYNC_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.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 DJI
|
||||
* 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 T_DjiReturnCode (*DjiGetNewestPpsTriggerLocalTimeUsCallback)(uint64_t *localTimeUs);
|
||||
|
||||
/**
|
||||
* @brief Data structure of time in aircraft time system.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t year; /*!< Specifies year. */
|
||||
uint8_t month; /*!< Specifies month, range from 1 to 12. */
|
||||
uint8_t day; /*!< Specifies day, range from 1 to 31. */
|
||||
uint8_t hour; /*!< Specifies hour, range from 0 to 23. */
|
||||
uint8_t minute; /*!< Specifies minute, range from 0 to 59. */
|
||||
uint8_t second; /*!< Specifies second, range from 0 to 59. */
|
||||
uint32_t microsecond; /*!< Specifies microsecond, range from 0 to 999999. */
|
||||
} T_DjiTimeSyncAircraftTime;
|
||||
|
||||
/* 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_DjiReturnCode DjiTimeSync_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Register callback function used to get the newest timestamp in local time system when PPS rising edge signal
|
||||
* is detected.
|
||||
* @details DJI 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_DjiReturnCode DjiTimeSync_RegGetNewestPpsTriggerTimeCallback(DjiGetNewestPpsTriggerLocalTimeUsCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Transfer local time to time in aircraft time system.
|
||||
* @note Before calling the interface, users must call DjiTimeSync_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_DjiReturnCode DjiTimeSync_TransferToAircraftTime(uint64_t localTimeUs, T_DjiTimeSyncAircraftTime *aircraftTime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DJI_TIME_SYNC_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
383
PSDK/psdk_lib/include/dji_typedef.h
Normal file
383
PSDK/psdk_lib/include/dji_typedef.h
Normal file
@ -0,0 +1,383 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_typedef.h
|
||||
* @brief This is the header file for "dji_typedef.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 DJI_TYPEDEF_H
|
||||
#define DJI_TYPEDEF_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "dji_error.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define DJI_PI (3.14159265358979323846f)
|
||||
#define DJI_FILE_NAME_SIZE_MAX 256
|
||||
#define DJI_FILE_PATH_SIZE_MAX (DJI_FILE_NAME_SIZE_MAX + 256)
|
||||
#define DJI_IP_ADDR_STR_SIZE_MAX 15
|
||||
#define DJI_MD5_BUFFER_LEN 16
|
||||
|
||||
#define DJI_SUBSCRIPTION_MODULE_INDEX_OFFSET 24u
|
||||
#define DJI_SUBSCRIPTION_MODULE_INDEX_MASK 0xFF000000u
|
||||
#define DJI_SUBSCRIPTION_TOPIC_CODE_OFFSET 0u
|
||||
#define DJI_SUBSCRIPTION_TOPIC_CODE_MASK 0x00FFFFFFu
|
||||
|
||||
#define DJI_DATA_SUBSCRIPTION_TOPIC(subscriptionModule, topicCode) \
|
||||
(uint32_t)\
|
||||
(((((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)))
|
||||
|
||||
/**
|
||||
* @brief Type define double as dji_f64_t.
|
||||
*/
|
||||
typedef double dji_f64_t;
|
||||
/**
|
||||
* @brief Type define float as dji_f32_t.
|
||||
*/
|
||||
typedef float dji_f32_t;
|
||||
/**
|
||||
* @brief Type define uint64 as T_DjiReturnCode.
|
||||
* @details The type can be any value of ::DjiErrorCode.
|
||||
*/
|
||||
typedef uint64_t T_DjiReturnCode;
|
||||
|
||||
typedef enum {
|
||||
DJI_MOUNT_POSITION_TYPE_UNKNOWN = 0,
|
||||
DJI_MOUNT_POSITION_TYPE_PAYLOAD_PORT = 1,
|
||||
DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT = 2
|
||||
} E_DjiMountPositionType;
|
||||
|
||||
typedef enum {
|
||||
DJI_MOUNT_POSITION_UNKNOWN = 0,
|
||||
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
|
||||
} E_DjiMountPosition;
|
||||
|
||||
typedef enum {
|
||||
DJI_AIRCRAFT_SERIES_UNKNOWN = 0,
|
||||
DJI_AIRCRAFT_SERIES_M200_V2 = 1,
|
||||
DJI_AIRCRAFT_SERIES_M300 = 2,
|
||||
DJI_AIRCRAFT_SERIES_M30 = 3,
|
||||
DJI_AIRCRAFT_SERIES_M3 = 4,
|
||||
} E_DjiAircraftSeries;
|
||||
|
||||
typedef enum {
|
||||
DJI_AIRCRAFT_TYPE_UNKNOWN = 0, /*!< Aircraft type is unknown. */
|
||||
DJI_AIRCRAFT_TYPE_M200_V2 = 44, /*!< Aircraft type is Matrice 200 V2. */
|
||||
DJI_AIRCRAFT_TYPE_M210_V2 = 45, /*!< Aircraft type is Matrice 220 V2. */
|
||||
DJI_AIRCRAFT_TYPE_M210RTK_V2 = 46, /*!< Aircraft type is Matrice 210 RTK V2. */
|
||||
DJI_AIRCRAFT_TYPE_M300_RTK = 60, /*!< Aircraft type is Matrice 300 RTK. */
|
||||
DJI_AIRCRAFT_TYPE_M30 = 67, /*!< Aircraft type is Matrice 30. */
|
||||
DJI_AIRCRAFT_TYPE_M30T = 68, /*!< Aircraft type is Matrice 30T. */
|
||||
DJI_AIRCRAFT_TYPE_M3E = 77, /*!< Aircraft type is Mavic 3E. */
|
||||
DJI_AIRCRAFT_TYPE_M3T = 79, /*!< Aircraft type is Mavic 3T. */
|
||||
} E_DjiAircraftType;
|
||||
|
||||
/**
|
||||
* @brief Camera type.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_TYPE_UNKNOWN = 0, /*!< Camera type is unknown. */
|
||||
DJI_CAMERA_TYPE_Z30 = 20, /*!< Camera type is Z30. */
|
||||
DJI_CAMERA_TYPE_XT2 = 26, /*!< Camera type is XT2. */
|
||||
DJI_CAMERA_TYPE_PSDK = 31, /*!< Camera type is third party camera based on Payload SDK. */
|
||||
DJI_CAMERA_TYPE_XTS = 41, /*!< Camera type is XT S. */
|
||||
DJI_CAMERA_TYPE_H20 = 42, /*!< Camera type is H20. */
|
||||
DJI_CAMERA_TYPE_H20T = 43, /*!< Camera type is H20T. */
|
||||
DJI_CAMERA_TYPE_H20N = 61, /*!< Camera type is H20N. */
|
||||
DJI_CAMERA_TYPE_P1 = 50, /*!< Camera type is P1. */
|
||||
DJI_CAMERA_TYPE_L1, /*!< Camera type is L1. */
|
||||
DJI_CAMERA_TYPE_M30, /*!< Camera type is M30. */
|
||||
DJI_CAMERA_TYPE_M30T, /*!< Camera type is M30T. */
|
||||
DJI_CAMERA_TYPE_M3E, /*!< Camera type is M3E. */
|
||||
DJI_CAMERA_TYPE_M3T, /*!< Camera type is M3T. */
|
||||
} E_DjiCameraType;
|
||||
|
||||
/**
|
||||
* @brief Camera supported media file type.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_FILE_TYPE_JPEG = 0, /*!< Media file JPEG type. */
|
||||
DJI_CAMERA_FILE_TYPE_DNG = 1, /*!< Media file DNG type. */
|
||||
DJI_CAMERA_FILE_TYPE_MOV = 2, /*!< Media file MOV type. */
|
||||
DJI_CAMERA_FILE_TYPE_MP4 = 3, /*!< Media file MP4 type. */
|
||||
DJI_CAMERA_FILE_TYPE_UNKNOWN = 255, /*!< Media file unknown type. */
|
||||
} E_DjiCameraMediaFileType;
|
||||
|
||||
/**
|
||||
* @brief Camera optical zoom specifies.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t maxFocalLength; /*!< The maximum focal length of the lens, unit: 0.1mm. */
|
||||
uint16_t minFocalLength; /*!< The minimum focal length of the lens, unit: 0.1mm. */
|
||||
uint16_t focalLengthStep; /*!< The minimum interval of focal length change, unit: 0.1mm. */
|
||||
} T_DjiCameraOpticalZoomSpec;
|
||||
|
||||
/**
|
||||
* @brief Gimbal work mode, specifies how gimbal follow aircraft movement.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_GIMBAL_MODE_FREE = 0, /*!< Free mode, fix gimbal attitude in the ground coordinate, ignoring movement of aircraft. */
|
||||
DJI_GIMBAL_MODE_FPV = 1, /*!< FPV (First Person View) mode, only control roll and yaw angle of gimbal in the ground coordinate to follow aircraft. */
|
||||
DJI_GIMBAL_MODE_YAW_FOLLOW = 2, /*!< Yaw follow mode, only control yaw angle of gimbal in the ground coordinate to follow aircraft. */
|
||||
} E_DjiGimbalMode;
|
||||
|
||||
/**
|
||||
* @brief Gimbal rotation mode, specifies control style.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE = 0, /*!< Relative angle rotation mode, represents rotating gimbal specified angles based on current angles. */
|
||||
DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE = 1, /*!< Absolute angle rotation mode, represents rotating gimbal to specified angles in the ground coordinate. */
|
||||
DJI_GIMBAL_ROTATION_MODE_SPEED = 2, /*!< Speed rotation mode, specifies rotation speed of gimbal in the ground coordinate. */
|
||||
} E_DjiGimbalRotationMode;
|
||||
|
||||
/**
|
||||
* @brief Mobile APP system language.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_MOBILE_APP_LANGUAGE_UNKNOWN = 255, /*!< The system language of the mobile app is unknown */
|
||||
DJI_MOBILE_APP_LANGUAGE_ENGLISH = 0, /*!< The system language of the mobile app is English */
|
||||
DJI_MOBILE_APP_LANGUAGE_CHINESE = 1, /*!< The system language of the mobile app is Chinese */
|
||||
DJI_MOBILE_APP_LANGUAGE_JAPANESE = 2, /*!< The system language of the mobile app is Japanese */
|
||||
DJI_MOBILE_APP_LANGUAGE_FRENCH = 3, /*!< The system language of the mobile app is French */
|
||||
} E_DjiMobileAppLanguage;
|
||||
|
||||
/**
|
||||
* @brief Mobile APP screen size type.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_MOBILE_APP_SCREEN_TYPE_UNKNOWN = 255, /*!< Mobile APP screen type is unknown. */
|
||||
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN = 0, /*!< The big screen of mobile device refers to a screen
|
||||
* size greater than or equal to 6 inches. */
|
||||
DJI_MOBILE_APP_SCREEN_TYPE_LITTLE_SCREEN = 1, /*!< The little screen of mobile device refers to a
|
||||
* screen size less than 6 inches. */
|
||||
} E_DjiMobileAppScreenType;
|
||||
|
||||
/**
|
||||
* @brief Subscription frequency type.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ = 1,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_5_HZ = 5,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ = 10,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ = 50,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_100_HZ = 100,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_200_HZ = 200,
|
||||
DJI_DATA_SUBSCRIPTION_TOPIC_400_HZ = 400,
|
||||
} E_DjiDataSubscriptionTopicFreq;
|
||||
|
||||
/**
|
||||
* @brief DJI module enum for defining data subscription module.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_DATA_SUBSCRIPTION_MODULE_FC = 0,
|
||||
DJI_DATA_SUBSCRIPTION_MODULE_CAMERA,
|
||||
DJI_DATA_SUBSCRIPTION_MODULE_ERROR,
|
||||
} E_DjiDataSubscriptionModule;
|
||||
|
||||
/**
|
||||
* @brief SDK adapter type.
|
||||
*/
|
||||
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, /*!< don't have any adapter outside */
|
||||
} E_DjiSdkAdapterType;
|
||||
|
||||
typedef enum {
|
||||
DJI_CHANNEL_ADDRESS_UNKNOWN = 0,
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1,
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO2,
|
||||
DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO3,
|
||||
DJI_CHANNEL_ADDRESS_EXTENSION_PORT,
|
||||
DJI_CHANNEL_ADDRESS_MASTER_RC_APP,
|
||||
DJI_CHANNEL_ADDRESS_SLAVE_RC_APP,
|
||||
} E_DjiChannelAddress;
|
||||
|
||||
/**
|
||||
* @brief Camera focus target point when in focus mode.
|
||||
*/
|
||||
typedef struct {
|
||||
dji_f32_t focusX; /*!< Specifies horizontal zone coordinate. This parameter is between 0 and 1.
|
||||
The point [0.0, 0.0] represents the top-left angle of the screen.*/
|
||||
dji_f32_t focusY; /*!< Specifies vertical zone coordinate. This parameter is between 0 and 1. */
|
||||
} T_DjiCameraPointInScreen;
|
||||
|
||||
/**
|
||||
* @brief Camera time interval settings when in interval shootPhoto mode.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t captureCount; /*!< Specifies the total capture count of interval settings.
|
||||
* 0:reserve 1~254:number 255:keep capturing till stop */
|
||||
uint16_t timeIntervalSeconds; /*!< Specifies the interval time between two captures, unit: s*/
|
||||
} T_DjiCameraPhotoTimeIntervalSettings;
|
||||
|
||||
/**
|
||||
* @brief Camera zoom speed.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_ZOOM_SPEED_SLOWEST = 72, /*!< Lens zooms in slowest speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_SLOW = 73, /*!< Lens zooms in slow speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_MODERATELY_SLOW = 74, /*!< Lens zooms in speed slightly slower than normal speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_NORMAL = 75, /*!< Lens zooms in normal speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_MODERATELY_FAST = 76, /*!< Lens zooms very in speed slightly faster than normal speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_FAST = 77, /*!< Lens zooms very in fast speed. */
|
||||
DJI_CAMERA_ZOOM_SPEED_FASTEST = 78, /*!< Lens zooms very in fastest speed. */
|
||||
} E_DjiCameraZoomSpeed;
|
||||
|
||||
typedef enum {
|
||||
/*! The number of pictures to continuously take each time in BURST mode is 2
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_2 = 2,
|
||||
/*! The number of pictures to continuously take each time in BURST mode is 3
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_3 = 3,
|
||||
/*! The number of pictures to continuously take each time in BURST mode is 5
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_5 = 5,
|
||||
/*! The number of pictures to continuously take each time in BURST mode is 7
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_7 = 7,
|
||||
/*! The number of pictures to continuously take at one time in BURST mode is
|
||||
* 10, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_10 = 10,
|
||||
/*! The number of pictures to continuously take at one time in BURST mode is
|
||||
* 14, Only supported by X4S camera, X5S camera and Phantom 4 Pro camera.
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_14 = 14,
|
||||
/*! The camera burst shoot count value is unknown.
|
||||
*/
|
||||
DJI_CAMERA_BURST_COUNT_KNOWN = 0xFF,
|
||||
} E_DjiCameraBurstCount;
|
||||
|
||||
/**
|
||||
* @brief Camera zoom direction.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_CAMERA_ZOOM_DIRECTION_OUT = 0, /*!< The lens moves in the far direction, the zoom factor becomes smaller. */
|
||||
DJI_CAMERA_ZOOM_DIRECTION_IN = 1, /*!< The lens moves in the near direction, the zoom factor becomes larger. */
|
||||
} E_DjiCameraZoomDirection;
|
||||
#pragma pack (1)
|
||||
|
||||
/**
|
||||
* @brief Data channel state.
|
||||
*/
|
||||
typedef struct {
|
||||
/*! Realtime bandwidth limitation, varying with link status of aircraft system for some channels, such as data
|
||||
* stream, video stream and download stream. Must ensure actual bandwidth of data transmission is less than
|
||||
* realtime bandwidth limitation, unit: byte/s. */
|
||||
int32_t realtimeBandwidthLimit;
|
||||
|
||||
/*! Realtime actual transmission bandwidth of data transmission channel calculated before flow controller, unit: byte/s. */
|
||||
int32_t realtimeBandwidthBeforeFlowController;
|
||||
|
||||
/*! Realtime actual transmission bandwidth of data transmission channel calculated after flow controller, unit:
|
||||
* byte/s. If specified channel without flow controller. the value is equal to
|
||||
* ::realtimeBandwidthBeforeFlowController. */
|
||||
int32_t realtimeBandwidthAfterFlowController;
|
||||
|
||||
/*! State specified whether the channel is busy or not. When data can not be sent to the endpoint directly, instead be
|
||||
* sent to buffer of flow controller or discarded, the busy state will be set. At this time, the user should stop
|
||||
* transmitting data or decrease the amount of data to be transmitted via this channel. When data bandwidth restore to
|
||||
* normal, this state will be clear again. */
|
||||
bool busyState;
|
||||
} T_DjiDataChannelState;
|
||||
|
||||
typedef struct Vector3d {
|
||||
int32_t x; /*!< Specifies int32 value of x for vector. */
|
||||
int32_t y; /*!< Specifies int32 value of y for vector. */
|
||||
int32_t z; /*!< Specifies int32 value of z for vector. */
|
||||
} T_DjiVector3d;
|
||||
|
||||
typedef struct Vector3f {
|
||||
dji_f32_t x; /*!< Specifies float value of x for vector. */
|
||||
dji_f32_t y; /*!< Specifies float value of y for vector. */
|
||||
dji_f32_t z; /*!< Specifies float value of z for vector. */
|
||||
} T_DjiVector3f;
|
||||
|
||||
typedef struct {
|
||||
int32_t pitch; /*!< Specifies int32 value of pitch for attitude. */
|
||||
int32_t roll; /*!< Specifies int32 value of roll for attitude */
|
||||
int32_t yaw; /*!< Specifies int32 value of yaw for attitude */
|
||||
} T_DjiAttitude3d;
|
||||
|
||||
typedef struct {
|
||||
dji_f32_t pitch; /*!< Specifies float value of pitch for attitude. */
|
||||
dji_f32_t roll; /*!< Specifies float value of roll for attitude */
|
||||
dji_f32_t yaw; /*!< Specifies float value of yaw for attitude */
|
||||
} T_DjiAttitude3f;
|
||||
|
||||
typedef struct {
|
||||
dji_f32_t q0; /*!< w, when converted to a rotation matrix or Euler angles. */
|
||||
dji_f32_t q1; /*!< x, when converted to a rotation matrix or Euler angles. */
|
||||
dji_f32_t q2; /*!< y, when converted to a rotation matrix or Euler angles. */
|
||||
dji_f32_t q3; /*!< z, when converted to a rotation matrix or Euler angles. */
|
||||
} T_DjiQuaternion4f;
|
||||
|
||||
/**
|
||||
* @brief Timestamp data structure.
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t millisecond; /*!< Millisecond. */
|
||||
uint32_t microsecond; /*!< Microsecond. */
|
||||
} T_DjiDataTimestamp;
|
||||
|
||||
#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. Use flight controller power-on timestamp on M300 RTK.
|
||||
* Use payload local timestamp on M30/M30T.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*DjiReceiveDataOfTopicCallback)(const uint8_t *data, uint16_t dataSize,
|
||||
const T_DjiDataTimestamp *timestamp);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_TYPEDEF_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
228
PSDK/psdk_lib/include/dji_upgrade.h
Normal file
228
PSDK/psdk_lib/include/dji_upgrade.h
Normal file
@ -0,0 +1,228 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_upgrade.h
|
||||
* @brief This is the header file for "dji_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 DJI_UPGRADE_H
|
||||
#define DJI_UPGRADE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <dji_typedef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef enum {
|
||||
/*!
|
||||
* @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:dji_payload_ftp
|
||||
* password:DJi_#$31
|
||||
* You can get guide about FTP service deployment on https://developer.dji.com/payload-sdk/documentation
|
||||
*/
|
||||
DJI_FIRMWARE_TRANSFER_TYPE_FTP = 0,
|
||||
/*!
|
||||
* @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_DjiUpgradeDcftpFileTransferOpt.
|
||||
* @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.
|
||||
*/
|
||||
DJI_FIRMWARE_TRANSFER_TYPE_DCFTP,
|
||||
} E_DjiFirmwareTransferType;
|
||||
|
||||
typedef enum {
|
||||
DJI_UPGRADE_STAGE_IDLE = 0, /*!< Idle stage means not in upgrade mode. */
|
||||
DJI_UPGRADE_STAGE_ONGOING = 3, /*!< Ongoing stage means payload is upgrading. */
|
||||
DJI_UPGRADE_STAGE_DEVICE_REBOOT = 6, /*!< Device reboot stage means device is rebooting. */
|
||||
DJI_UPGRADE_STAGE_END = 4, /*!< End Stage means upgrade finish and reporting upgrade result to the terminal APP. */
|
||||
} E_DjiUpgradeStage;
|
||||
|
||||
typedef enum {
|
||||
DJI_UPGRADE_END_STATE_SUCCESS = 1, /*!< Upgrade success. */
|
||||
DJI_UPGRADE_END_STATE_UNKNOWN_ERROR = 2, /*!< Upgrade failure due to unknown reason. */
|
||||
} E_DjiUpgradeEndState;
|
||||
|
||||
/**
|
||||
* @brief The firmware version of payload.
|
||||
* @note If majorVersion = AA, minorVersion = BB, modifyVersion = CC, debugVersion = DD, The version show in
|
||||
* terminal APP is AA.BB.CC.DD
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t majorVersion; /*!< The major version of firmware, the range is 0 ~ 99. */
|
||||
uint8_t minorVersion; /*!< The minor version of firmware, the range is 0 ~ 99. */
|
||||
uint8_t modifyVersion; /*!< The modify version of firmware, the range is 0 ~ 99. */
|
||||
uint8_t debugVersion; /*!< The debug version of firmware, the range is 0 ~ 99. */
|
||||
} T_DjiFirmwareVersion;
|
||||
|
||||
typedef struct {
|
||||
uint8_t upgradeProgress; /*!< The upgrade progress, the range is 0 ~ 100. */
|
||||
} T_DjiUpgradeOngoingInfo;
|
||||
|
||||
typedef struct {
|
||||
uint8_t rebootTimeout; /*!< The timeout value of rebooting device. unit: s */
|
||||
} T_DjiUpgradeRebootInfo;
|
||||
|
||||
typedef struct {
|
||||
E_DjiUpgradeEndState upgradeEndState; /*!< The upgrade end state */
|
||||
} T_DjiUpgradeEndInfo;
|
||||
|
||||
typedef struct {
|
||||
uint32_t port; /*!< FTP port used to transfer file, default is 21 */
|
||||
} T_DjiUpgradeFtpFileTransferInfo;
|
||||
|
||||
typedef struct {
|
||||
uint32_t fileSize; /*! The size of file. */
|
||||
char fileName[DJI_FILE_NAME_SIZE_MAX]; /*! The name of file. */
|
||||
} T_DjiUpgradeFileInfo;
|
||||
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to start file transfer.
|
||||
* @param fileInfo: the file info about the file to be transferred.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*start)(const T_DjiUpgradeFileInfo *fileInfo);
|
||||
/**
|
||||
* @brief Prototype of callback function used to transfer file data.
|
||||
* @details After start transfer, this callback function will be called several times to transfer file data sequentially.
|
||||
* @param data: pointer to memory space used to store file data.
|
||||
* @param dataLen: the data length of data.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*transfer)(const uint8_t *data, uint16_t dataLen);
|
||||
/**
|
||||
* @brief Prototype of callback function used to finish file transfer.
|
||||
* @param md5: the md5 value of file, used to check the correctness of the file transfer .
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*finish)(const uint8_t md5[DJI_MD5_BUFFER_LEN]);
|
||||
} T_DjiUpgradeDcftpFileTransferOpt;
|
||||
|
||||
typedef struct {
|
||||
/*! The firmware transfer type for upgrade. */
|
||||
E_DjiFirmwareTransferType transferType;
|
||||
|
||||
/*! If transferType is DJI_FIRMWARE_TRANSFER_TYPE_FTP, need support ftpTransferInfo. */
|
||||
T_DjiUpgradeFtpFileTransferInfo ftpTransferInfo;
|
||||
/*! If transferType is DJI_FIRMWARE_TRANSFER_TYPE_DCFTP, need support dcftpFileTransferOpt. */
|
||||
T_DjiUpgradeDcftpFileTransferOpt dcftpFileTransferOpt;
|
||||
} T_DjiFirmwareTransferInfo;
|
||||
|
||||
typedef struct {
|
||||
/*! The upgrade stage in upgrade process. */
|
||||
E_DjiUpgradeStage upgradeStage;
|
||||
|
||||
union {
|
||||
/*! If upgradeStage is DJI_UPGRADE_STAGE_ONGOING, need support upgradeOngoingInfo. */
|
||||
T_DjiUpgradeOngoingInfo upgradeOngoingInfo;
|
||||
/*! If upgradeStage is DJI_UPGRADE_STAGE_DEVICE_REBOOT, need support upgradeRebootInfo. */
|
||||
T_DjiUpgradeRebootInfo upgradeRebootInfo;
|
||||
/*! If upgradeStage is DJI_UPGRADE_STAGE_END, need support upgradeEndInfo. */
|
||||
T_DjiUpgradeEndInfo upgradeEndInfo;
|
||||
};
|
||||
} T_DjiUpgradeState;
|
||||
|
||||
typedef struct {
|
||||
T_DjiFirmwareVersion currentFirmwareVersion; /*!< The current firmware version of payload. */
|
||||
T_DjiFirmwareTransferInfo firmwareTransferInfo; /*!< The firmware transfer info of payload. */
|
||||
} T_DjiUpgradeConfig;
|
||||
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Prototype of callback function used to enter upgrade mode.
|
||||
* @param waitTime: the wait time for enter upgrade mode. The terminal APP will wait these time before do other
|
||||
* upgrade actions. You can use this time to prepare for firmware upgrade in other task, such as clean firmware
|
||||
* store area. unit: s
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*EnterUpgradeMode)(uint16_t *waitTime);
|
||||
/**
|
||||
* @brief Prototype of callback function used to check transferred firmware.
|
||||
* @details You can verify signature and decrypt firmware in this callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*CheckFirmware)(void);
|
||||
/**
|
||||
* @brief Prototype of callback function used to start firmware upgrade.
|
||||
* @note After start upgrade, the upgrade stage need change to ::DJI_UPGRADE_STAGE_ONGOING
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*StartUpgrade)(void);
|
||||
/**
|
||||
* @brief Prototype of callback function used to finish firmware upgrade.
|
||||
* @note After call finish upgrade, the upgrade stage need change from ::DJI_UPGRADE_STAGE_END to ::DJI_UPGRADE_STAGE_IDLE
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*FinishUpgrade)(void);
|
||||
} T_DjiUpgradeHandler;
|
||||
|
||||
/* 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_DjiReturnCode DjiUpgrade_Init(const T_DjiUpgradeConfig *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_DjiReturnCode DjiUpgrade_EnableLocalUpgrade(void);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for upgrade process.
|
||||
* @param upgradeHandler: pointer to structure of handler functions for upgrade process.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiUpgrade_RegHandler(const T_DjiUpgradeHandler *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 :: DJI_UPGRADE_STAGE_ONGOING. Push upgrade state upgradeOngoingInfo when upgradeOngoingInfo changed;
|
||||
* 3. After upgrade ongoing, change upgrade stage to DJI_UPGRADE_STAGE_DEVICE_REBOOT and push upgrade state upgradeRebootInfo;
|
||||
* 4. Device reboot;
|
||||
* 4. After device reboot, change upgrade stage to DJI_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_DjiReturnCode DjiUpgrade_PushUpgradeState(const T_DjiUpgradeState *upgradeState);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_UPGRADE_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
51
PSDK/psdk_lib/include/dji_version.h
Normal file
51
PSDK/psdk_lib/include/dji_version.h
Normal file
@ -0,0 +1,51 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_version.h
|
||||
* @brief This is the header file for "dji_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 DJI_VERSION_H
|
||||
#define DJI_VERSION_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define DJI_VERSION_MAJOR 3 /*!< DJI SDK major version num, when have incompatible API changes. Range from 0 to 99. */
|
||||
#define DJI_VERSION_MINOR 3 /*!< DJI SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
|
||||
#define DJI_VERSION_MODIFY 0 /*!< DJI SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
|
||||
#define DJI_VERSION_BETA 0 /*!< DJI SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
|
||||
#define DJI_VERSION_BUILD 1659 /*!< DJI SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_VERSION_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
124
PSDK/psdk_lib/include/dji_waypoint_v2.h
Normal file
124
PSDK/psdk_lib/include/dji_waypoint_v2.h
Normal file
@ -0,0 +1,124 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_waypoint_v2.h
|
||||
* @brief This is the header file for "dji_waypoint_v2.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 DJI_WAYPOINT_V2_H
|
||||
#define DJI_WAYPOINT_V2_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
#include "dji_waypoint_v2_type.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
typedef T_DjiReturnCode (*WaypointV2EventCbFunc)(T_DjiWaypointV2MissionEventPush eventData);
|
||||
typedef T_DjiReturnCode (*WaypointV2StateCbFunc)(T_DjiWaypointV2MissionStatePush stateData);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise waypoint v2 module, and user should call this function
|
||||
* before using waypoint v2 features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise waypoint v2 module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Init waypoint v2 mission settings
|
||||
* @param info: see reference of T_DjiWayPointV2MissionSettings.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_UploadMission(const T_DjiWayPointV2MissionSettings *info);
|
||||
|
||||
/**
|
||||
* @brief Start execute waypoint v2 mission
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Start(void);
|
||||
|
||||
/**
|
||||
* @brief Stop execute waypoint v2 mission
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Stop(void);
|
||||
|
||||
/**
|
||||
* @brief Pause execute waypoint v2 mission
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Pause(void);
|
||||
|
||||
/**
|
||||
* @brief Resume execute waypoint v2 mission
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_Resume(void);
|
||||
|
||||
/**
|
||||
* @brief Get the global cruise speed setting from flight controller
|
||||
* @param cruiseSpeed: see references of T_DjiWaypointV2GlobalCruiseSpeed.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_GetGlobalCruiseSpeed(T_DjiWaypointV2GlobalCruiseSpeed *cruiseSpeed);
|
||||
|
||||
/**
|
||||
* @brief Set the global cruise speed setting to flight controller
|
||||
* @param cruiseSpeed: see references of T_DjiWaypointV2GlobalCruiseSpeed.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_SetGlobalCruiseSpeed(T_DjiWaypointV2GlobalCruiseSpeed cruiseSpeed);
|
||||
|
||||
/**
|
||||
* @brief Subscribe to waypointV2 event with a callback function.
|
||||
* @note There will be data when the event is triggered.
|
||||
* @param callback: see references of WaypointV2EventCbFunc.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_RegisterMissionEventCallback(WaypointV2EventCbFunc callback);
|
||||
|
||||
/**
|
||||
* @brief Subscribe to waypointV2 mission state with a callback function.
|
||||
* @note Data is pushed with a frequency of 10Hz.
|
||||
* @param callback: see references of WaypointV2StateCbFunc.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV2_RegisterMissionStateCallback(WaypointV2StateCbFunc callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_WAYPOINT_V2_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
1161
PSDK/psdk_lib/include/dji_waypoint_v2_type.h
Normal file
1161
PSDK/psdk_lib/include/dji_waypoint_v2_type.h
Normal file
File diff suppressed because it is too large
Load Diff
122
PSDK/psdk_lib/include/dji_waypoint_v3.h
Normal file
122
PSDK/psdk_lib/include/dji_waypoint_v3.h
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_waypoint_v3.h
|
||||
* @brief This is the header file for "dji_waypoint_v3.c", defining the structure and
|
||||
* (exported) function prototypes.
|
||||
*
|
||||
* @copyright (c) 2021 DJI. All rights reserved.
|
||||
*
|
||||
* All information contained herein is, and remains, the property of DJI.
|
||||
* The intellectual and technical concepts contained herein are proprietary
|
||||
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
||||
* and protected by trade secret or copyright law. Dissemination of this
|
||||
* information, including but not limited to data and other proprietary
|
||||
* material(s) incorporated within the information, in any form, is strictly
|
||||
* prohibited without the express written consent of DJI.
|
||||
*
|
||||
* If you receive this source code without 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 DJI_WAYPOINT_V3_H
|
||||
#define DJI_WAYPOINT_V3_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Waypoint v3 mission action.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WAYPOINT_V3_ACTION_START = 0, /*!< Waypoint v3 mission start action. */
|
||||
DJI_WAYPOINT_V3_ACTION_STOP = 1, /*!< Waypoint v3 mission stop action. */
|
||||
DJI_WAYPOINT_V3_ACTION_PAUSE = 2, /*!< Waypoint v3 mission pause action. */
|
||||
DJI_WAYPOINT_V3_ACTION_RESUME = 3, /*!< Waypoint v3 mission resume action. */
|
||||
} E_DjiWaypointV3Action;
|
||||
|
||||
/**
|
||||
* Waypoint v3 current aircraft state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WAYPOINT_V3_STATE_IDLE = 0, /*!< Waypoint v3 aircraft in idle state. */
|
||||
DJI_WAYPOINT_V3_STATE_PREPARE = 16, /*!< Waypoint v3 aircraft in prepare state. */
|
||||
DJI_WAYPOINT_V3_STATE_TRANS_MISSION = 32, /*!< Waypoint v3 aircraft in trans mission state. */
|
||||
DJI_WAYPOINT_V3_STATE_MISSION = 48, /*!< Waypoint v3 aircraft in mission state. */
|
||||
DJI_WAYPOINT_V3_STATE_BREAK = 64, /*!< Waypoint v3 aircraft in break state. */
|
||||
DJI_WAYPOINT_V3_STATE_RESUME = 80, /*!< Waypoint v3 aircraft in resume state. */
|
||||
DJI_WAYPOINT_V3_STATE_RETURN_FIRSTPOINT = 98, /*!< Waypoint v3 aircraft in return first point state. */
|
||||
} E_DjiWaypointV3State;
|
||||
|
||||
/**
|
||||
* Waypoint v3 mission state.
|
||||
*/
|
||||
typedef struct {
|
||||
E_DjiWaypointV3State state; /*!< Waypoint v3 current aircraft state, #E_DjiWaypointV3State. */
|
||||
uint32_t wayLineId; /*!< Waypoint v3 current way line id. */
|
||||
uint16_t currentWaypointIndex; /*!< Waypoint v3 current waypoint index. */
|
||||
} T_DjiWaypointV3MissionState;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to receive the waypoint v3 mission state.
|
||||
* @warning User can not execute blocking style operations or functions in callback function, because that will block
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param missionState: current waypoint v3 mission state.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*WaypointV3StateCallback)(T_DjiWaypointV3MissionState missionState);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise waypoint v3 module, and user should call this function.
|
||||
* before using waypoint v3 features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV3_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialise waypoint v3 module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV3_DeInit(void);
|
||||
|
||||
/**
|
||||
* @brief Upload kmz file by raw data.
|
||||
* @note The size of kmz file is very small, you can use this interface to upload quickly.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV3_UploadKmzFile(const uint8_t *data, uint32_t dataLen);
|
||||
|
||||
/**
|
||||
* @brief Execute the mission action.
|
||||
* @note This action should be called after uploading the kmz file.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV3_Action(E_DjiWaypointV3Action action);
|
||||
|
||||
/**
|
||||
* @brief Register the mission state callback for waypoint mission.
|
||||
* @note If you want to monitor the state of waypoint mission, this interface should be called before uploading kmz
|
||||
* file or executing this mission action.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWaypointV3_RegMissionStateCallback(WaypointV3StateCallback callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_WAYPOINT_V3_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
307
PSDK/psdk_lib/include/dji_widget.h
Normal file
307
PSDK/psdk_lib/include/dji_widget.h
Normal file
@ -0,0 +1,307 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_widget.h
|
||||
* @brief This is the header file for "dji_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 DJI_WIDGET_H
|
||||
#define DJI_WIDGET_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <dji_typedef.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 DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN 255
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Widget types.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_TYPE_BUTTON = 1, /*!< button widget type */
|
||||
DJI_WIDGET_TYPE_SWITCH = 2, /*!< switch widget type */
|
||||
DJI_WIDGET_TYPE_SCALE = 3, /*!< scale widget type */
|
||||
DJI_WIDGET_TYPE_LIST = 4, /*!< list widget type */
|
||||
DJI_WIDGET_TYPE_INT_INPUT_BOX = 5, /*!< integer input box widget type */
|
||||
} E_DjiWidgetType;
|
||||
|
||||
/**
|
||||
* @brief Button widget state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_BUTTON_STATE_PRESS_DOWN = 1, /*!< Button is pressed down */
|
||||
DJI_WIDGET_BUTTON_STATE_RELEASE_UP = 0, /*!< Button is released up */
|
||||
} E_DjiWidgetButtonState;
|
||||
|
||||
/**
|
||||
* @brief Switch widget state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_SWITCH_STATE_OFF = 0, /*!< Switch is turned off */
|
||||
DJI_WIDGET_SWITCH_STATE_ON = 1 /*!< Switch is turned on */
|
||||
} E_DjiWidgetSwitchState;
|
||||
|
||||
/**
|
||||
* @brief Switch widget speaker work mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_SPEAKER_WORK_MODE_TTS = 0,
|
||||
DJI_WIDGET_SPEAKER_WORK_MODE_VOICE = 1,
|
||||
} E_DjiWidgetSpeakerWorkMode;
|
||||
|
||||
/**
|
||||
* @brief Switch widget speaker play mode.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_SPEAKER_PLAY_MODE_SINGLE_PLAY = 0,
|
||||
DJI_WIDGET_SPEAKER_PLAY_MODE_LOOP_PLAYBACK = 1,
|
||||
} E_DjiWidgetSpeakerPlayMode;
|
||||
|
||||
/**
|
||||
* @brief Switch widget speaker state.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_SPEAKER_STATE_IDEL = 0,
|
||||
DJI_WIDGET_SPEAKER_STATE_TRANSMITTING = 1,
|
||||
DJI_WIDGET_SPEAKER_STATE_PLAYING = 2,
|
||||
DJI_WIDGET_SPEAKER_STATE_ERROR = 3,
|
||||
DJI_WIDGET_SPEAKER_STATE_IN_TTS_CONVERSION = 4,
|
||||
} E_DjiWidgetSpeakerState;
|
||||
|
||||
/**
|
||||
* @brief Switch widget transmit data event.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_WIDGET_TRANSMIT_DATA_EVENT_START,
|
||||
DJI_WIDGET_TRANSMIT_DATA_EVENT_TRANSMIT,
|
||||
DJI_WIDGET_TRANSMIT_DATA_EVENT_FINISH,
|
||||
DJI_WIDGET_TRANSMIT_DATA_EVENT_ABORT,
|
||||
} E_DjiWidgetTransmitDataEvent;
|
||||
|
||||
/**
|
||||
* @brief Widget file binary array.
|
||||
*/
|
||||
typedef struct {
|
||||
char *fileName; /*!< The file name of the widget file */
|
||||
uint32_t fileSize; /*!< The file size of the widget file, uint : byte */
|
||||
const uint8_t *fileBinaryArray; /*!< The binary C array of the widget file */
|
||||
} T_DjiWidgetFileBinaryArray;
|
||||
|
||||
/**
|
||||
* @brief Widget binary array config.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t binaryArrayCount; /*!< Binary array count. */
|
||||
T_DjiWidgetFileBinaryArray *fileBinaryArrayList; /*!< Pointer to binary array list */
|
||||
} T_DjiWidgetBinaryArrayConfig;
|
||||
|
||||
/**
|
||||
* @brief Widget handler item.
|
||||
*/
|
||||
typedef struct {
|
||||
/*! The index of widget, the index can be numbered starting from 0 and cannot be repeated */
|
||||
uint32_t widgetIndex;
|
||||
|
||||
/*! The type of widget, refer to ::E_DjiWidgetType */
|
||||
E_DjiWidgetType widgetType;
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to set widget value, the function will be call when the user triggers
|
||||
* the widget.
|
||||
* @param widgetType: the type of widget, refer to ::E_DjiWidgetType.
|
||||
* @param index: the index of widget.
|
||||
* @param value: the value of widget, need be set.
|
||||
* if the widget type is DJI_WIDGET_TYPE_BUTTON, the value is refer to ::E_DjiWidgetButtonState;
|
||||
* if the widget type is DJI_WIDGET_TYPE_SWITCH, the value is refer to ::E_DjiWidgetSwitchState;
|
||||
* if the widget type is DJI_WIDGET_TYPE_SCALE, the value is range from 0 to 100, which represents the percentage
|
||||
* of the scale slider;
|
||||
* if the Widget type is DJI_WIDGET_TYPE_LIST, the value is range from 0 to N-1 (N is the value of list item
|
||||
* count), which represents which item is chosen;
|
||||
* if the widget type is DJI_WIDGET_TYPE_INT_INPUT_BOX, the value is the input value of int input box widget.
|
||||
* @param userData: the user data need used in callback.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*SetWidgetValue)(E_DjiWidgetType widgetType, uint32_t index, int32_t value, void *userData);
|
||||
|
||||
/**
|
||||
* @brief Prototype of callback function used to get widget value.
|
||||
* @param widgetType: the type of widget, refer to ::E_DjiWidgetType.
|
||||
* @param index
|
||||
* @param value: the value of widget, need be set.
|
||||
* if the widget type is DJI_WIDGET_TYPE_BUTTON, the value is refer to ::E_DjiWidgetButtonState;
|
||||
* if the widget type is DJI_WIDGET_TYPE_SWITCH, the value is refer to ::E_DjiWidgetSwitchState;
|
||||
* if the widget type is DJI_WIDGET_TYPE_SCALE, the value is range from 0 to 100, which represents the percentage
|
||||
* of the scale slider;
|
||||
* if the Widget type is DJI_WIDGET_TYPE_LIST, the value is range from 0 to N-1 (N is the value of list item
|
||||
* count), which represents which item is chosen;
|
||||
* if the widget type is DJI_WIDGET_TYPE_INT_INPUT_BOX, the value is the input value of int input box widget.
|
||||
* @param userData: the user data need used in callback function.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode (*GetWidgetValue)(E_DjiWidgetType widgetType, uint32_t index, int32_t *value, void *userData);
|
||||
|
||||
/*! the user data need used in SetWidgetValue and GetWidgetValue callback function. */
|
||||
void *userData;
|
||||
} T_DjiWidgetHandlerListItem;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
/*! When event is 'DJI_WIDGET_TRANSMIT_DATA_EVENT_START', the buf contains file name, uuid and decoder bitrate. */
|
||||
struct {
|
||||
uint8_t fileName[32];
|
||||
uint8_t fileUuid[32];
|
||||
uint32_t fileDecodeBitrate;
|
||||
} transDataStartContent;
|
||||
|
||||
/*! When event is 'DJI_WIDGET_TRANSMIT_DATA_EVENT_START', the buf contains file md5 sum. */
|
||||
struct {
|
||||
uint8_t md5Sum[16];
|
||||
} transDataEndContent;
|
||||
};
|
||||
} T_DjiWidgetTransDataContent;
|
||||
|
||||
typedef struct {
|
||||
E_DjiWidgetSpeakerState state;
|
||||
E_DjiWidgetSpeakerWorkMode workMode;
|
||||
E_DjiWidgetSpeakerPlayMode playMode;
|
||||
uint8_t volume;
|
||||
} T_DjiWidgetSpeakerState;
|
||||
|
||||
typedef struct {
|
||||
T_DjiReturnCode (*GetSpeakerState)(T_DjiWidgetSpeakerState *speakerState);
|
||||
T_DjiReturnCode (*SetWorkMode)(E_DjiWidgetSpeakerWorkMode workMode);
|
||||
T_DjiReturnCode (*SetPlayMode)(E_DjiWidgetSpeakerPlayMode playMode);
|
||||
T_DjiReturnCode (*SetVolume)(uint8_t volume);
|
||||
|
||||
T_DjiReturnCode (*StartPlay)(void);
|
||||
T_DjiReturnCode (*StopPlay)(void);
|
||||
|
||||
T_DjiReturnCode (*ReceiveTtsData)(E_DjiWidgetTransmitDataEvent event,
|
||||
uint32_t offset, uint8_t *buf, uint16_t size);
|
||||
T_DjiReturnCode (*ReceiveVoiceData)(E_DjiWidgetTransmitDataEvent event,
|
||||
uint32_t offset, uint8_t *buf, uint16_t size);
|
||||
} T_DjiWidgetSpeakerHandler;
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise widget module, and user should call this function before using widget features.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWidget_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
|
||||
* DjiWidget_RegDefaultConfigByDirPath and DjiWidget_RegUiConfigByDirPath. When you don't need multi-language
|
||||
* and multi-screen size support, you can just use DjiWidget_RegDefaultUiConfigByDirPath function set widget UI
|
||||
* Config directory path. If you need support multi-language and multi-screen size support, you can use function
|
||||
* DjiWidget_RegUiConfigByDirPath to specify widget configuration. When the language and screen size is not
|
||||
* cover in your setting by DjiWidget_RegUiConfigByDirPath, the widget UI configuration uses setting by
|
||||
* DjiWiget_RegDefaultUiConfigByDirPath function.
|
||||
* @param widgetConfigDirPath: the widget UI configuration directory path.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWidget_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_DjiReturnCode DjiWidget_RegUiConfigByDirPath(E_DjiMobileAppLanguage appLanguage,
|
||||
E_DjiMobileAppScreenType 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 DjiWidget_RegDefaultUiConfigBinaryArray set widget UI configuration. When the language and screen size
|
||||
* is not cover in your setting by DjiWidget_RegUiConfigByBinaryArray, the widget UI configuration uses setting by this
|
||||
* function.
|
||||
* @param binaryArrayConfig: the binary array config for widget UI configuration.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWidget_RegDefaultUiConfigByBinaryArray(const T_DjiWidgetBinaryArrayConfig *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_DjiReturnCode DjiWidget_RegUiConfigByBinaryArray(E_DjiMobileAppLanguage appLanguage,
|
||||
E_DjiMobileAppScreenType screenType,
|
||||
const T_DjiWidgetBinaryArrayConfig *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_DjiReturnCode DjiWidget_RegHandlerList(const T_DjiWidgetHandlerListItem *widgetHandlerList, uint32_t itemCount);
|
||||
|
||||
/**
|
||||
* @brief Send message to mobile app floating window.
|
||||
* @note the message length can't more than DJI_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_DjiReturnCode DjiWidgetFloatingWindow_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_DjiReturnCode DjiWidgetFloatingWindow_GetChannelState(T_DjiDataChannelState *state);
|
||||
|
||||
/**
|
||||
* @brief Register the handler for widget speaker function interfaces.
|
||||
* @note This interface registers the widget speaker function interface, including speaker settings, play operation,
|
||||
* speaker status interface.
|
||||
* @param widgetSpeakerHandler: pointer to the handler for widget speaker functions.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiWidget_RegSpeakerHandler(const T_DjiWidgetSpeakerHandler *widgetSpeakerHandler);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_WIDGET_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
222
PSDK/psdk_lib/include/dji_xport.h
Normal file
222
PSDK/psdk_lib/include/dji_xport.h
Normal file
@ -0,0 +1,222 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file dji_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 DJI 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 DJI_XPORT_H
|
||||
#define DJI_XPORT_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
#include "dji_gimbal.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief XPort limit angle category.
|
||||
*/
|
||||
typedef enum {
|
||||
DJI_XPORT_LIMIT_ANGLE_CATEGORY_ROLL_JOINT_ANGLE = 0, /*!< Joint angle limit of roll axis. */
|
||||
DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE = 1, /*!< Joint angle limit of pitch axis. */
|
||||
DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE = 2, /*!< Euler angle limit of pitch axis, just is limitation of angle in ground coordinate. */
|
||||
DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE_EXTENSION = 3, /*!< 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. */
|
||||
DJI_XPORT_LIMIT_ANGLE_CATEGORY_YAW_JOINT_ANGLE = 4, /*!< Joint angle limit of yaw axis. */
|
||||
} E_DjiXPortLimitAngleCategory;
|
||||
|
||||
/**
|
||||
* @brief Limit angle data structure.
|
||||
*/
|
||||
typedef struct {
|
||||
int16_t upperLimit; /*!< Upper limit of limit angle, unit: 0.1degree. */
|
||||
int16_t lowerLimit; /*!< Lower limit of limit angle, unit: 0.1degree. */
|
||||
} T_DjiXPortLimitAngle;
|
||||
|
||||
/**
|
||||
* @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 DJI
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param systemState: system state of XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*DjiReceiveXPortSystemStateCallback)(T_DjiGimbalSystemState systemState);
|
||||
|
||||
/**
|
||||
* @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 DJI
|
||||
* root thread, causing problems such as slow system response, payload disconnection or infinite loop.
|
||||
* @param attitudeInformation: attitude information of XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
typedef T_DjiReturnCode (*DjiReceiveXPortAttitudeInformationCallback)(
|
||||
T_DjiGimbalAttitudeInformation attitudeInformation);
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Initialise XPort module.
|
||||
* @note The function have to be called before other functions related to XPort.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiXPort_Init(void);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize XPort module.
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiXPort_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_DjiReturnCode DjiXPort_RegReceiveSystemStateCallback(DjiReceiveXPortSystemStateCallback 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_DjiReturnCode DjiXPort_RegReceiveAttitudeInformationCallback(DjiReceiveXPortAttitudeInformationCallback 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_DjiReturnCode DjiXPort_SetGimbalModeSync(E_DjiGimbalMode 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 ::DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::DJI_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 DJI 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 dji_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
|
||||
* ::DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE), 0.1 degree/s
|
||||
* (if rotation mode is ::DJI_GIMBAL_ROTATION_MODE_SPEED).
|
||||
* @return Execution result.
|
||||
*/
|
||||
T_DjiReturnCode DjiXPort_RotateSync(E_DjiGimbalRotationMode rotationMode,
|
||||
T_DjiGimbalRotationProperty rotationProperty, T_DjiAttitude3d rotationValue);
|
||||
|
||||
/**
|
||||
* @brief Release gimbal control permission out in blocking mode.
|
||||
* @details When DJI application control XPort gimbal, DJI application will capture and gain control permission of
|
||||
* gimbal if allowable. After DJI application sending a sequence of the gimbal control command, DJI 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, DJI application can release control permission after tap
|
||||
* zooming. Of course, if DJI 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_DjiReturnCode DjiXPort_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_DjiReturnCode DjiXPort_ResetSync(E_DjiGimbalResetMode 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_DjiReturnCode DjiXPort_SetLimitAngleSync(E_DjiXPortLimitAngleCategory limitAngleCategory,
|
||||
T_DjiXPortLimitAngle 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_DjiReturnCode DjiXPort_GetLimitAngleSync(E_DjiXPortLimitAngleCategory limitAngleCategory,
|
||||
T_DjiXPortLimitAngle *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_DjiReturnCode DjiXPort_SetSpeedConversionFactor(float factor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DJI_XPORT_H
|
||||
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
126
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_aircraft_info.h
Normal file
126
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_aircraft_info.h
Normal file
@ -0,0 +1,126 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
72
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_core.h
Normal file
72
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_core.h
Normal file
@ -0,0 +1,72 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
72
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_channel.h
Normal file
72
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_channel.h
Normal file
@ -0,0 +1,72 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
434
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_subscription.h
Normal file
434
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_subscription.h
Normal file
@ -0,0 +1,434 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
222
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_transmission.h
Normal file
222
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_data_transmission.h
Normal file
@ -0,0 +1,222 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
208
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_error.h
Normal file
208
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_error.h
Normal file
@ -0,0 +1,208 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
166
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_gimbal.h
Normal file
166
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_gimbal.h
Normal file
@ -0,0 +1,166 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
113
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_logger.h
Normal file
113
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_logger.h
Normal file
@ -0,0 +1,113 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
150
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_mop_channel.h
Normal file
150
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_mop_channel.h
Normal file
@ -0,0 +1,150 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
421
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_payload_camera.h
Normal file
421
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_payload_camera.h
Normal file
@ -0,0 +1,421 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
@ -0,0 +1,116 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
216
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_platform.h
Normal file
216
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_platform.h
Normal file
@ -0,0 +1,216 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
113
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_positioning.h
Normal file
113
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_positioning.h
Normal file
@ -0,0 +1,113 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
105
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_power_management.h
Normal file
105
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_power_management.h
Normal file
@ -0,0 +1,105 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
63
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_product_info.h
Normal file
63
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_product_info.h
Normal file
@ -0,0 +1,63 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
92
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_time_sync.h
Normal file
92
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_time_sync.h
Normal file
@ -0,0 +1,92 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
88
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_typedef.h
Normal file
88
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_typedef.h
Normal file
@ -0,0 +1,88 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
140
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_upgrade.h
Normal file
140
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_upgrade.h
Normal file
@ -0,0 +1,140 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
54
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_version.h
Normal file
54
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_version.h
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
171
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_widget.h
Normal file
171
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_widget.h
Normal file
@ -0,0 +1,171 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
223
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_xport.h
Normal file
223
PSDK/psdk_lib/include/legacy_psdk2.x/psdk_xport.h
Normal file
@ -0,0 +1,223 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @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******/
|
BIN
PSDK/psdk_lib/lib/aarch64-himix100-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/aarch64-himix100-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/aarch64-linux-android-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/aarch64-linux-android-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/aarch64-linux-gnu-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/aarch64-linux-gnu-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-himix100-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-himix100-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-himix200-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-himix200-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-hisiv300-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-hisiv300-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-hisiv400-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-hisiv400-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-hisiv500-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-hisiv500-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-hisiv600-linux-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-hisiv600-linux-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-linux-androideabi-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-linux-androideabi-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-linux-gnueabi-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-linux-gnueabi-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-linux-gnueabihf-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-linux-gnueabihf-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/arm-none-eabi-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/arm-none-eabi-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/armcc_cortex-m4/libpayload.lib
Normal file
BIN
PSDK/psdk_lib/lib/armcc_cortex-m4/libpayload.lib
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/x86_64-linux-gnu-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/x86_64-linux-gnu-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
BIN
PSDK/psdk_lib/lib/xtensa-esp32-elf-gcc/libpayloadsdk.a
Normal file
BIN
PSDK/psdk_lib/lib/xtensa-esp32-elf-gcc/libpayloadsdk.a
Normal file
Binary file not shown.
Reference in New Issue
Block a user