Files
M300CO2/PSDK/psdk_lib/include/dji_waypoint_v3.h
2023-03-22 09:47:10 +08:00

123 lines
4.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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