作者 ookk303

调整结构

要显示太多修改。

为保证性能只显示 17 of 17+ 个文件。

@@ -31,6 +31,7 @@ project_build/Psdk312/* @@ -31,6 +31,7 @@ project_build/Psdk312/*
31 project_build/特殊固件 31 project_build/特殊固件
32 project_build/DJI_Test 32 project_build/DJI_Test
33 project_build/Psdk2257 33 project_build/Psdk2257
  34 +project_build/zy_101
34 35
35 # project_build/Attention_提示程序 36 # project_build/Attention_提示程序
36 37
1 -# Prerequisites  
2 -*.d  
3 -  
4 -# Compiled Object files  
5 -*.slo  
6 -*.lo  
7 -*.o  
8 -*.obj  
9 -  
10 -# Precompiled Headers  
11 -*.gch  
12 -*.pch  
13 -  
14 -# Compiled Dynamic libraries  
15 -*.so  
16 -*.dylib  
17 -*.dll  
18 -  
19 -# Fortran module files  
20 -*.mod  
21 -*.smod  
22 -  
23 -# Compiled Static libraries  
24 -*.lai  
25 -*.la  
26 -.a  
27 -.lib  
28 -  
29 -# Executables  
30 -*.exe  
31 -*.out  
32 -*.app  
1 -cmake_minimum_required(VERSION 2.8)  
2 -  
3 -if (NOT USE_SYSTEM_ARCH)  
4 - # select use platform 'LINUX' or 'RTOS' here, reset cache and reload cmake project  
5 - set(USE_SYSTEM_ARCH LINUX)  
6 -endif ()  
7 -  
8 -if (USE_SYSTEM_ARCH MATCHES RTOS)  
9 - cmake_minimum_required(VERSION 3.15)  
10 - set(CMAKE_C_COMPILER arm-none-eabi-gcc)  
11 - set(CMAKE_CXX_COMPILER arm-none-eabi-g++)  
12 - set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)  
13 - set(CMAKE_AR arm-none-eabi-ar)  
14 - set(CMAKE_OBJCOPY arm-none-eabi-objcopy)  
15 - set(CMAKE_OBJDUMP arm-none-eabi-objdump)  
16 - set(SIZE arm-none-eabi-size)  
17 - set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)  
18 -endif ()  
19 -  
20 -project(entry)  
21 -  
22 -# Disable in-source builds to prevent source tree corruption.  
23 -if (" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")  
24 - message(FATAL_ERROR "FATAL: In-source builds are not allowed.  
25 - You should create a separate directory for build files.")  
26 -endif ()  
27 -  
28 -if (USE_SYSTEM_ARCH MATCHES LINUX)  
29 - add_definitions(-DSYSTEM_ARCH_LINUX)  
30 - add_subdirectory(samples/sample_c/platform/linux/nvidia_jetson)  
31 -  
32 - execute_process(COMMAND uname -m OUTPUT_VARIABLE DEVICE_SYSTEM_ID)  
33 - if (DEVICE_SYSTEM_ID MATCHES x86_64)  
34 - set(LIBRARY_PATH psdk_lib/lib/x86_64-linux-gnu)  
35 - elseif (DEVICE_SYSTEM_ID MATCHES aarch64)  
36 - set(LIBRARY_PATH psdk_lib/lib/aarch64-linux-gnu)  
37 - elseif (DEVICE_SYSTEM_ID MATCHES armv7l)  
38 - set(LIBRARY_PATH psdk_lib/lib/arm-linux-gnueabihf)  
39 - else ()  
40 - message(FATAL_ERROR "FATAL: Please confirm your platform.")  
41 - endif ()  
42 -  
43 - install(FILES ${LIBRARY_PATH}/libpayloadsdk.a  
44 - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"  
45 - )  
46 -  
47 - install(DIRECTORY psdk_lib/include  
48 - DESTINATION "${CMAKE_INSTALL_PREFIX}"  
49 - )  
50 -elseif (USE_SYSTEM_ARCH MATCHES RTOS)  
51 - add_definitions(-DSYSTEM_ARCH_RTOS)  
52 - add_subdirectory(samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc)  
53 -endif ()  
54 -  
55 -add_custom_target(${PROJECT_NAME} ALL)  
1 -# Ziyan Payload SDK (PSDK)  
2 -  
3 -  
4 -  
5 -## What is the Ziyan Payload SDK?  
6 -  
7 -The ziyan Payload SDK(PSDK), is a development kit provided by ziyan to support developers to develop payload that can be mounted on ziyan aircraft. developers can obtain the information or other resource from the aircraft. According to the software logic and algorithm framework designed by the developer, users could develop payload that can be mounted on ziyan aircraft, to perform actions they need, such as Automated Flight Controller, Payload Controller, Video Image Analysis Platform, Mapping Camera, Megaphone And Searchlight, etc.  
8 -  
9 -  
10 -  
11 -## Latest Release  
12 -  
13 -The latest release version of PSDK is 1.0.0.0 This version of Payload SDK mainly first release. Please refer to the release notes for detailed changes list.  
14 -  
15 -## License  
16 -  
17 -Payload SDK codebase is MIT-licensed. Please refer to the LICENSE file for detailed information.  
1 -# Ziyan Payload SDK Release Log  
2 -  
3 -## V1.1.1.0-20250721-Release  
4 -**[Note]**:  
5 -* Refactored the camera range finder handler and separated it into an independent interface.  
6 -* Introduced a new camera API to support the camera tracker.  
7 -* Resolved several known issues.  
8 -  
9 -**[Added]**:  
10 -* Added support for the camera tracker feature. Introduced new APIs for controlling the camera tracker integrated with the payload camera, and exposed additional tracking status feedback data.  
11 -* Separated the camera range finder into a dedicated interface to improve modularity.  
12 -  
13 -**[Optimized]**:  
14 -* Optimized the video streaming transmission mechanism for improved efficiency and stability.  
15 -* Enhanced core task monitoring by periodically reporting tasks with abnormal execution time, ensuring stable and reliable system behavior.  
16 -  
17 -**[Fixed]**:  
18 -* Fixed an issue where the widget module ignored items with an index greater than 256.  
19 -----  
20 -  
21 -  
22 -  
23 -  
24 -## V1.1.0.0-20250620-Release  
25 -**[Note]**:  
26 -* Introduced a new self-checking mechanism.  
27 -* Fixed several known issues.  
28 -  
29 -**[Added]**:  
30 -* Added support for the self-checking mechanism. Users will now be prompted to update their PSPK version in the event of communication or version mismatches.  
31 -* Added support for the I2C communication protocol.  
32 -  
33 -**[Optimized]**:  
34 -* Optimized the widget configuration file loading method. UAVs can now load configuration files dynamically.  
35 -* Optimized the speaker module to improve real-time speaker and TTS (text-to-speech) transmission logic.  
36 -* Refined the core initialization logic.  
37 -  
38 -**[Fixed]**:  
39 -* Fixed an issue where the widget module occasionally failed to load the configuration file, causing the Ziyan app to not display payload widget information.  
40 -* Fixed an issue where log timestamps were displayed abnormally.  
41 ----  
42 -  
43 -  
44 -  
45 -  
46 -## V1.0.0.4-20250603-Release  
47 -**[Note]**:  
48 -* Added new module.  
49 -* Fixed some known issues.  
50 -  
51 -**[Added]**:  
52 -* Add support for the speaker module.  
53 -  
54 -**[Optimized]**:  
55 -* Optimize the core initialization process and provide more log information to support developers in quickly identifying the cause of exceptions during the adaptation process.  
56 -  
57 -**[Fixed]**:  
58 -* Fix issues that may cause abnormal program termination in specific communication scenarios.  
59 -* Fix the issue of strong coupling between the sample program and the system environment  
60 ----  
61 -  
62 -  
63 -  
64 -  
65 -## V1.0.0.3-20250429-Release  
66 -**[Note]**:  
67 -To support more camera expansion features, Add new camera API. Fixed some known issues.  
68 -  
69 -**[Added]**:  
70 -* Adjust the feedback frequency of the camera status, support the remote control to refresh data at a higher frequency, and ensure real-time display.  
71 -* Add diverse debugging options  
72 -  
73 -**[Fixed]**:  
74 -* Fix the dependency of the sample program and run the samples based on the computer system environment where they were compiled.  
75 ----  
76 -  
77 -  
78 -  
79 -  
80 -## V1.0.0.2-20250401-Release  
81 -**[Note]**:  
82 -To support more camera expansion features, Add new camera API. Fixed some known issues.  
83 -  
84 -**[Added]**:  
85 -* Add API which used to get obtain camera calculation position.  
86 -* Add API which used to control the camera tracker integrated into the payload camera.  
87 -  
88 -**[Fixed]**:  
89 -* Fix the issue that the camera status is not updated when the camera has connected.  
90 -* Fix occasional screen distortion in camera videos  
91 ----  
92 -  
93 -  
94 -  
95 -  
96 -## V1.0.0.1-20250310-Release  
97 -**[Note]**:  
98 -To support more camera expansion features, Add new camera API. Fixed some known issues.  
99 -  
100 -**[Added]**:  
101 -* Add API which used to control the range finder integrated into the payload camera.  
102 ----  
103 -  
104 -  
105 -  
106 -  
107 -## V1.0.0.0-20250306-Release  
108 -**[Note]**:  
109 -This version of Payload SDK mainly first release. Please refer to the release notes for detailed changes list.  
110 -  
111 -**[Added]**:  
112 -* Added support for gimbal functionality  
113 -* Added support for basic camera functionality  
114 -* Added support for widget functionality  
115 -* Added support for subscription functionality  
116 ----  
117 -  
118 -  
119 -  
120 -  
121 -  
122 -  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_aircraft_info.h  
4 - * @brief This is the header file for "ziyan_aircraft_info.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_AIRCRAFT_INFO_H  
28 -#define ZIYAN_AIRCRAFT_INFO_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -/* Exported types ------------------------------------------------------------*/  
40 -/**  
41 - * @brief Information related to mobile APP.  
42 - */  
43 -typedef struct {  
44 - E_ZiyanMobileAppLanguage appLanguage; /*!< Mobile APP system language */  
45 - E_ZiyanMobileAppScreenType appScreenType; /*!< Mobile APP screen size type. */  
46 -} T_ZiyanMobileAppInfo;  
47 -  
48 -/**  
49 - * @brief Basic information about the aircraft system, mainly including some constant parameters information.  
50 - */  
51 -typedef struct {  
52 - E_ZiyanAircraftSeries aircraftSeries; /*!< Aircraft series. */  
53 - E_ZiyanMountPositionType mountPositionType; /*!< Mount position type. */  
54 - E_ZiyanAircraftType aircraftType; /*!< Aircraft type. */  
55 - E_ZiyanSdkAdapterType ziyanAdapterType; /*!< ZIYAN adapter type. */  
56 - E_ZiyanMountPosition mountPosition; /*!< Payload mount position. */  
57 -} T_ZiyanAircraftInfoBaseInfo;  
58 -  
59 -/**  
60 - * @brief Aircraft version information.  
61 - */  
62 -typedef struct {  
63 - uint8_t debugVersion;  
64 - uint8_t modifyVersion;  
65 - uint8_t minorVersion;  
66 - uint8_t majorVersion;  
67 -} T_ZiyanAircraftVersion;  
68 -  
69 -/* Exported functions --------------------------------------------------------*/  
70 -/**  
71 - * @brief Basic information about the aircraft system, including aircraft type and ZIYAN adapter type.  
72 - * @param baseInfo: Pointer to a memory space where the aircraft's basic information will be stored.  
73 - * @return Execution result.  
74 - */  
75 -T_ZiyanReturnCode ZiyanAircraftInfo_GetBaseInfo(T_ZiyanAircraftInfoBaseInfo *baseInfo);  
76 -  
77 -/**  
78 - * @brief Get information related to mobile app.  
79 - * @note Returns unknown for app language and screen type if the RC or app is not connected to the aircraft system.  
80 - * @param mobileAppInfo: Pointer to a memory space where the mobile app information will be stored.  
81 - * @return Execution result.  
82 - */  
83 -T_ZiyanReturnCode ZiyanAircraftInfo_GetMobileAppInfo(T_ZiyanMobileAppInfo *mobileAppInfo);  
84 -  
85 -/**  
86 - * @brief Get connection status between the payload and the aircraft.  
87 - * @note Update period: 1Hz  
88 - * @param isConnected: Pointer to connection status.  
89 - * @return Execution result.  
90 - */  
91 -T_ZiyanReturnCode ZiyanAircraftInfo_GetConnectionStatus(bool *isConnected);  
92 -  
93 -/**  
94 - * @brief Get version of the aircraft.  
95 - * @param aircraftVersion: Pointer to aircraft version.  
96 - * @return Execution result.  
97 - */  
98 -T_ZiyanReturnCode ZiyanAircraftInfo_GetAircraftVersion(T_ZiyanAircraftVersion *aircraftVersion);  
99 -  
100 -#ifdef __cplusplus  
101 -}  
102 -#endif  
103 -  
104 -#endif //ZIYAN_AIRCRAFT_INFO_H  
105 -  
106 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_camera_manager.h  
4 - * @brief This is the header file for "ziyan_camera_manager.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_CAMERA_MANAGER_H  
28 -#define ZIYAN_CAMERA_MANAGER_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -/* Exported types ------------------------------------------------------------*/  
40 -/*! @brief CameraModule work modes.  
41 - */  
42 -typedef enum {  
43 - /*!  
44 - - Capture mode. In this mode, the user can capture pictures.  
45 - */  
46 - ZIYAN_CAMERA_MANAGER_WORK_MODE_SHOOT_PHOTO = 0,  
47 - /*!  
48 - - Record mode. In this mode, the user can record videos.  
49 - */  
50 - ZIYAN_CAMERA_MANAGER_WORK_MODE_RECORD_VIDEO = 1,  
51 - /*!  
52 - - Playback mode. In this mode, the user can preview photos and videos, and  
53 - can delete files. It is supported by Phantom 3 Professional camera, X3, X5  
54 - and X5R cameras on aircraft and Phantom 4 camera. Playback mode is not  
55 - supported by Z30, X5S, X4S, Phantom 4 Pro, Mavic Pro, Phantom 3 Standard,  
56 - Phantom 3 Advanced, Phantom 3 4K and Osmo series.  
57 - */  
58 - ZIYAN_CAMERA_MANAGER_WORK_MODE_PLAYBACK = 2,  
59 - /*!  
60 - - In this mode, the user can download media to the Mobile Device. Not  
61 - supported by X5 camera nor X5R camera while mounted on aircraft.  
62 - */  
63 - ZIYAN_CAMERA_MANAGER_WORK_MODE_MEDIA_DOWNLOAD = 3,  
64 - /*!  
65 - - In this mode, live stream resolution and frame rate will be 1080i50 (PAL)  
66 - or 720p60 (NTSC). In this mode videos can be recorded. Still photos can  
67 - also be taken only when video is recording. The only way to exit broadcast  
68 - mode is to change modes to RECORD_VIDEO. Only supported by Inspire 2.  
69 - */  
70 - ZIYAN_CAMERA_MANAGER_WORK_MODE_BROADCAST = 4,  
71 - /*!  
72 - * The camera work mode is unknown.  
73 - */  
74 - ZIYAN_CAMERA_MANAGER_WORK_MODE_WORK_MODE_UNKNOWN = 0xFF,  
75 -} E_ZiyanCameraManagerWorkMode;  
76 -  
77 -/*! @brief The ShootPhoto mode itself can have several modes. The default  
78 - * value is SINGLE.  
79 - */  
80 -typedef enum {  
81 - /*!  
82 - - Sets the camera to take a single photo.  
83 - */  
84 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_SINGLE = 0x01,  
85 - /*!  
86 - - Sets the camera to take an HDR photo. X5 camera, X5R camera, XT camera,  
87 - Z30 camera, Phantom 4 Pro camera, X4S camera and X5S camera do not support  
88 - HDR mode.  
89 - */  
90 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_HDR = 0x02,  
91 - /*!  
92 - - Set the camera to take multiple photos at once. XT camera does not  
93 - support Burst mode.  
94 - */  
95 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_BURST = 0x04,  
96 - /*!  
97 - - Automatic Exposure Bracketing (AEB) capture. In this mode you can quickly  
98 - take multiple shots (the default is 3) at different exposures without  
99 - having to manually change any settings between frames. XT camera and Z30  
100 - camera does not support AEB mode.  
101 - */  
102 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_AEB = 0x05,  
103 - /*!  
104 - - Sets the camera to take a picture (or multiple pictures) continuously at  
105 - a set time interval. The minimum interval for JPEG format of any quality is  
106 - 2s. For all cameras except X4S, X5S and Phantom 4 Pro camera: The minimum  
107 - interval for RAW or RAW+JPEG format is 10s. For the X4S, X5S and Phantom 4  
108 - Pro cameras the minimum interval for RAW or RAW+JPEG dformat is 5s.  
109 - */  
110 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_INTERVAL = 0x06,  
111 - /*!  
112 - - Sets the camera to take a burst of RAW photos. Use getRAWPhotoBurstCount  
113 - to check how many photos have been shot. Only supported by X5S.  
114 - */  
115 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_RAW_BURST = 0x09,  
116 - /*!  
117 - - Sets the camera to take an regional photos. It is supported by H20/H20T.  
118 - */  
119 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_REGIONAL_SR = 0x16,  
120 - /*!  
121 - - The shoot photo mode is unknown.  
122 - */  
123 - ZIYAN_CAMERA_MANAGER_SHOOT_PHOTO_MODE_UNKNOWN = 0xFF,  
124 -} E_ZiyanCameraManagerShootPhotoMode;  
125 -  
126 -/*! @brief the photo action of INTERVAL shooting photo mode  
127 - */  
128 -typedef enum {  
129 - ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_PROGRAM_AUTO = 1, /*!< Program mode */  
130 - ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_SHUTTER_PRIORITY = 2, /*!< Shutter priority mode */  
131 - ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_APERTURE_PRIORITY = 3, /*!< Aperture priority mode */  
132 - ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_MANUAL = 4, /*!< Manual mode */  
133 - ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_UNKNOWN = 0xFF /*!< The camera exposure mode is unknown. */  
134 -} E_ZiyanCameraManagerExposureMode;  
135 -  
136 -/*! @brief CameraModule focus mode. If the physical AF switch on the camera is  
137 - * set to auto.  
138 - */  
139 -typedef enum {  
140 - /*!  
141 - - The camera's focus mode is set to manual. In this mode, user sets the  
142 - focus ring value to adjust the focal distance.  
143 - */  
144 - ZIYAN_CAMERA_MANAGER_FOCUS_MODE_MANUAL = 0,  
145 - /*!  
146 - - The camera's focus mode is set to auto. For the Z30 camera, the focus is  
147 - calculated completely automatically. For all other cameras, a focus target  
148 - can be set by the user, which is used to calculate focus automatically.  
149 - */  
150 - ZIYAN_CAMERA_MANAGER_FOCUS_MODE_AUTO = 1,  
151 - /*!  
152 - - The camera's focus mode is set to Continuous AF. It is only supported by  
153 - Mavic Pro with firmware version V01.03.0000 or above, X4S camera, Mavic 2  
154 - Zoom camera and Mavic 2 Pro camera.  
155 - */  
156 - ZIYAN_CAMERA_MANAGER_FOCUS_MODE_AFC = 2,  
157 - /*!  
158 - - The camera's focus mode is unknown.  
159 - */  
160 - ZIYAN_CAMERA_MANAGER_FOCUS_MODE_UNKNOWN = 0xFF,  
161 -} E_ZiyanCameraManagerFocusMode;  
162 -  
163 -/*! @brief CameraModule shutter mode.  
164 - */  
165 -typedef enum {  
166 - /*! The shutter mode of camera is automatical */  
167 - ZIYAN_CAMERA_MANAGER_SHUTTER_AUTO_MODE = 0x00,  
168 - /*! The shutter mode of camera is manual, the shutter speed setting is  
169 - valid. */  
170 - ZIYAN_CAMERA_MANAGER_SHUTTER_MANUAL_MODE = 0x01,  
171 -} E_ZiyanCameraManagerShutterMode;  
172 -  
173 -/*! @brief CameraModule shutter speed values.  
174 - */  
175 -typedef enum {  
176 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_8000 = 0, /*!< 1/8000 s */  
177 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_6400 = 1, /*!< 1/6400 s */  
178 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_6000 = 2, /*!< 1/6000 s */  
179 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_5000 = 3, /*!< 1/5000 s */  
180 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_4000 = 4, /*!< 1/4000 s */  
181 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_3200 = 5, /*!< 1/3200 s */  
182 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_3000 = 6, /*!< 1/3000 s */  
183 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_2500 = 7, /*!< 1/2500 s */  
184 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_2000 = 8, /*!< 1/2000 s */  
185 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1600 = 9, /*!< 1/1600 s */  
186 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1500 = 10, /*!< 1/1500 s */  
187 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1250 = 11, /*!< 1/1250 s */  
188 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1000 = 12, /*!< 1/1000 s */  
189 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_800 = 13, /*!< 1/800 s */  
190 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_725 = 14, /*!< 1/725 s */  
191 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_640 = 15, /*!< 1/640 s */  
192 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_500 = 16, /*!< 1/500 s */  
193 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_400 = 17, /*!< 1/400 s */  
194 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_350 = 18, /*!< 1/350 s */  
195 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_320 = 19, /*!< 1/320 s */  
196 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_250 = 20, /*!< 1/250 s */  
197 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_240 = 21, /*!< 1/240 s */  
198 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_200 = 22, /*!< 1/200 s */  
199 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_180 = 23, /*!< 1/180 s */  
200 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_160 = 24, /*!< 1/160 s */  
201 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_125 = 25, /*!< 1/125 s */  
202 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_120 = 26, /*!< 1/120 s */  
203 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_100 = 27, /*!< 1/100 s */  
204 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_90 = 28, /*!< 1/90 s */  
205 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_80 = 29, /*!< 1/80 s */  
206 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_60 = 30, /*!< 1/60 s */  
207 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_50 = 31, /*!< 1/50 s */  
208 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_40 = 32, /*!< 1/40 s */  
209 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_30 = 33, /*!< 1/30 s */  
210 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_25 = 34, /*!< 1/25 s */  
211 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_20 = 35, /*!< 1/20 s */  
212 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_15 = 36, /*!< 1/15 s */  
213 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_12DOT5 = 37, /*!< 1/12.5 s */  
214 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_10 = 38, /*!< 1/10 s */  
215 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_8 = 39, /*!< 1/8 s */  
216 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_6DOT25 = 40, /*!< 1/6.25 s */  
217 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_5 = 41, /*!< 1/5 s */  
218 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_4 = 42, /*!< 1/4 s */  
219 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_3 = 43, /*!< 1/3 s */  
220 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_2DOT5 = 44, /*!< 1/2.5 s */  
221 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_2 = 45, /*!< 1/2 s */  
222 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1DOT67 = 46, /*!< 1/1.67 s */  
223 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1_1DOT25 = 47, /*!< 1/1.25 s */  
224 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1 = 48, /*!< 1.0 s */  
225 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1DOT3 = 49, /*!< 1.3 s */  
226 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_1DOT6 = 50, /*!< 1.6 s */  
227 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_2 = 51, /*!< 2.0 s */  
228 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_2DOT5 = 52, /*!< 2.5 s */  
229 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_3 = 53, /*!< 3.0 s */  
230 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_3DOT2 = 54, /*!< 3.2 s */  
231 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_4 = 55, /*!< 4.0 s */  
232 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_5 = 56, /*!< 5.0 s */  
233 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_6 = 57, /*!< 6.0 s */  
234 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_7 = 58, /*!< 7.0 s */  
235 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_8 = 59, /*!< 8.0 s */  
236 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_9 = 60, /*!< 9.0 s */  
237 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_10 = 61, /*!< 10.0 s */  
238 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_13 = 62, /*!< 13.0 s */  
239 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_15 = 63, /*!< 15.0 s */  
240 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_20 = 64, /*!< 20.0 s */  
241 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_25 = 65, /*!< 25.0 s */  
242 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_30 = 66, /*!< 30.0 s */  
243 - ZIYAN_CAMERA_MANAGER_SHUTTER_SPEED_UNKNOWN = 0xFF, /*!< Unknown */  
244 -} E_ZiyanCameraManagerShutterSpeed;  
245 -  
246 -/*! @brief CameraModule ISO values.  
247 - */  
248 -typedef enum {  
249 - /*! The ISO value is automatically set. This cannot be used for all cameras  
250 - when in Manual mode. */  
251 - ZIYAN_CAMERA_MANAGER_ISO_AUTO = 0x00,  
252 - /*! The ISO value is set to 100. */  
253 - ZIYAN_CAMERA_MANAGER_ISO_100 = 0x03,  
254 - /*! The ISO value is set to 200. */  
255 - ZIYAN_CAMERA_MANAGER_ISO_200 = 0x04,  
256 - /*! The ISO value is set to 400.*/  
257 - ZIYAN_CAMERA_MANAGER_ISO_400 = 0x05,  
258 - /*! The ISO value is set to 800.*/  
259 - ZIYAN_CAMERA_MANAGER_ISO_800 = 0x06,  
260 - /*! The ISO value is set to 1600.*/  
261 - ZIYAN_CAMERA_MANAGER_ISO_1600 = 0x07,  
262 - /*! The ISO value is set to 3200.*/  
263 - ZIYAN_CAMERA_MANAGER_ISO_3200 = 0x08,  
264 - /*! The ISO value is set to 6400.*/  
265 - ZIYAN_CAMERA_MANAGER_ISO_6400 = 0x09,  
266 - /*! The ISO value is set to 12800.*/  
267 - ZIYAN_CAMERA_MANAGER_ISO_12800 = 0x0A,  
268 - /*! The ISO value is set to 25600.*/  
269 - ZIYAN_CAMERA_MANAGER_ISO_25600 = 0x0B,  
270 - /*! ISO value is fixed by the camera firmware. When the camera color is set  
271 - to D_LOG, camera will fix the ISO to a specific value in order to optimize  
272 - the performance.  
273 - */  
274 - ZIYAN_CAMERA_MANAGER_ISO_FIXED = 0xFF,  
275 -} E_ZiyanCameraManagerISO;  
276 -  
277 -/*! @brief CameraModule exposure compensation.  
278 - */  
279 -typedef enum {  
280 - /*! The camera's exposure compensation is -5.0ev.*/  
281 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_5_0 = 1,  
282 - /*! The camera's exposure compensation is -4.7ev.*/  
283 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_4_7 = 2,  
284 - /*! The camera's exposure compensation is -4.3ev.*/  
285 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_4_3 = 3,  
286 - /*! The camera's exposure compensation is -4.0ev.*/  
287 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_4_0 = 4,  
288 - /*! The camera's exposure compensation is -3.7ev.*/  
289 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_3_7 = 5,  
290 - /*! The camera's exposure compensation is -3.3ev.*/  
291 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_3_3 = 6,  
292 - /*! The camera's exposure compensation is -3.0ev.*/  
293 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_3_0 = 7,  
294 - /*! The camera's exposure compensation is -2.7ev.*/  
295 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_2_7 = 8,  
296 - /*! The camera's exposure compensation is -2.3ev.*/  
297 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_2_3 = 9,  
298 - /*! The camera's exposure compensation is -2.0ev.*/  
299 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_2_0 = 10,  
300 - /*! The camera's exposure compensation is -1.7ev.*/  
301 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_1_7 = 11,  
302 - /*! The camera's exposure compensation is -1.3ev.*/  
303 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_1_3 = 12,  
304 - /*! The camera's exposure compensation is -1.0ev.*/  
305 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_1_0 = 13,  
306 - /*! The camera's exposure compensation is -0.7ev.*/  
307 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_0_7 = 14,  
308 - /*! The camera's exposure compensation is -0.3ev.*/  
309 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_0_3 = 15,  
310 - /*! The camera's exposure compensation is 0.0ev.*/  
311 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_N_0_0 = 16,  
312 - /*! The camera's exposure compensation is +0.3ev.*/  
313 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_0_3 = 17,  
314 - /*! The camera's exposure compensation is +0.7ev.*/  
315 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_0_7 = 18,  
316 - /*! The camera's exposure compensation is +1.0ev.*/  
317 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_1_0 = 19,  
318 - /*! The camera's exposure compensation is +1.3ev.*/  
319 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_1_3 = 20,  
320 - /*! The camera's exposure compensation is +1.7ev.*/  
321 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_1_7 = 21,  
322 - /*! The camera's exposure compensation is +2.0ev.*/  
323 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_2_0 = 22,  
324 - /*! The camera's exposure compensation is +2.3ev.*/  
325 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_2_3 = 23,  
326 - /*! The camera's exposure compensation is +2.7ev.*/  
327 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_2_7 = 24,  
328 - /*! The camera's exposure compensation is +3.0ev.*/  
329 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_3_0 = 25,  
330 - /*! The camera's exposure compensation is +3.3ev.*/  
331 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_3_3 = 26,  
332 - /*! The camera's exposure compensation is +3.7ev.*/  
333 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_3_7 = 27,  
334 - /*! The camera's exposure compensation is +4.0ev.*/  
335 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_4_0 = 28,  
336 - /*! The camera's exposure compensation is +4.3ev.*/  
337 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_4_3 = 29,  
338 - /*! The camera's exposure compensation is +4.7ev.*/  
339 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_4_7 = 30,  
340 - /*! The camera's exposure compensation is +5.0ev.*/  
341 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_P_5_0 = 31,  
342 - /*! The camera's exposure compensation is fixed by the camera.*/  
343 - ZIYAN_CAMERA_MANAGER_EXPOSURE_COMPENSATION_FIXED = 0xFF,  
344 -} E_ZiyanCameraManagerExposureCompensation;  
345 -  
346 -/*! @brief CameraModule aperture values.  
347 - * @note X5, X5R, Z30, Phantom 4 Pro camera, X4S and X5S support this  
348 - * setting.  
349 - */  
350 -typedef enum {  
351 - /*! The Aperture value is f/1.6. It is only supported by Z30  
352 - camera.*/  
353 - ZIYAN_CAMERA_MANAGER_APERTURE_F_1_DOT_6 = 160,  
354 - /*! The Aperture value is f/1.7.*/  
355 - ZIYAN_CAMERA_MANAGER_APERTURE_F_1_DOT_7 = 170,  
356 - /*! The Aperture value is f/1.8.*/  
357 - ZIYAN_CAMERA_MANAGER_APERTURE_F_1_DOT_8 = 180,  
358 - /*! The Aperture value is f/2.*/  
359 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2 = 200,  
360 - /*! The Aperture value is f/2.2.*/  
361 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2_DOT_2 = 220,  
362 - /*! The Aperture value is f/2.4. It is only supported by Z30 camera.*/  
363 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2_DOT_4 = 240,  
364 - /*! The Aperture value is f/2.5.*/  
365 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2_DOT_5 = 250,  
366 - /*! The Aperture value is f/2.6.*/  
367 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2_DOT_6 = 260,  
368 - /*! The Aperture value is f/2.8.*/  
369 - ZIYAN_CAMERA_MANAGER_APERTURE_F_2_DOT_8 = 280,  
370 - /*! The Aperture value is f/3.2.*/  
371 - ZIYAN_CAMERA_MANAGER_APERTURE_F_3_DOT_2 = 320,  
372 - /*! The Aperture value is f/3.4.*/  
373 - ZIYAN_CAMERA_MANAGER_APERTURE_F_3_DOT_4 = 340,  
374 - /*! The Aperture value is f/3.5.*/  
375 - ZIYAN_CAMERA_MANAGER_APERTURE_F_3_DOT_5 = 350,  
376 - /*! The Aperture value is f/4.*/  
377 - ZIYAN_CAMERA_MANAGER_APERTURE_F_4 = 400,  
378 - /*! The Aperture value is f/4.5.*/  
379 - ZIYAN_CAMERA_MANAGER_APERTURE_F_4_DOT_5 = 450,  
380 - /*! The Aperture value is f/4.8.*/  
381 - ZIYAN_CAMERA_MANAGER_APERTURE_F_4_DOT_8 = 480,  
382 - /*! The Aperture value is f/5.*/  
383 - ZIYAN_CAMERA_MANAGER_APERTURE_F_5 = 500,  
384 - /*! The Aperture value is f/5.6.*/  
385 - ZIYAN_CAMERA_MANAGER_APERTURE_F_5_DOT_6 = 560,  
386 - /*! The Aperture value is f/6.3.*/  
387 - ZIYAN_CAMERA_MANAGER_APERTURE_F_6_DOT_3 = 630,  
388 - /*! The Aperture value is f/6.8.*/  
389 - ZIYAN_CAMERA_MANAGER_APERTURE_F_6_DOT_8 = 680,  
390 - /*! The Aperture value is f/7.1.*/  
391 - ZIYAN_CAMERA_MANAGER_APERTURE_F_7_DOT_1 = 710,  
392 - /*! The Aperture value is f/8.*/  
393 - ZIYAN_CAMERA_MANAGER_APERTURE_F_8 = 800,  
394 - /*! The Aperture value is f/9.*/  
395 - ZIYAN_CAMERA_MANAGER_APERTURE_F_9 = 900,  
396 - /*! The Aperture value is f/9.6.*/  
397 - ZIYAN_CAMERA_MANAGER_APERTURE_F_9_DOT_6 = 960,  
398 - /*! The Aperture value is f/10.*/  
399 - ZIYAN_CAMERA_MANAGER_APERTURE_F_10 = 1000,  
400 - /*! The Aperture value is f/11.*/  
401 - ZIYAN_CAMERA_MANAGER_APERTURE_F_11 = 1100,  
402 - /*! The Aperture value is f/13.*/  
403 - ZIYAN_CAMERA_MANAGER_APERTURE_F_13 = 1300,  
404 - /*! The Aperture value is f/14.*/  
405 - ZIYAN_CAMERA_MANAGER_APERTURE_F_14 = 1400,  
406 - /*! The Aperture value is f/16.*/  
407 - ZIYAN_CAMERA_MANAGER_APERTURE_F_16 = 1600,  
408 - /*! The Aperture value is f/18.*/  
409 - ZIYAN_CAMERA_MANAGER_APERTURE_F_18 = 1800,  
410 - /*! The Aperture value is f/19.*/  
411 - ZIYAN_CAMERA_MANAGER_APERTURE_F_19 = 1900,  
412 - /*! The Aperture value is f/20.*/  
413 - ZIYAN_CAMERA_MANAGER_APERTURE_F_20 = 2000,  
414 - /*! The Aperture value is f/22.*/  
415 - ZIYAN_CAMERA_MANAGER_APERTURE_F_22 = 2200,  
416 - /*! The Aperture value is Unknown. */  
417 - ZIYAN_CAMERA_MANAGER_APERTURE_F_UNKNOWN = 0xFFFF,  
418 -} E_ZiyanCameraManagerAperture;  
419 -  
420 -typedef enum {  
421 - ZIYAN_CAMERA_MANAGER_RECORDING_CONTROL_STOP = 0,  
422 - ZIYAN_CAMERA_MANAGER_RECORDING_CONTROL_BEGIN = 1,  
423 - ZIYAN_CAMERA_MANAGER_RECORDING_CONTROL_PAUSE = 2,  
424 - ZIYAN_CAMERA_MANAGER_RECORDING_CONTROL_RESUME = 3,  
425 -} E_ZiyanCameraManagerRecordingControl;  
426 -  
427 -typedef enum {  
428 - ZIYAN_CAMERA_MANAGER_FILE_LIST_COUNT_60_PER_SLICE = 60,  
429 - ZIYAN_CAMERA_MANAGER_FILE_LIST_COUNT_120_PER_SLICE = 120,  
430 - ZIYAN_CAMERA_MANAGER_FILE_LIST_COUNT_ALL_PER_SLICE = 0xFFFF,  
431 -} E_ZiyanCameraManagerFileListCountPerSlice;  
432 -  
433 -typedef enum {  
434 - ZIYAN_CAMERA_MANAGER_SOURCE_DEFAULT_CAM = 0x0,  
435 - ZIYAN_CAMERA_MANAGER_SOURCE_WIDE_CAM = 0x1,  
436 - ZIYAN_CAMERA_MANAGER_SOURCE_ZOOM_CAM = 0x2,  
437 - ZIYAN_CAMERA_MANAGER_SOURCE_IR_CAM = 0x3,  
438 - ZIYAN_CAMERA_MANAGER_SOURCE_VISIBLE_CAM = 0x7,  
439 -} E_ZiyanCameraManagerStreamSource, E_ZiyanCameraManagerStreamStorage;  
440 -  
441 -typedef enum {  
442 - ZIYAN_CAMERA_MANAGER_NIGHT_SCENE_MODE_DISABLE = 0,  
443 - ZIYAN_CAMERA_MANAGER_NIGHT_SCENE_MODE_ENABLE = 1,  
444 - ZIYAN_CAMERA_MANAGER_NIGHT_SCENE_MODE_AUTO = 2,  
445 -} E_ZiyanCameraManagerNightSceneMode;  
446 -  
447 -typedef enum {  
448 - ZIYAN_CAMERA_MANAGER_CAPTURE_OR_RECORDING_CAPTURE = 0,  
449 - ZIYAN_CAMERA_MANAGER_CAPTURE_OR_RECORDING_RECORDING = 1,  
450 -} E_ZiyanCameraManagerCaptureOrRecording;  
451 -  
452 -typedef enum {  
453 - ZIYAN_CAMERA_MANAGER_EXPAND_NAME_TYPE_FILE = 1,  
454 - ZIYAN_CAMERA_MANAGER_EXPAND_NAME_TYPE_DIR = 2,  
455 -} E_ZiyanCameraManagerExpandNameType;  
456 -  
457 -typedef enum {  
458 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_4X3 = 0,  
459 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_16X9 = 1,  
460 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_3X2 = 2,  
461 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_1X1 = 3,  
462 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_18X3 = 4,  
463 - ZIYAN_CAMERA_MANAGER_PHOTO_RATIO_5X4 = 5,  
464 -} E_ZiyanCameraManagerPhotoRatio;  
465 -  
466 -typedef struct {  
467 - uint8_t firmware_version[4];  
468 -} T_ZiyanCameraManagerFirmwareVersion;  
469 -  
470 -/*! @brief Tap zoom target point data struct, used by user.  
471 - */  
472 -typedef T_ZiyanCameraPointInScreen T_ZiyanCameraManagerTapZoomPosData;  
473 -  
474 -/*! @brief Tap focus target point data struct, used by user.  
475 - */  
476 -typedef T_ZiyanCameraPointInScreen T_ZiyanCameraManagerFocusPosData;  
477 -  
478 -typedef struct {  
479 - ziyan_f32_t currentOpticalZoomFactor;  
480 - ziyan_f32_t maxOpticalZoomFactor;  
481 -} T_ZiyanCameraManagerOpticalZoomParam;  
482 -  
483 -typedef struct {  
484 - uint8_t second;  
485 - uint8_t minute;  
486 - uint8_t hour;  
487 - uint8_t day;  
488 - uint8_t month;  
489 - uint16_t year;  
490 -} T_ZiyanCameraManagerFileCreateTime;  
491 -  
492 -typedef struct {  
493 - union {  
494 - struct {  
495 - uint32_t attributePhotoReserved: 22;  
496 - uint32_t attributePhotoRatio: 8;  
497 - uint32_t attributePhotoRotation: 2;  
498 - uint8_t reserved[12];  
499 - } photoAttribute;  
500 - struct {  
501 - uint32_t attributeVideoDuration: 16;  
502 - uint32_t attributeVideoFramerate: 6;  
503 - uint32_t attributeVideoRotation: 2;  
504 - uint32_t attributeVideoResolution: 8;  
505 - uint8_t reserved[12];  
506 - } videoAttribute;  
507 - };  
508 -} T_ZiyanCameraManagerFileAttributeData;  
509 -  
510 -typedef struct {  
511 - char fileName[ZIYAN_FILE_NAME_SIZE_MAX];  
512 - uint32_t fileSize;  
513 - uint32_t fileIndex;  
514 - T_ZiyanCameraManagerFileCreateTime createTime;  
515 - E_ZiyanCameraMediaFileSubType type;  
516 - T_ZiyanCameraManagerFileAttributeData attributeData;  
517 -} T_ZiyanCameraManagerSubFileListInfo;  
518 -  
519 -typedef struct {  
520 - char fileName[ZIYAN_FILE_NAME_SIZE_MAX];  
521 - uint32_t fileSize;  
522 - uint32_t fileIndex;  
523 - T_ZiyanCameraManagerFileCreateTime createTime;  
524 - E_ZiyanCameraMediaFileType type;  
525 - T_ZiyanCameraManagerFileAttributeData attributeData;  
526 - uint8_t subFileListTotalNum;  
527 - T_ZiyanCameraManagerSubFileListInfo* subFileListInfo;  
528 -} T_ZiyanCameraManagerFileListInfo;  
529 -  
530 -typedef struct {  
531 - uint16_t totalCount;  
532 - T_ZiyanCameraManagerFileListInfo *fileListInfo;  
533 -} T_ZiyanCameraManagerFileList;  
534 -  
535 -typedef struct {  
536 - uint16_t sliceStartIndex;  
537 - E_ZiyanCameraManagerFileListCountPerSlice countPerSlice;  
538 -} T_ZiyanCameraManagerSliceConfig;  
539 -  
540 -typedef enum {  
541 - ZIYAN_DOWNLOAD_FILE_EVENT_START,  
542 - ZIYAN_DOWNLOAD_FILE_EVENT_TRANSFER,  
543 - ZIYAN_DOWNLOAD_FILE_EVENT_END,  
544 - ZIYAN_DOWNLOAD_FILE_EVENT_START_TRANSFER_END,  
545 -} E_ZiyanDownloadFileEvent;  
546 -  
547 -typedef enum {  
548 - ZIYAN_CAMERA_MANAGER_VIDEO_RESOLUTION_640X480P = 0, // 640X480P  
549 - ZIYAN_CAMERA_MANAGER_VIDEO_RESOLUTION_1280X640P = 2, // 1280X640P  
550 - ZIYAN_CAMERA_MANAGER_VIDEO_RESOLUTION_1280X720P = 4, // 1280X720P  
551 - ZIYAN_CAMERA_MANAGER_VIDEO_RESOLUTION_1920X1080P = 10, // 1920X1080P  
552 - ZIYAN_CAMERA_MANAGER_VIDEO_RESOLUTION_3840X2160P = 16, // 3840X2160P  
553 -} E_ZiyanCameraManagerVideoResolution;  
554 -  
555 -typedef enum {  
556 - ZIYAN_CAMERA_MANAGER_VIDEO_FRAME_RATE_15FPS = 0, // 14.985  
557 - ZIYAN_CAMERA_MANAGER_VIDEO_FRAME_RATE_25FPS = 2, // 25.000  
558 - ZIYAN_CAMERA_MANAGER_VIDEO_FRAME_RATE_30FPS = 3, // 29.970  
559 - ZIYAN_CAMERA_MANAGER_VIDEO_FRAME_RATE_60FPS = 6, // 59.940  
560 -} E_ZiyanCameraManagerVideoFrameRate;  
561 -  
562 -typedef enum {  
563 - ZIYAN_CAMERA_MANAGER_PHOTO_STORAGE_FORMAT_RAW = 0,  
564 - ZIYAN_CAMERA_MANAGER_PHOTO_STORAGE_FORMAT_JPEG = 1,  
565 - ZIYAN_CAMERA_MANAGER_PHOTO_STORAGE_FORMAT_RAW_JPEG = 2,  
566 - ZIYAN_CAMERA_MANAGER_PHOTO_STORAGE_FORMAT_YUV = 3, // Save as YUV format image  
567 - ZIYAN_CAMERA_MANAGER_PHOTO_STORAGE_FORMAT_RJPEG = 7, // Radiometric JPEG  
568 -} E_ZiyanCameraManagerPhotoStorageFormat;  
569 -  
570 -typedef enum {  
571 - ZIYAN_CAMERA_MANAGER_VIDEO_STORAGE_FORMAT_MOV = 0,  
572 - ZIYAN_CAMERA_MANAGER_VIDEO_STORAGE_FORMAT_MP4 = 1,  
573 -} E_ZiyanCameraManagerVideoStorageFormat;  
574 -  
575 -typedef enum {  
576 - ZIYAN_CAMERA_MANAGER_METERING_MODE_CENTRAL = 0,  
577 - ZIYAN_CAMERA_MANAGER_METERING_MODE_AVERAGE = 1,  
578 - ZIYAN_CAMERA_MANAGER_METERING_MODE_SPOT = 2,  
579 -} E_ZiyanCameraManagerMeteringMode;  
580 -  
581 -typedef enum {  
582 - ZIYAN_CAMERA_MANAGER_FFC_MODE_MANUAL = 0,  
583 - ZIYAN_CAMERA_MANAGER_FFC_MODE_AUTO = 1,  
584 -} E_ZiyanCameraManagerFfcMode;  
585 -  
586 -typedef enum {  
587 - ZIYAN_CAMERA_MANAGER_IR_GAIN_MODE_AUTO = 0,  
588 - ZIYAN_CAMERA_MANAGER_IR_GAIN_MODE_LOW = 1,  
589 - ZIYAN_CAMERA_MANAGER_IR_GAIN_MODE_HIGH = 2,  
590 -} E_ZiyanCameraManagerIrGainMode;  
591 -  
592 -typedef enum {  
593 - /* Camera is not capturing photos*/  
594 - ZIYAN_CAMERA_MANAGER_CAPTURING_STATE_IDLE = 0,  
595 -  
596 - /* Camera is capturing a single photo */  
597 - ZIYAN_CAMERA_MANAGER_CAPTURING_STATE_SINGLE = 1,  
598 -  
599 - /* Camera is capturing multiple photos */  
600 - ZIYAN_CAMERA_MANAGER_CAPTURING_STATE_MULTI = 2,  
601 -} E_ZiyanCameraManagerCapturingState;  
602 -  
603 -typedef enum {  
604 - ZIYAN_CAMERA_MANAGER_RECORDING_STATE_IDLE = 0,  
605 - ZIYAN_CAMERA_MANAGER_RECORDING_STATE_STARTING = 1,  
606 - ZIYAN_CAMERA_MANAGER_RECORDING_STATE_RECORDING = 2,  
607 - ZIYAN_CAMERA_MANAGER_RECORDING_STATE_STOPPING = 3,  
608 -} E_ZiyanCameraManagerRecordingState;  
609 -  
610 -/*! @brief: when the remote control is in split-screen mode, the coordinate range of the x-axis is 0-0.5.  
611 - */  
612 -typedef struct {  
613 - ziyan_f32_t pointX; /*! x-coordinate of point thermometry, range: 0-1 */  
614 - ziyan_f32_t pointY; /*! y-coordinate of point thermometry, range: 0-1 */  
615 -} T_ZiyanCameraManagerPointThermometryCoordinate;  
616 -  
617 -typedef struct {  
618 - ziyan_f32_t areaTempLtX; /*! x-coordinate of the upper left corner of the area thermometry, range: 0-1 */  
619 - ziyan_f32_t areaTempLtY; /*! y-coordinate of the upper left corner of the area thermometry, range: 0-1 */  
620 - ziyan_f32_t areaTempRbX; /*! x-coordinate of the lower right corner of the area thermometry, range: 0-1 */  
621 - ziyan_f32_t areaTempRbY; /*! y-coordinate of the lower right corner of the area thermometry, range: 0-1 */  
622 -} T_ZiyanCameraManagerAreaThermometryCoordinate;  
623 -  
624 -//result of point thermometry  
625 -typedef struct {  
626 - ziyan_f32_t pointX; /*! x-coordinate of point thermometry, range: 0-1 */  
627 - ziyan_f32_t pointY; /*! y-coordinate of point thermometry, range: 0-1 */  
628 - ziyan_f32_t pointTemperature; /*! The temperature of the current point */  
629 -} T_ZiyanCameraManagerPointThermometryData;  
630 -  
631 -//result of area thermometry  
632 -typedef struct {  
633 - ziyan_f32_t areaTempLtX; /*! x_coordinate of the upper left corner of the current thermometry area */  
634 - ziyan_f32_t areaTempLtY; /*! y_coordinate of the upper left corner of the current thermometry area */  
635 - ziyan_f32_t areaTempRbX; /*! x_coordinate of the lower right corner of the current thermometry area */  
636 - ziyan_f32_t areaTempRbY; /*! y_coordinate of the lower right corner of the current thermometry area */  
637 - ziyan_f32_t areaAveTemp; /*! The average temperature of the current thermometry area */  
638 - ziyan_f32_t areaMinTemp; /*! The minimum temperature of the current thermometry area */  
639 - ziyan_f32_t areaMaxTemp; /*! The maximum temperature of the current thermometry area */  
640 - ziyan_f32_t areaMinTempPointX; /*! x_coordinate of the minimum temperature in the thermometry area */  
641 - ziyan_f32_t areaMinTempPointY; /*! y_coordinate of the minimum temperature in the thermometry area */  
642 - ziyan_f32_t areaMaxTempPointX; /*! x_coordinate of the maximum temperature in the thermometry area */  
643 - ziyan_f32_t areaMaxTempPointY; /*! y_coordinate of the maximum temperature in the thermometry area */  
644 -} T_ZiyanCameraManagerAreaThermometryData;  
645 -  
646 -typedef struct {  
647 - E_ZiyanDownloadFileEvent downloadFileEvent;  
648 - uint8_t fileType;  
649 - uint32_t fileIndex;  
650 - uint32_t fileSize;  
651 - ziyan_f32_t progressInPercent;  
652 -} T_ZiyanDownloadFilePacketInfo;  
653 -  
654 -typedef struct {  
655 - ziyan_f64_t longitude; /*! Range: [-180,180] */  
656 - ziyan_f64_t latitude; /*! Range: [-90,90] */  
657 - int32_t altitude; /*! Unit: 0.1m */  
658 - int32_t distance; /*! Unit: 0.1m */  
659 - int16_t screenX; /*! Unit: 0.1% */  
660 - int16_t screenY; /*! Unit: 0.1% */  
661 - bool enable_lidar;  
662 - uint8_t exception;  
663 -} T_ZiyanCameraManagerLaserRangingInfo;  
664 -  
665 -typedef struct {  
666 - uint32_t size;  
667 - E_ZiyanCameraManagerStreamSource streamSource[4];  
668 - E_ZiyanCameraManagerStreamStorage streamStorage[4];  
669 -} T_ZiyanCameraManagerStreamList;  
670 -  
671 -typedef struct {  
672 - E_ZiyanCameraManagerVideoResolution videoResolution;  
673 - E_ZiyanCameraManagerVideoFrameRate videoFrameRate;  
674 -} T_ZiyanCameraManagerVideoFormat;  
675 -  
676 -typedef struct {  
677 - uint8_t size;  
678 - union {  
679 - E_ZiyanCameraManagerPhotoStorageFormat photoStorageFormat[16];  
680 - E_ZiyanCameraManagerVideoStorageFormat videoStorageFormat[16];  
681 - E_ZiyanCameraManagerPhotoRatio photoRatioFormat[16];  
682 - E_ZiyanCameraManagerStreamSource streamSource[16];  
683 - E_ZiyanCameraManagerStreamStorage streamStorage[16];  
684 - E_ZiyanCameraManagerNightSceneMode nightSceneMode[16];  
685 - };  
686 - uint32_t minValue;  
687 - uint32_t maxValue;  
688 -} T_ZiyanCameraManagerRangeList;  
689 -  
690 -typedef struct {  
691 - double lowGainTempMin;  
692 - double lowGainTempMax;  
693 - double highGainTempMin;  
694 - double highGainTempMax;  
695 -} T_ZiyanCameraManagerIrTempMeterRange;  
696 -  
697 -typedef struct {  
698 - uint32_t totalCapacity; /* MByte */  
699 - uint32_t remainCapacity; /* MByte */  
700 -} T_ZiyanCameraManagerStorageInfo;  
701 -  
702 -typedef struct {  
703 - uint32_t flag; /* 0xFFFFFFFF */  
704 - uint32_t seqNum;  
705 - uint64_t timestamp;  
706 - uint32_t dataByte; /* actual num of bytes used for points */  
707 -} __attribute__((packed)) T_ZiyanCameraManagerPointCloudHeader;  
708 -  
709 -typedef struct {  
710 - ziyan_f32_t x; /* the x-axis of NED coordinate system */  
711 - ziyan_f32_t y; /* the y-axis of NED coordinate system */  
712 - ziyan_f32_t z; /* the z-axis of NED coordinate system */  
713 - uint8_t intensity;  
714 - uint8_t r;  
715 - uint8_t g;  
716 - uint8_t b;  
717 -}__attribute__((packed)) T_ZiyanCameraManagerPointXYZRGBInfo;  
718 -  
719 -typedef struct {  
720 - T_ZiyanCameraManagerPointCloudHeader pointCloudHeader;  
721 - uint32_t crc_header;  
722 - uint32_t crc_rest;  
723 - T_ZiyanCameraManagerPointXYZRGBInfo points[1];  
724 -}__attribute__((packed)) T_ZiyanCameraManagerColorPointCloud;  
725 -  
726 -typedef T_ZiyanReturnCode (*ZiyanCameraManagerDownloadFileDataCallback)(T_ZiyanDownloadFilePacketInfo packetInfo,  
727 - const uint8_t *data,  
728 - uint16_t dataLen);  
729 -  
730 -/* Exported functions --------------------------------------------------------*/  
731 -/**  
732 - * @brief Initialise camera manager module, and user should call this function  
733 - * before using camera manager features.  
734 - * @return Execution result.  
735 - */  
736 -T_ZiyanReturnCode ZiyanCameraManager_Init(void);  
737 -  
738 -/**  
739 - * @brief Deinitialise camera manager module.  
740 - * @return Execution result.  
741 - */  
742 -T_ZiyanReturnCode ZiyanCameraManager_DeInit(void);  
743 -  
744 -/**  
745 - * @brief Get camera type of the selected camera mounted position.  
746 - * @param position: camera mounted position  
747 - * @param cameraType: refer to E_ZiyanCameraType.  
748 - * @return Execution result.  
749 - */  
750 -T_ZiyanReturnCode ZiyanCameraManager_GetCameraType(E_ZiyanMountPosition position, E_ZiyanCameraType *cameraType);  
751 -  
752 -/**  
753 - * @brief Get camera firmware version of the selected camera mounted position.  
754 - * @param position: camera mounted position  
755 - * @param firmwareVersion: refer to T_ZiyanCameraManagerFirmwareVersion.  
756 - * @return Execution result.  
757 - */  
758 -T_ZiyanReturnCode ZiyanCameraManager_GetFirmwareVersion(E_ZiyanMountPosition position,  
759 - T_ZiyanCameraManagerFirmwareVersion *firmwareVersion);  
760 -  
761 -/**  
762 - * @brief Get camera connection status.  
763 - * @param position: camera mounted position  
764 - * @param connectStatus: returned value of connection status  
765 - * @return Execution result.  
766 - */  
767 -T_ZiyanReturnCode ZiyanCameraManager_GetCameraConnectStatus(E_ZiyanMountPosition position,  
768 - bool *connectStatus);  
769 -  
770 -/**  
771 - * @brief Set camera working mode of the selected camera mounted position.  
772 - * @note Set the camera's work mode to options such as taking pictures, recording video,  
773 - * playback, or downloading. Please note that you cannot change the mode when a certain  
774 - * task is executing. This action takes about 1-2 s.  
775 - * @param position: camera mounted position  
776 - * @param workMode: refer to E_ZiyanCameraManagerWorkMode.  
777 - * @return Execution result.  
778 - */  
779 -T_ZiyanReturnCode ZiyanCameraManager_SetMode(E_ZiyanMountPosition position,  
780 - E_ZiyanCameraManagerWorkMode workMode);  
781 -  
782 -/**  
783 - * @brief Get camera working mode of the selected camera mounted position.  
784 - * @param position: camera mounted position  
785 - * @param workMode: refer to E_ZiyanCameraManagerWorkMode.  
786 - * @return Execution result.  
787 - */  
788 -T_ZiyanReturnCode ZiyanCameraManager_GetMode(E_ZiyanMountPosition position,  
789 - E_ZiyanCameraManagerWorkMode *workMode);  
790 -  
791 -/**  
792 -* @brief Set camera shoot mode of the selected camera mounted position.  
793 -* @param position: camera mounted position  
794 -* @param mode: refer to E_ZiyanCameraManagerShootPhotoMode.  
795 -* @return Execution result.  
796 -*/  
797 -T_ZiyanReturnCode ZiyanCameraManager_SetShootPhotoMode(E_ZiyanMountPosition position,  
798 - E_ZiyanCameraManagerShootPhotoMode mode);  
799 -  
800 -/**  
801 -* @brief Get camera shoot mode of the selected camera mounted position.  
802 -* @param position: camera mounted position  
803 -* @param mode: refer to E_ZiyanCameraManagerShootPhotoMode.  
804 -* @return Execution result.  
805 -*/  
806 -T_ZiyanReturnCode ZiyanCameraManager_GetShootPhotoMode(E_ZiyanMountPosition position,  
807 - E_ZiyanCameraManagerShootPhotoMode *takePhotoMode);  
808 -  
809 -/**  
810 - * @brief Start shooting photo.  
811 - * @note Camera must be in ShootPhoto mode. For thermal imaging cameras,  
812 - * it is allowed to take a single photo while recording video. Check the SD  
813 - * card's capacity before using this method to ensure there is enough space.  
814 - * @param position: camera mounted position  
815 - * @param mode: refer to E_ZiyanCameraManagerShootPhotoMode.  
816 - * @return Execution result.  
817 - */  
818 -T_ZiyanReturnCode ZiyanCameraManager_StartShootPhoto(E_ZiyanMountPosition position,  
819 - E_ZiyanCameraManagerShootPhotoMode mode);  
820 -  
821 -/**  
822 - * @brief Stop shooting photo.  
823 - * @note Camera must be in ShootPhoto mode and the shoot mode is either  
824 - * Interval or Time-lapse. If set to single shot mode, the camera will  
825 - * automatically stop after taking the photo.  
826 - * @param position: camera mounted position  
827 - * @return Execution result.  
828 - */  
829 -T_ZiyanReturnCode ZiyanCameraManager_StopShootPhoto(E_ZiyanMountPosition position);  
830 -  
831 -/**  
832 - * @brief Get camera capturing state.  
833 - * @note This API is not supported by L1/P1/M3D/M3TD models.  
834 - * @param position: camera mounted position  
835 - * @param capturingState: result of getting, see E_ZiyanCameraManagerCapturingState.  
836 - * @return Execution result.  
837 - */  
838 -T_ZiyanReturnCode ZiyanCameraManager_GetCapturingState(E_ZiyanMountPosition position,  
839 - E_ZiyanCameraManagerCapturingState *capturingState);  
840 -  
841 -/**  
842 - * @brief Set the burst count for burst shooting mode.  
843 - * @param position: camera mounted position  
844 - * @param count: refer to E_ZiyanCameraBurstCount.  
845 - * @return Execution result.  
846 - */  
847 -T_ZiyanReturnCode ZiyanCameraManager_SetPhotoBurstCount(E_ZiyanMountPosition position,  
848 - E_ZiyanCameraBurstCount count);  
849 -  
850 -/**  
851 - * @brief Set the parameters for INTERVAL shooting mode.  
852 - * @note In this mode, the camera captures a photo, waits a specified interval  
853 - * of time, then captures another photo, continuing until the set number of  
854 - * photos is reached. Supported by thermal imaging cameras, too.  
855 - * @param position: camera mounted position  
856 - * @param intervalSetting: refer to T_ZiyanCameraPhotoTimeIntervalSettings.  
857 - * @return Execution result.  
858 - */  
859 -T_ZiyanReturnCode ZiyanCameraManager_SetPhotoTimeIntervalSettings(E_ZiyanMountPosition position,  
860 - T_ZiyanCameraPhotoTimeIntervalSettings intervalSetting);  
861 -  
862 -/**  
863 - * @brief Get the parameters for INTERVAL shooting mode.  
864 - * @param position: camera mounted position  
865 - * @param intervalSetting: refer to T_ZiyanCameraPhotoTimeIntervalSettings.  
866 - * @return Execution result.  
867 - */  
868 -T_ZiyanReturnCode ZiyanCameraManager_GetPhotoTimeIntervalSettings(E_ZiyanMountPosition position,  
869 - T_ZiyanCameraPhotoTimeIntervalSettings *intervalSetting);  
870 -  
871 -/**  
872 - * @brief Get the remaining time of interval shooting.  
873 - * @note Not supported by L1/P1/M3D/M3TD models.  
874 - * @param position: camera mounted position  
875 - * @param remainTime: time in seconds.  
876 - * @return Execution result.  
877 - */  
878 -T_ZiyanReturnCode ZiyanCameraManager_GetIntervalShootingRemainTime(E_ZiyanMountPosition position,  
879 - uint8_t *remainTime);  
880 -  
881 -/**  
882 - * @brief Set camera focus mode of the selected camera mounted position.  
883 - * @note Set the lens focus mode. In auto focus mode, the target  
884 - * point is the focal point. In manual focus mode, if focus assist is  
885 - * enabled, it adjusts focus in the zoomed-out area.  
886 - * @param position: camera mounted position  
887 - * @param focusMode: refer to E_ZiyanCameraManagerFocusMode.  
888 - * @return Execution result.  
889 - */  
890 -T_ZiyanReturnCode ZiyanCameraManager_SetFocusMode(E_ZiyanMountPosition position,  
891 - E_ZiyanCameraManagerFocusMode focusMode);  
892 -/**  
893 - * @brief Get camera focus mode of the selected camera mounted position.  
894 - * @param position: camera mounted position  
895 - * @param focusMode: refer to E_ZiyanCameraManagerFocusMode.  
896 - * @return Execution result.  
897 - */  
898 -T_ZiyanReturnCode ZiyanCameraManager_GetFocusMode(E_ZiyanMountPosition position,  
899 - E_ZiyanCameraManagerFocusMode *focusMode);  
900 -  
901 -/**  
902 - * @brief Set camera focus point of the selected camera mounted position.  
903 - * @note Sets the target point for focusing. In auto mode, this is the focal  
904 - * point. In manual mode with focus assist enabled, it's the zoomed-out area.  
905 - * @param position: camera mounted position  
906 - * @param focusPosData: refer to T_ZiyanCameraManagerFocusPosData.  
907 - * @return Execution result.  
908 - */  
909 -T_ZiyanReturnCode ZiyanCameraManager_SetFocusTarget(E_ZiyanMountPosition position,  
910 - T_ZiyanCameraManagerFocusPosData focusPosData);  
911 -  
912 -/**  
913 - * @brief Get camera focus point of the selected camera mounted position.  
914 - * @param position: camera mounted position  
915 - * @param focusPosData: refer to T_ZiyanCameraManagerFocusPosData.  
916 - * @return Execution result.  
917 - */  
918 -T_ZiyanReturnCode ZiyanCameraManager_GetFocusTarget(E_ZiyanMountPosition position,  
919 - T_ZiyanCameraManagerFocusPosData *tapFocusPos);  
920 -  
921 -/**  
922 - * @brief Start camera optical zooming of the selected camera mounted position.  
923 - * @note Changes the lens's focal length in the specified direction at a specified  
924 - * speed. Zooming stops at the lens's max or min focal length or when  
925 - * StopContinuousOpticalZoom is called.  
926 - * @param position: camera mounted position  
927 - * @param zoomDirection: optical zoom direction, refer to E_ZiyanCameraZoomDirection.  
928 - * @param zoomSpeed: optical zoom direction, refer to E_ZiyanCameraZoomSpeed.  
929 - * @return Execution result.  
930 - */  
931 -T_ZiyanReturnCode ZiyanCameraManager_StartContinuousOpticalZoom(E_ZiyanMountPosition position,  
932 - E_ZiyanCameraZoomDirection zoomDirection,  
933 - E_ZiyanCameraZoomSpeed zoomSpeed);  
934 -  
935 -/**  
936 - * @brief Stop the ongoing optical zoom operation of the selected camera mounted position.  
937 - * @note Should be called to halt the focal length change initiated by  
938 - * ZiyanCameraManager_StartContinuousOpticalZoom.  
939 - * @param position: camera mounted position  
940 - * @return Execution result.  
941 - */  
942 -T_ZiyanReturnCode ZiyanCameraManager_StopContinuousOpticalZoom(E_ZiyanMountPosition position);  
943 -  
944 -/**  
945 - * @brief Set target zoom factor for optical zooming of the selected camera mounted position.  
946 - * @note This interface sets the zoom to the specified target value.  
947 - * @param position: camera mounted position  
948 - * @param zoomDirection: optical zoom direction, refer to E_ZiyanCameraZoomDirection.  
949 - * @param factor: target zoom factor.  
950 - * @return Execution result.  
951 - */  
952 -T_ZiyanReturnCode ZiyanCameraManager_SetOpticalZoomParam(E_ZiyanMountPosition position,  
953 - E_ZiyanCameraZoomDirection zoomDirection,  
954 - ziyan_f32_t factor);  
955 -  
956 -/**  
957 - * @brief Get parameters for camera optical zooming of the selected camera mounted position.  
958 - * @param position: camera mounted position  
959 - * @param opticalZoomParam: refer to T_ZiyanCameraManagerOpticalZoomParam.  
960 - * @return Execution result.  
961 - */  
962 -T_ZiyanReturnCode ZiyanCameraManager_GetOpticalZoomParam(E_ZiyanMountPosition position,  
963 - T_ZiyanCameraManagerOpticalZoomParam *opticalZoomParam);  
964 -  
965 -/**  
966 - * @brief Set target zoom factor for infrared zooming of the selected camera mounted position.  
967 - * @param position: camera mounted position  
968 - * @param factor: target zoom factor.  
969 - * @return Execution result.  
970 - */  
971 -T_ZiyanReturnCode ZiyanCameraManager_SetInfraredZoomParam(E_ZiyanMountPosition position,  
972 - ziyan_f32_t factor);  
973 -  
974 -/**  
975 - * @brief Enable/Disable the tap-zoom function for the selected camera mounted position.  
976 - * @note TapZoomAtTarget can only be called when tap-zoom is enabled.  
977 - * @param position: camera mounted position  
978 - * @param param: enable/disable  
979 - * @return Execution result.  
980 - */  
981 -T_ZiyanReturnCode ZiyanCameraManager_SetTapZoomEnabled(E_ZiyanMountPosition position,  
982 - bool param);  
983 -  
984 -/**  
985 - * @brief Get status of camera's tap-zoom function of the selected camera mounted position.  
986 - * @param position: camera mounted position  
987 - * @param param: enable/disable  
988 - * @return Execution result.  
989 - */  
990 -T_ZiyanReturnCode ZiyanCameraManager_GetTapZoomEnabled(E_ZiyanMountPosition position, bool *param);  
991 -  
992 -/**  
993 - * @brief Set camera's tap-zoom multiplier of the selected camera mounted position.  
994 - * @note The final zoom scale during a tap-zoom action will be:  
995 - * Current Zoom Scale x Multiplier.  
996 - * @param position: camera mounted position  
997 - * @param tapZoomMultiplier: The multiplier range is [1,5]. A multiplier of 1 will not change the zoom.  
998 - * hen the multiplier is 1, the zoom scale will not change during TapZoom.  
999 - * @return Execution result.  
1000 - */  
1001 -T_ZiyanReturnCode ZiyanCameraManager_SetTapZoomMultiplier(E_ZiyanMountPosition position, uint8_t tapZoomMultiplier);  
1002 -  
1003 -/**  
1004 - * @brief Get camera's tap-zoom multiplier of the selected camera mounted position.  
1005 - * @param position: camera mounted position  
1006 - * @param tapZoomMultiplier: The multiplier range is [1,5]. A multiplier of 1 will not change the zoom.  
1007 - * When the multiplier is 1, the zoom scale will not change during TapZoom.  
1008 - * @return Execution result.  
1009 - */  
1010 -T_ZiyanReturnCode ZiyanCameraManager_GetTapZoomMultiplier(E_ZiyanMountPosition position, uint8_t *tapZoomMultiplier);  
1011 -  
1012 -/**  
1013 - * @brief Set camera's tap-zoom point of the selected camera mounted position.  
1014 - * @note Only available when tap-zoom is enabled. Sets a new target,  
1015 - * reorienting the gimbal to locate the target on the screen center and  
1016 - * applying the tap-zoom multiplier.  
1017 - * @param position: camera mounted position  
1018 - * @param tapZoomPos: refer to T_ZiyanCameraManagerTapZoomPosData.  
1019 - * @return Execution result.  
1020 - */  
1021 -T_ZiyanReturnCode ZiyanCameraManager_TapZoomAtTarget(E_ZiyanMountPosition position,  
1022 - T_ZiyanCameraManagerTapZoomPosData tapZoomPos);  
1023 -  
1024 -/**  
1025 - * @brief Get camera focus ring value range.  
1026 - * @param position: camera mounted position  
1027 - * @param rangeList: returned value of range.  
1028 - * @return Execution result.  
1029 - */  
1030 -T_ZiyanReturnCode ZiyanCameraManager_GetFocusRingRange(E_ZiyanMountPosition position,  
1031 - T_ZiyanCameraManagerRangeList *rangeList);  
1032 -  
1033 -/**  
1034 - * @brief Set camera focus ring value.  
1035 - * @param position: camera mounted position  
1036 - * @param value: focus ring value.  
1037 - * @return Execution result.  
1038 - */  
1039 -T_ZiyanReturnCode ZiyanCameraManager_SetFocusRingValue(E_ZiyanMountPosition position,  
1040 - uint16_t value);  
1041 -  
1042 -/**  
1043 - * @brief Get camera focus ring value.  
1044 - * @param position: camera mounted position  
1045 - * @param value: focus ring value to be returned.  
1046 - * @return Execution result.  
1047 - */  
1048 -T_ZiyanReturnCode ZiyanCameraManager_GetFocusRingValue(E_ZiyanMountPosition position,  
1049 - uint16_t *value);  
1050 -  
1051 -/**  
1052 - * @brief Set camera's exposure mode of the selected camera mounted position.  
1053 - * @note Different exposure modes define whether settings like aperture, shutter  
1054 - * speed, and ISO are set automatically or manually. Exposure compensation is  
1055 - * adjustable in all modes except the manual mode.  
1056 - * @param position: camera mounted position  
1057 - * @param mode: refer to E_ZiyanCameraManagerExposureMode.  
1058 - * @return Execution result.  
1059 - */  
1060 -T_ZiyanReturnCode ZiyanCameraManager_SetExposureMode(E_ZiyanMountPosition position,  
1061 - E_ZiyanCameraManagerExposureMode mode);  
1062 -  
1063 -/**  
1064 - * @brief Get camera's exposure mode of the selected camera mounted position.  
1065 - * @note Different exposure modes define whether settings like aperture, shutter  
1066 - * speed, and ISO are set automatically or manually. Exposure compensation is  
1067 - * adjustable in all modes except the manual mode.  
1068 - * @param position: camera mounted position  
1069 - * @param mode: refer to E_ZiyanCameraManagerExposureMode.  
1070 - * @return Execution result.  
1071 - */  
1072 -T_ZiyanReturnCode ZiyanCameraManager_GetExposureMode(E_ZiyanMountPosition position,  
1073 - E_ZiyanCameraManagerExposureMode *mode);  
1074 -  
1075 -/**  
1076 - * @brief Set camera's iso value of the selected camera mounted position.  
1077 - * @note ISO value can only be set when the camera exposure mode is in  
1078 - * manual mode.  
1079 - * @param position: camera mounted position  
1080 - * @param iso: refer to E_ZiyanCameraManagerISO.  
1081 - * @return Execution result.  
1082 - */  
1083 -T_ZiyanReturnCode ZiyanCameraManager_SetISO(E_ZiyanMountPosition position,  
1084 - E_ZiyanCameraManagerISO iso);  
1085 -  
1086 -/**  
1087 - * @brief Get camera's iso value of the selected camera mounted position.  
1088 - * @param position: camera mounted position  
1089 - * @param iso: refer to E_ZiyanCameraManagerISO.  
1090 - * @return Execution result.  
1091 - */  
1092 -T_ZiyanReturnCode ZiyanCameraManager_GetISO(E_ZiyanMountPosition position,  
1093 - E_ZiyanCameraManagerISO *iso);  
1094 -  
1095 -/**  
1096 - * @brief Set camera's aperture size value of the selected camera mounted position.  
1097 - * @note The exposure mode must be on ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_MANUAL or  
1098 - * ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_APERTURE_PRIORITY.  
1099 - * @param position: camera mounted position  
1100 - * @param aperture: refer to E_ZiyanCameraManagerAperture.  
1101 - * @return Execution result.  
1102 - */  
1103 -T_ZiyanReturnCode ZiyanCameraManager_SetAperture(E_ZiyanMountPosition position,  
1104 - E_ZiyanCameraManagerAperture aperture);  
1105 -  
1106 -/**  
1107 - * @brief Get camera's aperture size value of the selected camera mounted position.  
1108 - * @param position: camera mounted position  
1109 - * @param aperture: refer to E_ZiyanCameraManagerAperture.  
1110 - * @return Execution result.  
1111 - */  
1112 -T_ZiyanReturnCode ZiyanCameraManager_GetAperture(E_ZiyanMountPosition position,  
1113 - E_ZiyanCameraManagerAperture *aperture);  
1114 -  
1115 -/**  
1116 - * @brief Set camera's shutter speed value of the selected camera mounted position.  
1117 - * @note Set the camera shutter speed. Ensure the shutter speed is not set  
1118 - * slower than the video frame rate when the camera's mode is RECORD_VIDEO.  
1119 - * For example, if the video frame rate is 30fps, the shutterSpeed must be <=  
1120 - * 1/30. Precondition: The shutter speed can be set only when the camera  
1121 - * exposure mode is ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_MANUAL mode or  
1122 - * ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_SHUTTER_PRIORITY  
1123 - * @param position: camera mounted position  
1124 - * @param shutterSpeed: refer to E_ZiyanCameraManagerShutterSpeed.  
1125 - * @return Execution result.  
1126 - */  
1127 -T_ZiyanReturnCode ZiyanCameraManager_SetShutterSpeed(E_ZiyanMountPosition position,  
1128 - E_ZiyanCameraManagerShutterSpeed shutterSpeed);  
1129 -  
1130 -/**  
1131 - * @brief Get camera's shutter value of the selected camera mounted position.  
1132 - * @param position: camera mounted position  
1133 - * @param shutterSpeed: refer to E_ZiyanCameraManagerShutterSpeed.  
1134 - * @return Execution result.  
1135 - */  
1136 -T_ZiyanReturnCode ZiyanCameraManager_GetShutterSpeed(E_ZiyanMountPosition position,  
1137 - E_ZiyanCameraManagerShutterSpeed *shutterSpeed);  
1138 -  
1139 -/**  
1140 - * @brief Set camera's EV value of the selected camera mounted position.  
1141 - * @note This function is available in program, shutter, or aperture  
1142 - * exposure modes. Enums are ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_EXPOSURE_MANUAL,  
1143 - * ZIYAN_CAMERA_MANAGER_EXPOSURE_MODE_SHUTTER_PRIORITY, and  
1144 - * ZIYAN_CAMERA_MANAGER_EXPOSURE_APERTURE_PRIORITY  
1145 - * @param position: camera mounted position  
1146 - * @param ev: refer to E_ZiyanCameraManagerExposureCompensation.  
1147 - * @return Execution result.  
1148 - */  
1149 -T_ZiyanReturnCode ZiyanCameraManager_SetExposureCompensation(E_ZiyanMountPosition position,  
1150 - E_ZiyanCameraManagerExposureCompensation ev);  
1151 -  
1152 -/**  
1153 - * @brief Get camera's EV value of the selected camera mounted position.  
1154 - * @param position: camera mounted position  
1155 - * @param ev: refer to E_ZiyanCameraManagerExposureCompensation.  
1156 - * @return Execution result.  
1157 - */  
1158 -T_ZiyanReturnCode ZiyanCameraManager_GetExposureCompensation(E_ZiyanMountPosition position,  
1159 - E_ZiyanCameraManagerExposureCompensation *ev);  
1160 -  
1161 -/**  
1162 - * @brief Set AE lock mode.  
1163 - * @param position: camera mounted position  
1164 - * @param enable: true to enable, false to disable AE lock.  
1165 - * @return Execution result.  
1166 - */  
1167 -T_ZiyanReturnCode ZiyanCameraManager_SetAELockEnabled(E_ZiyanMountPosition position,  
1168 - bool enable);  
1169 -  
1170 -/**  
1171 - * @brief Get AE lock mode.  
1172 - * @note This API is not supported by L1/P1/M3D/M3TD models.  
1173 - * @param position: camera mounted position  
1174 - * @param enable: result of AE lock mode.  
1175 - * @return Execution result.  
1176 - */  
1177 -T_ZiyanReturnCode ZiyanCameraManager_GetAELockEnabled(E_ZiyanMountPosition position,  
1178 - bool *enable);  
1179 -  
1180 -/**  
1181 - * @brief Reset camera settings.  
1182 - * @param position: camera mounted position  
1183 - * @return Execution result.  
1184 - */  
1185 -T_ZiyanReturnCode ZiyanCameraManager_ResetCameraSettings(E_ZiyanMountPosition position);  
1186 -  
1187 -/**  
1188 - * @brief Start to take video of the selected camera mounted position.  
1189 - * @note Camera must be in RECORD_VIDEO mode. For thermal imaging camera,  
1190 - * user can take a single photo when recording video.  
1191 - * @param position: camera mounted position  
1192 - * @return Execution result.  
1193 - */  
1194 -T_ZiyanReturnCode ZiyanCameraManager_StartRecordVideo(E_ZiyanMountPosition position);  
1195 -  
1196 -/**  
1197 - * @brief Stop to take video of the selected camera mounted position.  
1198 - * @note Precondition: The camera is recording currently.  
1199 - * @param position: camera mounted position  
1200 - * @return Execution result.  
1201 - */  
1202 -T_ZiyanReturnCode ZiyanCameraManager_StopRecordVideo(E_ZiyanMountPosition position);  
1203 -  
1204 -/**  
1205 - * @brief Get camera recording state.  
1206 - * @param position: camera mounted position  
1207 - * @param recordingState: result of getting, see E_ZiyanCameraManagerRecordingState.  
1208 - * @return Execution result.  
1209 - */  
1210 -T_ZiyanReturnCode ZiyanCameraManager_GetRecordingState(E_ZiyanMountPosition position,  
1211 - E_ZiyanCameraManagerRecordingState *recordingState);  
1212 -  
1213 -/**  
1214 - * @brief Get camera recording time.  
1215 - * @note This API is not supported by L1/P1/M3D/M3TD models.  
1216 - * @param position: camera mounted position  
1217 - * @param recordingTime: result of getting, unit is seconds.  
1218 - * @return Execution result.  
1219 - */  
1220 -T_ZiyanReturnCode ZiyanCameraManager_GetRecordingTime(E_ZiyanMountPosition position,  
1221 - uint16_t *recordingTime);  
1222 -/**  
1223 - * @brief Get camera stream source range.  
1224 - * @param position: camera mounted position  
1225 - * @param rangeList: pointer to the result.  
1226 - * @return Execution result.  
1227 - */  
1228 -T_ZiyanReturnCode ZiyanCameraManager_GetStreamSourceRange(E_ZiyanMountPosition position,  
1229 - T_ZiyanCameraManagerRangeList *rangeList);  
1230 -  
1231 -/**  
1232 - * @brief Choose camera stream source.  
1233 - * @param position: camera mounted position  
1234 - * @param streamSource: stream source to be chose.  
1235 - * @return Execution result.  
1236 - */  
1237 -T_ZiyanReturnCode ZiyanCameraManager_SetStreamSource(E_ZiyanMountPosition position,  
1238 - E_ZiyanCameraManagerStreamSource streamSource);  
1239 -  
1240 -/**  
1241 - * @brief Get photo storage format range.  
1242 - * @param position: camera mounted position  
1243 - * @param rangeList: range list returned value  
1244 - * @return Execution result.  
1245 - */  
1246 -T_ZiyanReturnCode ZiyanCameraManager_GetPhotoStorageFormatRange(E_ZiyanMountPosition position,  
1247 - T_ZiyanCameraManagerRangeList *rangeList);  
1248 -  
1249 -/**  
1250 - * @brief Set photo storage format.  
1251 - * @param position: camera mounted position  
1252 - * @param format: storage format.  
1253 - * @return Execution result.  
1254 - */  
1255 -T_ZiyanReturnCode ZiyanCameraManager_SetPhotoFormat(E_ZiyanMountPosition position,  
1256 - E_ZiyanCameraManagerPhotoStorageFormat format);  
1257 -  
1258 -/**  
1259 - * @brief Get photo storage format.  
1260 - * @param position: camera mounted position  
1261 - * @param format: returned value of storage format.  
1262 - * @return Execution result.  
1263 - */  
1264 -T_ZiyanReturnCode ZiyanCameraManager_GetPhotoFormat(E_ZiyanMountPosition position,  
1265 - E_ZiyanCameraManagerPhotoStorageFormat *format);  
1266 -  
1267 -/**  
1268 - * @brief Get video storage format range.  
1269 - * @param position: camera mounted position  
1270 - * @param rangeList: range list returned value  
1271 - * @return Execution result.  
1272 - */  
1273 -T_ZiyanReturnCode ZiyanCameraManager_GetVideoFormatRange(E_ZiyanMountPosition position,  
1274 - T_ZiyanCameraManagerRangeList *rangeList);  
1275 -  
1276 -/**  
1277 - * @brief Set video storage format.  
1278 - * @param position: camera mounted position  
1279 - * @param format: storage format.  
1280 - * @return Execution result.  
1281 - */  
1282 -T_ZiyanReturnCode ZiyanCameraManager_SetVideoStorageFormat(E_ZiyanMountPosition position,  
1283 - E_ZiyanCameraManagerVideoStorageFormat format);  
1284 -  
1285 -/**  
1286 - * @brief Get video storage format.  
1287 - * @param position: camera mounted position  
1288 - * @param format: returned value of storage format.  
1289 - * @return Execution result.  
1290 - */  
1291 -T_ZiyanReturnCode ZiyanCameraManager_GetVideoFormat(E_ZiyanMountPosition position,  
1292 - E_ZiyanCameraManagerVideoStorageFormat *format);  
1293 -  
1294 -/**  
1295 - * @brief Get photo ratio range  
1296 - * @param position: camera mounted position  
1297 - * @param rangeList: range list returned value  
1298 - * @return Execution result.  
1299 - */  
1300 -T_ZiyanReturnCode ZiyanCameraManager_GetPhotoRatioRange(E_ZiyanMountPosition position,  
1301 - T_ZiyanCameraManagerRangeList *rangeList);  
1302 -  
1303 -/**  
1304 - * @brief Set camera photo ratio  
1305 - * @param position: camera mounted position  
1306 - * @param photoRatio: ratio to be set  
1307 - * @return Execution result.  
1308 - */  
1309 -T_ZiyanReturnCode ZiyanCameraManager_SetPhotoRatio(E_ZiyanMountPosition position,  
1310 - E_ZiyanCameraManagerPhotoRatio photoRatio);  
1311 -  
1312 -/**  
1313 - * @brief Get camera photo ratio  
1314 - * @param position: camera mounted position  
1315 - * @param photoRatio: returned value of photo ratio  
1316 - * @return Execution result.  
1317 - */  
1318 -T_ZiyanReturnCode ZiyanCameraManager_GetPhotoRatio(E_ZiyanMountPosition position,  
1319 - E_ZiyanCameraManagerPhotoRatio *photoRatio);  
1320 -  
1321 -/**  
1322 - * @brief Get camera video resolution and frame rate  
1323 - * @param position: camera mounted position  
1324 - * @param photoRatio: returned value of video resolution and frame rate  
1325 - * @return Execution result.  
1326 - */  
1327 -T_ZiyanReturnCode ZiyanCameraManager_GetVideoResolutionFrameRate(E_ZiyanMountPosition position,  
1328 - T_ZiyanCameraManagerVideoFormat *videoParam);  
1329 -  
1330 -/**  
1331 - * @brief Get night scene mode range.  
1332 - * @param position: camera mounted position.  
1333 - * @param tempRange: returned valued of night scene mode range.  
1334 - * @return Execution result.  
1335 - */  
1336 -T_ZiyanReturnCode ZiyanCameraManager_GetNightSceneModeRange(E_ZiyanMountPosition position,  
1337 - T_ZiyanCameraManagerRangeList *rangeList);  
1338 -  
1339 -/**  
1340 - * @brief Set night scene mode.  
1341 - * @note Make sure that stream source is zoom or wide camera.  
1342 - * @param position: camera mounted position  
1343 - * @param nightSceneMode: night scene mode.  
1344 - * @return Execution result.  
1345 - */  
1346 -T_ZiyanReturnCode ZiyanCameraManager_SetNightSceneMode(E_ZiyanMountPosition position,  
1347 - E_ZiyanCameraManagerNightSceneMode nightSceneMode);  
1348 -  
1349 -/**  
1350 - * @brief Get night scene mode.  
1351 - * @param position: camera mounted position  
1352 - * @param nightSceneMode: pointer to night scene mode.  
1353 - * @return Execution result.  
1354 - */  
1355 -T_ZiyanReturnCode ZiyanCameraManager_GetNightSceneMode(E_ZiyanMountPosition position,  
1356 - E_ZiyanCameraManagerNightSceneMode *nightSceneMode);  
1357 -  
1358 -/**  
1359 - * @brief Get range of stream source(s) can be stored when capturing or recording.  
1360 - * @param position: camera mounted position.  
1361 - * @param rangeList: returned value of range, in member streamStorage.  
1362 - * @return Execution result.  
1363 - */  
1364 -T_ZiyanReturnCode ZiyanCameraManager_GetStreamStorageRange(E_ZiyanMountPosition position,  
1365 - T_ZiyanCameraManagerRangeList *rangeList);  
1366 -  
1367 -/**  
1368 - * @brief Select capture or recording stream(s) to store.  
1369 - * @note Precondition: set camera's work corresponding to streamType  
1370 - * @param position: camera mounted position.  
1371 - * @param streamType: capture mode or recording mode.  
1372 - * @param streamStorageList: Pointer to the struct that contains stream list.  
1373 - * @return Execution result.  
1374 - */  
1375 -T_ZiyanReturnCode ZiyanCameraManager_SetCaptureRecordingStreams(E_ZiyanMountPosition position,  
1376 - E_ZiyanCameraManagerCaptureOrRecording streamType,  
1377 - T_ZiyanCameraManagerStreamList *streamStorageList);  
1378 -  
1379 -/**  
1380 - * @brief Get the stream(s) of capture or recording mode to be stored.  
1381 - * @param position: camera mounted position.  
1382 - * @param streamType: capture mode or recording mode.  
1383 - * @param streamSourceList: the real return value.  
1384 - * @return Execution result.  
1385 - */  
1386 -T_ZiyanReturnCode ZiyanCameraManager_GetCaptureRecordingStreams(E_ZiyanMountPosition position,  
1387 - E_ZiyanCameraManagerCaptureOrRecording streamType,  
1388 - T_ZiyanCameraManagerStreamList *streamStorageList);  
1389 -  
1390 -/**  
1391 - * @brief Turn on/off synchronized split screen zoom function.  
1392 - * @param position: camera mounted position.  
1393 - * @param enable: set true to turn on, false to turn off.  
1394 - * @return Execution result.  
1395 - */  
1396 -T_ZiyanReturnCode ZiyanCameraManager_SetSynchronizedSplitScreenZoomEnabled(E_ZiyanMountPosition position, bool enable);  
1397 -  
1398 -  
1399 -/**  
1400 - * @brief Set suffix name of directory or file.  
1401 - * @note This setting applies only once for file names.  
1402 - * @param position: camera mounted position.  
1403 - * @param nameType: see E_ZiyanCameraManagerExpandNameType, select to set name of directory or file.  
1404 - * @param nameSize: Length of the name string, between 1 and 239 characters.  
1405 - * @param nameStr: Content of custom suffix name.  
1406 - * @return Execution result.  
1407 - */  
1408 -T_ZiyanReturnCode ZiyanCameraManager_SetCustomExpandName(E_ZiyanMountPosition position,  
1409 - E_ZiyanCameraManagerExpandNameType nameType,  
1410 - const uint8_t *nameStr,  
1411 - uint32_t nameSize);  
1412 -  
1413 -/**  
1414 - * @brief Get the custom suffix of the most recent directory or file name.  
1415 - * @param position: camera mounted position  
1416 - * @param nameType: to choose directory or file to get custom name  
1417 - * @param nameStr: name string buffer  
1418 - * @param nameSize: On input, indicates the maximum size of nameStr; on output,  
1419 - * the actual size of the name string.  
1420 - * @return Execution result.  
1421 - */  
1422 -T_ZiyanReturnCode ZiyanCameraManager_GetCustomExpandName(E_ZiyanMountPosition position,  
1423 - E_ZiyanCameraManagerExpandNameType nameType,  
1424 - uint8_t *nameStr,  
1425 - uint32_t *nameSize);  
1426 -  
1427 -  
1428 -/**  
1429 - * @brief Downloads a list of media files from the selected camera.  
1430 - * @note This synchronous interface may lead to higher CPU usage.  
1431 - * Times out after 3 seconds if the download fails.  
1432 - * @param position: the mount position of the camera  
1433 - * @param fileList: the pointer to the downloaded camera file list  
1434 - * @return Execution result.  
1435 - */  
1436 -T_ZiyanReturnCode ZiyanCameraManager_DownloadFileList(E_ZiyanMountPosition position, T_ZiyanCameraManagerFileList *fileList);  
1437 -  
1438 -/**  
1439 - * @brief Download selected camera media file list by slices.  
1440 - * @note This synchronous interface may lead to higher CPU usage.  
1441 - * Times out after 3 seconds if the download fails.  
1442 - * @param position: the mount position of the camera  
1443 - * @param sliceConfig: the slices config for downloading file list  
1444 - * @param fileList: the pointer to the downloaded camera file list  
1445 - * @return Execution result.  
1446 - */  
1447 -T_ZiyanReturnCode ZiyanCameraManager_DownloadFileListBySlices(E_ZiyanMountPosition position,  
1448 - T_ZiyanCameraManagerSliceConfig sliceConfig,  
1449 - T_ZiyanCameraManagerFileList *fileList);  
1450 -/**  
1451 - * @brief Registers a callback for downloading file data.  
1452 - * @param position: the mount position of the camera  
1453 - * @param callback: the download file data callback  
1454 - * @return Execution result.  
1455 - */  
1456 -T_ZiyanReturnCode ZiyanCameraManager_RegDownloadFileDataCallback(E_ZiyanMountPosition position,  
1457 - ZiyanCameraManagerDownloadFileDataCallback callback);  
1458 -  
1459 -/**  
1460 - * @brief Downloads a media file specified by its index.  
1461 - * @note Supports downloading one file at a time. Wait for a download to finish before starting another.  
1462 - * This synchronous interface may lead to higher CPU usage.  
1463 - * Times out after 3 seconds if the download fails.  
1464 - * @param position: the mount position of the camera  
1465 - * @param fileIndex: the index of the camera media file  
1466 - * @return Execution result.  
1467 - */  
1468 -T_ZiyanReturnCode ZiyanCameraManager_DownloadFileByIndex(E_ZiyanMountPosition position, uint32_t fileIndex);  
1469 -  
1470 -/**  
1471 - * @brief Download selected camera media file by file index and file type.  
1472 - * @note This API only supports L2 camera.  
1473 - * Supports downloading one file at a time. Wait for a download to finish before starting another.  
1474 - * This synchronous interface may lead to higher CPU usage.  
1475 - * Times out after 3 seconds if the download fails.  
1476 - * @param position: the mount position of the camera  
1477 - * @param fileIndex: the index of the camera media file  
1478 - * @param fileType: the sub type of the camera media file  
1479 - * @return Execution result.  
1480 - */  
1481 -T_ZiyanReturnCode ZiyanCameraManager_DownloadSubFileByIndexAndSubType(E_ZiyanMountPosition position, uint32_t index, E_ZiyanCameraMediaFileSubType fileType);  
1482 -/**  
1483 - * @brief Obtains the rights to download media files before downloading media files  
1484 - * @param position: the mount position of the camera  
1485 - * @return Execution result.  
1486 - */  
1487 -T_ZiyanReturnCode ZiyanCameraManager_ObtainDownloaderRights(E_ZiyanMountPosition position);  
1488 -  
1489 -/**  
1490 - * @brief Releases the rights to download media files after downloading media files  
1491 - * @note Failure to release downloader rights may restrict access to the camera album  
1492 - * by the pilot app.  
1493 - * @param position: the mount position of the camera  
1494 - * @return Execution result.  
1495 - */  
1496 -T_ZiyanReturnCode ZiyanCameraManager_ReleaseDownloaderRights(E_ZiyanMountPosition position);  
1497 -  
1498 -/**  
1499 - * @brief Format SD card.  
1500 - * @param position: the mount position of the camera  
1501 - * @return Execution result.  
1502 - */  
1503 -T_ZiyanReturnCode ZiyanCameraManager_FormatStorage(E_ZiyanMountPosition position);  
1504 -  
1505 -/**  
1506 - * @brief Get storage info of SD card.  
1507 - * @note This API doesn't support L1/P1/M3D/M3TD models.  
1508 - * @param position: the mount position of the camera  
1509 - * @param storageInfo: Result of SD Card storage information  
1510 - * @return Execution result.  
1511 - */  
1512 -T_ZiyanReturnCode ZiyanCameraManager_GetStorageInfo(E_ZiyanMountPosition position,  
1513 - T_ZiyanCameraManagerStorageInfo *storageInfo);  
1514 -  
1515 -/**  
1516 - * @brief Delete selected camera media file by file index.  
1517 - * @param position: the mount position of the camera  
1518 - * @param fileIndex: the index of the camera media file  
1519 - * @return Execution result.  
1520 - */  
1521 -T_ZiyanReturnCode ZiyanCameraManager_DeleteFileByIndex(E_ZiyanMountPosition position, uint32_t fileIndex);  
1522 -  
1523 -/**  
1524 - * @brief Get the camera laser ranging info of the selected camera mounted position.  
1525 - * @note Maximum data update frequency: 5Hz.  
1526 - * @param position: the mount position of the camera  
1527 - * @param laserRangingInfo: the pointer to the camera laser ranging info  
1528 - * @return Execution result.  
1529 - */  
1530 -T_ZiyanReturnCode ZiyanCameraManager_GetLaserRangingInfo(E_ZiyanMountPosition position,  
1531 - T_ZiyanCameraManagerLaserRangingInfo *laserRangingInfo);  
1532 -  
1533 -/**  
1534 - * @brief Set point thermometry coordinates of the selected camera mounted position.  
1535 - * @param position: camera mounted position  
1536 - * @param pointCoordinate: point thermometry coordinates  
1537 - * @return Execution result.  
1538 - */  
1539 -T_ZiyanReturnCode ZiyanCameraManager_SetPointThermometryCoordinate(E_ZiyanMountPosition position,  
1540 - T_ZiyanCameraManagerPointThermometryCoordinate pointCoordinate);  
1541 -  
1542 -/**  
1543 - * @brief Get point thermometry result.  
1544 - * @note Before get point thermometry data from camera, ZiyanCameraManager_SetPointThermometryCoordinate()  
1545 - * function has to be called.  
1546 - * @param position: camera mounted position  
1547 - * @param pointThermometryData: point thermometry result  
1548 - * @return Execution result.  
1549 - */  
1550 -T_ZiyanReturnCode ZiyanCameraManager_GetPointThermometryData(E_ZiyanMountPosition position,  
1551 - T_ZiyanCameraManagerPointThermometryData *pointThermometryData);  
1552 -  
1553 -/**  
1554 - * @brief Set area thermometry coordinates of the selected camera mounted position.  
1555 - * @param position: camera mounted position  
1556 - * @param areaCoordinate: area thermometry coordinates  
1557 - * @return Execution result.  
1558 - */  
1559 -T_ZiyanReturnCode ZiyanCameraManager_SetAreaThermometryCoordinate(E_ZiyanMountPosition position,  
1560 - T_ZiyanCameraManagerAreaThermometryCoordinate areaCoordinate);  
1561 -  
1562 -/**  
1563 - * @brief Get area thermometry result.  
1564 - * @note Before get area thermometry data from camera, ZiyanCameraManager_SetAreaThermometryCoordinate()  
1565 - * function has to be called.  
1566 - * @param position: camera mounted position  
1567 - * @param areaThermometryData: area thermometry result  
1568 - * @return Execution result.  
1569 - */  
1570 -T_ZiyanReturnCode ZiyanCameraManager_GetAreaThermometryData(E_ZiyanMountPosition position,  
1571 - T_ZiyanCameraManagerAreaThermometryData *areaThermometryData);  
1572 -  
1573 -/**  
1574 - * @brief Set FFC mode.  
1575 - * @param position: camera mounted position.  
1576 - * @param ffcMode: mode to be set.  
1577 - * @return Execution result.  
1578 - */  
1579 -T_ZiyanReturnCode ZiyanCameraManager_SetFfcMode(E_ZiyanMountPosition position, E_ZiyanCameraManagerFfcMode ffcMode);  
1580 -  
1581 -/**  
1582 - * @brief Trigger FFC one time.  
1583 - * @param position: camera mounted position.  
1584 - * @return Execution result.  
1585 - */  
1586 -T_ZiyanReturnCode ZiyanCameraManager_TriggerFfc(E_ZiyanMountPosition position);  
1587 -  
1588 -/**  
1589 - * @brief Set infrared camera gain mode.  
1590 - * @param position: camera mounted position.  
1591 - * @param gainMode: gain mode to set.  
1592 - * @return Execution result.  
1593 - */  
1594 -T_ZiyanReturnCode ZiyanCameraManager_SetInfraredCameraGainMode(E_ZiyanMountPosition position,  
1595 - E_ZiyanCameraManagerIrGainMode gainMode);  
1596 -  
1597 -/**  
1598 - * @brief Get temperature range of infrared camera.  
1599 - * @param position: camera mounted position.  
1600 - * @param tempRange: returned valued of temperature range.  
1601 - * @return Execution result.  
1602 - */  
1603 -T_ZiyanReturnCode ZiyanCameraManager_GetInfraredCameraGainModeTemperatureRange(E_ZiyanMountPosition position,  
1604 - T_ZiyanCameraManagerIrTempMeterRange *tempRange);  
1605 -  
1606 -/**  
1607 - * @brief Set camera metering mode.  
1608 - * @param position: camera mounted position  
1609 - * @param meteringMode: metering mode  
1610 - * @return Execution result.  
1611 - */  
1612 -T_ZiyanReturnCode ZiyanCameraManager_SetMeteringMode(E_ZiyanMountPosition position,  
1613 - E_ZiyanCameraManagerMeteringMode meteringMode);  
1614 -  
1615 -/**  
1616 - * @brief Get camera metering mode.  
1617 - * @param position: camera mounted position  
1618 - * @param meteringMode: pointer to returned value of metering mode  
1619 - * @return Execution result.  
1620 - */  
1621 -T_ZiyanReturnCode ZiyanCameraManager_GetMeteringMode(E_ZiyanMountPosition position,  
1622 - E_ZiyanCameraManagerMeteringMode *meteringMode);  
1623 -  
1624 -/**  
1625 - * @brief Get range of metering point.  
1626 - * @param position: camera mounted position  
1627 - * @param hrzNum: returned value, horizontal range.  
1628 - * @param vtcNum: returned value, vertical range.  
1629 - * @return Execution result.  
1630 - */  
1631 -T_ZiyanReturnCode ZiyanCameraManager_GetMeteringPointRegionRange(E_ZiyanMountPosition position,  
1632 - uint8_t *hrzNum, uint8_t *vtcNum);  
1633 -/**  
1634 - * @brief Set metering point.  
1635 - * @param position: camera mounted position  
1636 - * @param x: Horizontal coordinate value, should be no greater than hrzNum - 1.  
1637 - * @param y: Horizontal coordinate value, should be no greater than vtcNum - 1.  
1638 - * @return Execution result.  
1639 - */  
1640 -T_ZiyanReturnCode ZiyanCameraManager_SetMeteringPoint(E_ZiyanMountPosition position,  
1641 - uint8_t x, uint8_t y);  
1642 -  
1643 -/**  
1644 - * @brief Get camera metering mode.  
1645 - * @param position: camera mounted position  
1646 - * @param x: returned valued, current metering point in horizontal coordinate.  
1647 - * @param y: returned valued, current metering point in vertical coordinate.  
1648 - * @return Execution result.  
1649 - */  
1650 -T_ZiyanReturnCode ZiyanCameraManager_GetMeteringPoint(E_ZiyanMountPosition position,  
1651 - uint8_t *x, uint8_t *y);  
1652 -  
1653 -  
1654 -/**  
1655 - * @brief Start to record point cloud of the selected camera mounted position.  
1656 - * @param position: camera mounted position  
1657 - * @return Execution result.  
1658 - */  
1659 -T_ZiyanReturnCode ZiyanCameraManager_StartRecordPointCloud(E_ZiyanMountPosition position);  
1660 -  
1661 -/**  
1662 - * @brief Stop to record point cloud of the selected camera mounted position.  
1663 - * @note Precondition: The camera is recording currently.  
1664 - * @param position: camera mounted position  
1665 - * @return Execution result.  
1666 - */  
1667 -T_ZiyanReturnCode ZiyanCameraManager_StopRecordPointCloud(E_ZiyanMountPosition position);  
1668 -  
1669 -#ifdef __cplusplus  
1670 -}  
1671 -#endif  
1672 -  
1673 -#endif // ZIYAN_CAMERA_MANAGER_H  
1674 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file dij_core.h  
4 - * @brief This is the header file for "dij_core.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_CORE_H  
28 -#define ZIYAN_CORE_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_platform.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -/* Exported types ------------------------------------------------------------*/  
40 -typedef struct {  
41 - char appName[32]; /*!< Specifies ZIYAN SDK app name. This info can be obtained by logging in to the  
42 - developer website https://developer.ziyan.com/user/apps/#all. End with '\0'. */  
43 - char appId[16]; /*!< Specifies ZIYAN SDK app ID. This info can be obtained by logging in to the  
44 - developer website https://developer.ziyan.com/user/apps/#all. */  
45 - char appKey[32]; /*!< Specifies ZIYAN SDK app key. This info can be obtained by logging in to the  
46 - developer website https://developer.ziyan.com/user/apps/#all. */  
47 - char appLicense[512]; /*!< Specifies ZIYAN SDK app license. This info can be obtained by logging in to the  
48 - developer website https://developer.ziyan.com/user/apps/#all. */  
49 - char developerAccount[64]; /*!< Specifies ZIYAN SDK developer account email. This info can be obtained by  
50 - logging in to the developer website https://developer.ziyan.com/user/apps/#all.  
51 - Developer's account and other related information need to be able to correspond.  
52 - End with '\0'. */  
53 - char baudRate[16]; /*!< Specifies ZIYAN SDK communication serial port baud rate. */  
54 -} T_ZiyanUserInfo;  
55 -  
56 -/* Exported functions --------------------------------------------------------*/  
57 -/**  
58 - * @brief Initialize the Payload SDK core in blocking mode.  
59 - * @note The order of calling this call is crucial. It must be done after registering console/OSAL/HAL handler functions  
60 - * It must be done after registering console/OSAL/HAL handler functions and before using other functional module  
61 - * interfaces. Correctly fill in the developer information to ensure successful initialization. See the  
62 - * See the "PSDK Initialization" tutorial for more.  
63 - * This function does not return until the correct aircraft type and PSDK adapter type is obtained. The logic ensures  
64 - * that aircraft and PSDK adapter have been started up normally before PSDK functional module and user's program run.  
65 - * General execution time of this function is 2-4 seconds.  
66 - * @param userInfo: pointer to the PSDK application information.  
67 - * @return Execution result.  
68 - */  
69 -T_ZiyanReturnCode ZiyanCore_Init(const T_ZiyanUserInfo *userInfo);  
70 -  
71 -/**  
72 - * @brief Sets an alias for a ZIYAN application or product that meets the condition for ZIYAN application or product.  
73 - * If an alias exists, it will be displayed in ZIYAN Pilot.  
74 - * @note Still need to pass in correct ZIYAN APP name that is obtained from ZIYAN SDK developer website to ZiyanCore_Init()  
75 - * interface. The ZIYAN APP name will be used to bind and verification.  
76 - * The alias will take effect after a short delay, up to a maximum of 1 second.  
77 - * @param productAlias: A pointer to the product alias string, which must end with '\0'. The maximum length of the string is 31 characters.  
78 - * If the alias string exceeds 31 characters, it will be truncated before being passed in.  
79 - * @return Execution result.  
80 - */  
81 -T_ZiyanReturnCode ZiyanCore_SetAlias(const char *productAlias);  
82 -  
83 -/**  
84 - * @brief Set custom firmware version for ZIYAN application or product.  
85 - * @details Payload firmware version will always display in ZIYAN Pilot payload settings interface.  
86 - * @param version: the custom firmware version to be set.  
87 - * @return Execution result.  
88 - */  
89 -T_ZiyanReturnCode ZiyanCore_SetFirmwareVersion(T_ZiyanFirmwareVersion version);  
90 -  
91 -/**  
92 - * @brief Set custom serial number for ZIYAN application or product.  
93 - * @details Payload custom serial number will always display in ZIYAN Pilot payload settings interface.  
94 - * @param productSerialNumber: the custom serial number to be set, needs to be no larger than 32 bytes.  
95 - * @return Execution result.  
96 - */  
97 -T_ZiyanReturnCode ZiyanCore_SetSerialNumber(const char *productSerialNumber);  
98 -  
99 -/**  
100 - * @brief Notify that the Payload SDK core application starts.  
101 - * @note The order of calling this interface requires special attention, The call needs to be completed after all the  
102 - * module initialize and register interfaces.  
103 - * @return Execution result.  
104 - */  
105 -T_ZiyanReturnCode ZiyanCore_ApplicationStart(void);  
106 -  
107 -/**  
108 - * @brief DeInitialize the Payload SDK core in blocking mode.  
109 - * @return Execution result.  
110 - */  
111 -T_ZiyanReturnCode ZiyanCore_DeInit(void);  
112 -  
113 -#ifdef __cplusplus  
114 -}  
115 -#endif  
116 -  
117 -#endif // DIJ_CORE_H  
118 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_fc_subscription.h  
4 - * @brief This is the header file for "ziyan_fc_subscription.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_FC_SUBSCRIPTION_H  
28 -#define ZIYAN_FC_SUBSCRIPTION_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -/* Exported types ------------------------------------------------------------*/  
40 -/**  
41 - * @brief Name of topics that can be subscribed. Topic is minimum data item subscribed.  
42 - */  
43 -typedef enum {  
44 - /*!  
45 - * @brief Quaternion of aircraft topic name. Quaternion topic provides aircraft body frame (FRD) to ground frame  
46 - * (NED) rotation. Please refer to ::T_ZiyanFcSubscriptionQuaternion for information about data structure.  
47 - * @details The ZIYAN quaternion follows Hamilton convention (q0 = w, q1 = x, q2 = y, q3 = z).  
48 - * | Angle | Unit | Accuracy | Notes |  
49 - |--------------|------|------------|-------------------------------------------------|  
50 - | pitch, roll | deg | <1 | in NON-AHRS mode |  
51 - | yaw | deg | <3 | in well-calibrated compass with fine aligned |  
52 - | yaw with rtk | deg | around 1.2 | in RTK heading fixed mode with 1 meter baseline |  
53 - * @datastruct \ref T_ZiyanFcSubscriptionQuaternion  
54 - */  
55 - ZIYAN_FC_SUBSCRIPTION_TOPIC_QUATERNION = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 0),  
56 - /*!  
57 - * @brief Provides aircraft's acceleration w.r.t a ground-fixed \b NEU frame @ up to 200Hz  
58 - * @warning Please note that this data is not in a conventional right-handed frame of reference.  
59 - * @details This is a fusion output from the flight control system. The output is in a right-handed NED frame, but the  
60 - * sign of the Z-axis acceleration is flipped before publishing to this topic. So if you are looking to get acceleration  
61 - * in an NED frame, simply flip the sign of the z-axis value. Beyond that, you can convert using rotations to  
62 - * any right-handed frame of reference.  
63 - * @units m/s<SUP>2</SUP>  
64 - * @datastruct \ref T_ZiyanFcSubscriptionAccelerationGround  
65 - */  
66 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_GROUND = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 1),  
67 - /*!  
68 - * @brief Provides aircraft's acceleration w.r.t a body-fixed \b FRU frame @ up to 200Hz  
69 - * @warning Please note that this data is not in a conventional right-handed frame of reference.  
70 - * @details This is a fusion output from the flight control system.  
71 - * @units m/s<SUP>2</SUP>  
72 - * @datastruct \ref T_ZiyanFcSubscriptionAccelerationBody  
73 - */  
74 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_BODY = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 2),  
75 - /*!  
76 - * @brief Provides aircraft's acceleration in an IMU-centered, body-fixed \b FRD frame @ up to 400Hz  
77 - * @details This is a filtered output from the IMU on board the flight control system.  
78 - * @sensors IMU  
79 - * @units m/s<SUP>2</SUP>  
80 - * @datastruct \ref T_ZiyanFcSubscriptionAccelerationRaw  
81 - */  
82 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_RAW = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 3),  
83 - /*!  
84 - * @brief Velocity of aircraft topic name. Velocity topic provides aircraft's velocity in a ground-fixed NEU frame.  
85 - * Please refer to ::T_ZiyanFcSubscriptionVelocity for information about data structure.  
86 - * @warning Please note that this data is not in a conventional right-handed frame of reference.  
87 - * @details This velocity data is a fusion output from the aircraft. Original output is in a right-handed NED frame, but the  
88 - * sign of the Z-axis velocity is flipped before publishing to this topic. So if you are looking to get velocity  
89 - * in an NED frame, simply flip the sign of the z-axis value. Beyond that, you can convert using rotations to  
90 - * any right-handed frame of reference.  
91 - * | Axis | Unit | Accuracy |  
92 - |----------|------|---------------------------------------------------------------------------------------------|  
93 - | vgx, vgy | m/s | Around 5cm/s for GNSS navigation. Around 3cm/s with VO at 1 meter height |  
94 - | vgz | m/s | 10cm/s only with barometer in steady air. 3cm/s with VO at 1 meter height with 8cm baseline |  
95 - * @datastruct \ref T_ZiyanFcSubscriptionVelocity  
96 - */  
97 - ZIYAN_FC_SUBSCRIPTION_TOPIC_VELOCITY = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 4),  
98 - /*!  
99 - * @brief Provides aircraft's angular velocity in a ground-fixed \b NED frame @ up to 200Hz  
100 - * @details This is a fusion output from the flight control system.  
101 - * @units rad/s  
102 - * @datastruct \ref T_ZiyanFcSubscriptionAngularRateFusioned  
103 - */  
104 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ANGULAR_RATE_FUSIONED = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 5),  
105 - /*!  
106 - * @brief Provides aircraft's angular velocity in an IMU-centered, body-fixed \b FRD frame @ up to 400Hz  
107 - * @details This is a filtered output from the IMU on board the flight control system.  
108 - * @sensors IMU  
109 - * @units rad/s  
110 - * @datastruct \ref T_ZiyanFcSubscriptionAngularRateRaw  
111 - */  
112 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ANGULAR_RATE_RAW = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 6),  
113 - /*!  
114 - * @brief Fused altitude of aircraft topic name. Fused altitude topic provides aircraft's fused altitude from sea  
115 - * level. Please refer to ::T_ZiyanFcSubscriptionAltitudeFused for information about data structure.  
116 - * @units m  
117 - * @datastruct \ref T_ZiyanFcSubscriptionAltitudeFused  
118 - */  
119 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ALTITUDE_FUSED = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 7),  
120 - /*!  
121 - * @brief Provides aircraft's pressure altitude from sea level using the ICAO model @ up to 200Hz  
122 - * @details  
123 - * This is a filetered output from the barometer without any further fusion.  
124 - *  
125 - * The ICAO model gives an MSL altitude of 1013.25mBar at 15&deg; C and a temperature lapse rate of -6.5&deg; C  
126 - * per 1000m. In your case, it may be possible that the take off altitude of the aircraft is recording a higher pressure  
127 - * than 1013.25mBar. Let's take an example - a weather station shows that SFO (San Francisco International Airport) had  
128 - * recently recorded a pressure of 1027.1mBar. SFO is 4m above MSL, yet, if you calculate the Pressure Altitude using  
129 - * the ICAO model, it relates to -114m. You can use an online calculator to similarly calculate the Pressure Altitude  
130 - * in your area.  
131 - *  
132 - * Another factor that may affect your altitude reading is manufacturing differences in the barometer - it is not  
133 - * uncommon to have a variation of &plusmn;30m readings at the same physical location with two different aircraft. For a given  
134 - * aircraft, these readings will be consistent, so you will need to calibrate the offset of your system if your code  
135 - * relies on the accuracy of the absolute value of altitude.  
136 - * @sensors GPS, Barometer, IMU  
137 - * @units m  
138 - * @datastruct \ref T_ZiyanFcSubscriptionAltitudeBarometer  
139 - */  
140 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ALTITUDE_BAROMETER = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 8),  
141 - /*!  
142 - * @brief Provides the altitude from sea level when the aircraft last took off.  
143 - * @details  
144 - * This is a fusion output from the flight control system, and also uses the ICAO model.  
145 - *  
146 - * The ICAO model gives an MSL altitude of 1013.25mBar at 15&deg; C and a temperature lapse rate of -6.5&deg; C  
147 - * per 1000m. In your case, it may be possible that the take off altitude of the aircraft is recording a higher pressure  
148 - * than 1013.25mBar. Let's take an example - a weather station shows that SFO (San Francisco International Airport) had  
149 - * recently recorded a pressure of 1027.1mBar. SFO is 4m above MSL, yet, if you calculate the Pressure Altitude using  
150 - * the ICAO model, it relates to -114m. You can use an online calculator to similarly calculate the Pressure Altitude  
151 - * in your area.  
152 - *  
153 - * Another factor that may affect your altitude reading is manufacturing differences in the barometer - it is not  
154 - * uncommon to have a variation of &plusmn;30m readings at the same physical location with two different aircraft. For a given  
155 - * aircraft, these readings will be consistent, so you will need to calibrate the offset of your system if your code  
156 - * relies on the accuracy of the absolute value of altitude.  
157 - *  
158 - * @note This value is updated each time the drone takes off.  
159 - *  
160 - * @units m  
161 - * @datastruct \ref T_ZiyanFcSubscriptionAltitudeOfHomePoint  
162 - */  
163 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ALTITUDE_OF_HOMEPOINT = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 9),  
164 - /*!  
165 - * @brief Provides the relative height above ground at up to 100Hz.  
166 - * @details  
167 - * This is a fusion output from the flight control system. The height is a direct estimate of the closest large object below the aircraft's ultrasonic sensors.  
168 - * A large object is something that covers the ultrasonic sensor for an extended duration of time.  
169 - *  
170 - * @warning This topic does not come with a 'valid' flag - so if the aircraft is too far from an object for the  
171 - * ultrasonic sensors/VO to provide any meaningful data, the values will latch and there is no way for user code to  
172 - * determine if the data is valid or not. Use with caution.  
173 - * @sensors Visual Odometry, Ultrasonic  
174 - * @units m  
175 - * @datastruct \ref T_ZiyanFcSubscriptionHeightFusion  
176 - */  
177 - ZIYAN_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 10),  
178 - /*!  
179 - * @brief Relative height above ground of aircraft topic name. Please refer to  
180 - * ::T_ZiyanFcSubscriptionHeightRelative for information about data structure.  
181 - * @details This data is a fusion output from aircraft. The height is a direct estimate of the closest large object  
182 - * below the aircraft's ultrasonic sensors.  
183 - * @warning This topic does not come with a 'valid' flag - so if the aircraft is too far from an object for the  
184 - * ultrasonic sensors/VO to provide any meaningful data, the values will latch and there is no way for user to  
185 - * determine if the data is valid or not. Please use with caution.  
186 - * @datastruct \ref T_ZiyanFcSubscriptionHeightRelative  
187 - */  
188 - ZIYAN_FC_SUBSCRIPTION_TOPIC_HEIGHT_RELATIVE = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 11),  
189 -  
190 - /*!  
191 - * Fused position of aircraft topic name. Please refer to ::T_ZiyanFcSubscriptionPositionFused for information  
192 - * about data structure.  
193 - * @warning Please note that if GPS signal is weak (low visibleSatelliteNumber, see below), the  
194 - * latitude/longitude values won't be updated but the altitude might still be. There is currently no way to know if  
195 - * the lat/lon update is healthy.  
196 - * @details The most important component of this topic is the T_ZiyanFcSubscriptionPositionFused::visibleSatelliteNumber.  
197 - * Use this to track your GPS satellite coverage and build some heuristics for when you might expect to lose GPS updates.  
198 - * | Axis | Unit | Position Sensor | Accuracy |  
199 - |------|------|-----------------|--------------------------------------------------|  
200 - | x, y | m | GPS | <3m with open sky without multipath |  
201 - | z | m | GPS | <5m with open sky without multipath |  
202 - * @datastruct \ref T_ZiyanFcSubscriptionPositionFused  
203 - */  
204 - ZIYAN_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 12),  
205 -  
206 - /*!  
207 - * @brief GPS date topic name. Please refer to ::T_ZiyanFcSubscriptionGpsDate for information about data structure.  
208 - * @datastruct \ref T_ZiyanFcSubscriptionGpsDate  
209 - */  
210 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_DATE = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 13),  
211 -  
212 - /*!  
213 - * @brief GPS time topic name. Please refer to ::T_ZiyanFcSubscriptionGpsTime for information about data structure.  
214 - * @datastruct \ref T_ZiyanFcSubscriptionGpsTime  
215 - */  
216 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_TIME = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 14),  
217 -  
218 - /*!  
219 - * @brief GPS position topic name. Please refer to ::T_ZiyanFcSubscriptionGpsPosition for information about data structure.  
220 - * @details  
221 - * | Axis | Accuracy |  
222 - |------|--------------------------------------------------|  
223 - | x, y | <3m with open sky without multipath |  
224 - | z | <5m with open sky without multipath |  
225 - * @datastruct \ref T_ZiyanFcSubscriptionGpsPosition  
226 - */  
227 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_POSITION = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 15),  
228 -  
229 - /*!  
230 - * @brief GPS velocity topic name. Please refer to ::T_ZiyanFcSubscriptionGpsVelocity for information about data structure.  
231 - * @datastruct \ref T_ZiyanFcSubscriptionGpsVelocity  
232 - */  
233 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_VELOCITY = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 16),  
234 -  
235 - /*!  
236 - * @brief GPS details topic name. GPS details topic provides GPS state and other detail information. Please refer  
237 - * to ::T_ZiyanFcSubscriptionGpsDetail for information about data structure.  
238 - * @datastruct \ref T_ZiyanFcSubscriptionGpsDetails  
239 - */  
240 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_DETAILS = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 17),  
241 -  
242 - /*!  
243 - * @brief GPS signal level topic name. This topic provides a measure of the quality of GPS signal. Please refer to  
244 - * ::T_ZiyanFcSubscriptionGpsSignalLevel for information about data structure.  
245 - * @datastruct \ref T_ZiyanFcSubscriptionGpsSignalLevel  
246 - */  
247 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_SIGNAL_LEVEL = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 18),  
248 -  
249 - /*!  
250 - * @brief RTK position topic name. Please refer to ::T_ZiyanFcSubscriptionRtkPosition for information about data structure.  
251 - * @details  
252 - * | Axis | Accuracy |  
253 - |------|--------------------------------------------------|  
254 - | x, y | ~2cm with fine alignment and fix condition |  
255 - | z | ~3cm with fine alignment and fix condition |  
256 - * @datastruct \ref T_ZiyanFcSubscriptionRtkPosition  
257 - */  
258 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_POSITION = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 19),  
259 -  
260 - /*!  
261 - * @brief RTK velocity topic name. Please refer to ::T_ZiyanFcSubscriptionRtkVelocity for information about data structure.  
262 - * @datastruct \ref T_ZiyanFcSubscriptionRtkVelocity  
263 - */  
264 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_VELOCITY = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 20),  
265 -  
266 - /*!  
267 - * @brief RTK yaw topic name. Please refer to ::T_ZiyanFcSubscriptionRtkYaw for information about data structure.  
268 - * @details The RTK yaw will provide the vector from ANT1 to ANT2 as configured in ZIYAN Assistant 2. This  
269 - * means that the value of RTK yaw will be 90deg offset from the yaw of the aircraft.  
270 - * @datastruct \ref T_ZiyanFcSubscriptionRtkYaw  
271 - */  
272 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_YAW = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 21),  
273 -  
274 - /*!  
275 - * @brief RTK position information topic name. RTK position information topic provides a state of RTK position  
276 - * solution. Please refer to ::T_ZiyanFcSubscriptionRtkPositionInfo for information about data structure.  
277 - * @datastruct \ref T_ZiyanFcSubscriptionRtkPositionInfo  
278 - */  
279 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_POSITION_INFO = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 22),  
280 -  
281 - /*!  
282 - * @brief RTK yaw topic name. RTK yaw information topic provides a state of RTK yaw solution. Please refer to  
283 - * ::T_ZiyanFcSubscriptionRtkYawInfo for information about data structure.  
284 - * @datastruct \ref T_ZiyanFcSubscriptionRtkYawInfo  
285 - */  
286 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_YAW_INFO = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 23),  
287 - /*!  
288 - * @brief Provides aircraft's magnetometer reading, fused with IMU and GPS @ up to 100Hz  
289 - * @details This reading is the magnetic field recorded by the magnetometer in x,y,z axis, calibrated such that  
290 - * 1000 < |m| < 2000, and fused with IMU and GPS for robustness  
291 - * @sensors Magnetometer, IMU, GPS  
292 - * @units N/A  
293 - * @datastruct \ref T_ZiyanFcSubscriptionCompass  
294 - */  
295 - ZIYAN_FC_SUBSCRIPTION_TOPIC_COMPASS = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 24),  
296 - /*!  
297 - * @brief Provides remote controller stick inputs @ up to 100Hz  
298 - * @details This topic will give you:  
299 - * - Stick inputs (R,P,Y,Thr)  
300 - * - Mode switch (P/A/F)  
301 - * - Landing gear switch (Up/Down)  
302 - *  
303 - * @datastruct \ref T_ZiyanFcSubscriptionRC  
304 - * @also \ref TOPIC_RC_WITH_FLAG_DATA  
305 - */  
306 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RC = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 25),  
307 - /*!  
308 - * @brief Provides gimbal pitch, roll, yaw @ up to 50Hz  
309 - * @details  
310 - * The reference frame for gimbal angles is a NED frame attached to the gimbal.  
311 - * This topic uses a data structure, Vector3f, that is too generic for the topic. The order of angles is :  
312 - * |Data Structure Element| Meaning|  
313 - * |----------------------|--------|  
314 - * |Vector3f.x |pitch |  
315 - * |Vector3f.y |roll |  
316 - * |Vector3f.z |yaw |  
317 - *  
318 - * @perf  
319 - * 0.1 deg accuracy in all axes  
320 - *  
321 - * @sensors Gimbal Encoder, IMU, Magnetometer  
322 - * @units deg  
323 - * @datastruct \ref T_ZiyanFcSubscriptionGimbalAngles  
324 - * @also \ref TOPIC_GIMBAL_STATUS, \ref TOPIC_GIMBAL_CONTROL_MODE  
325 - */  
326 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 26),  
327 - /*!  
328 - * @brief Provides gimbal status and error codes @ up to 50Hz  
329 - * @details Please see the \ref GimbalStatus struct for the details on what data you can receive.  
330 - *  
331 - * @datastruct \ref T_ZiyanFcSubscriptionGimbalStatus  
332 - * @also \ref TOPIC_GIMBAL_ANGLES, \ref TOPIC_GIMBAL_CONTROL_MODE  
333 - */  
334 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GIMBAL_STATUS = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 27),  
335 - /*!  
336 - * @brief Flight status topic name. Please refer to ::T_ZiyanFcSubscriptionFlightStatus for information about data structure.  
337 - * @datastruct \ref T_ZiyanFcSubscriptionFlightStatus  
338 - */  
339 - ZIYAN_FC_SUBSCRIPTION_TOPIC_STATUS_FLIGHT = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 28),  
340 - /*!  
341 - * @brief Provides a granular state representation for various tasks/flight modes @ up to 50Hz  
342 - * @details Typically, use this topic together with \ref TOPIC_STATUS_FLIGHT to get a  
343 - * better understanding of the overall status of the aircraft.  
344 - *  
345 - * @datastruct \ref T_ZiyanFcSubscriptionDisplaymode  
346 - * @also \ref TOPIC_STATUS_FLIGHT  
347 - */  
348 - ZIYAN_FC_SUBSCRIPTION_TOPIC_STATUS_DISPLAYMODE = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 29),  
349 - /*!  
350 - * @brief Provides status for the landing gear state @ up to 50Hz  
351 - *  
352 - * @datastruct \ref T_ZiyanFcSubscriptionLandinggear  
353 - */  
354 - ZIYAN_FC_SUBSCRIPTION_TOPIC_STATUS_LANDINGGEAR = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 30),  
355 - /*!  
356 - * @brief If motors failed to start, this topic provides reasons why. Available @ up to 50Hz  
357 - * @datastruct \ref T_ZiyanFcSubscriptionMotorStartError  
358 - * \note These enumerations show up in the ErrorCode class because they can also be returned as acknowledgements  
359 - * for APIs that start the motors, such as \ref Control::takeoff "Takeoff" or \ref Control::armMotors "Arm"  
360 - */  
361 - ZIYAN_FC_SUBSCRIPTION_TOPIC_STATUS_MOTOR_START_ERROR = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC,  
362 - 31),  
363 - /*!  
364 - * @brief Battery information topic name. Please refer to ::T_ZiyanFcSubscriptionWholeBatteryInfo for information about data structure.  
365 - * @datastruct \ref T_ZiyanFcSubscriptionWholeBatteryInfo  
366 - */  
367 - ZIYAN_FC_SUBSCRIPTION_TOPIC_BATTERY_INFO = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 32),  
368 - /*!  
369 - * @brief Provides states of the aircraft related to SDK/RC control  
370 - * @details The following information is available in this topic:  
371 - * |Data Structure Element| Meaning|  
372 - * |----------------------|--------|  
373 - * |controlMode |The modes in which the aircraft is being controlled (control loops being applied on horizontal, vertical and yaw axes of the aircraft)|  
374 - * |deviceStatus |Which device is controlling the motion of the aircraft: RC (Manual control), MSDK (Missions kicked off through mobile), OSDK (Missions kicked off through onboard/ low-level flight control) |  
375 - * |flightStatus |Has the OSDK been granted control authority? Since MSDK and RC have precedence, it is possible that deviceStatus shows RC or MSDK actually controlling the aircraft but this value is 1. |  
376 - * |vrcStatus |Deprecated|  
377 - * @datastruct \ref T_ZiyanFcSubscriptionControlDevice  
378 - */  
379 - ZIYAN_FC_SUBSCRIPTION_TOPIC_CONTROL_DEVICE = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 33),  
380 - /*!  
381 - * @brief Provides IMU and quaternion data time-synced with a hardware clock signal @ up to 400Hz.  
382 - * @details This is the only data which can be synchronized with external software or hardware systems. If you want to  
383 - * fuse an external sensor's data with the aircraft's IMU, this data along with a hardware trigger from the A3/N3's  
384 - * expansion ports is how you would do it. You can see detailed documentation on how this process works in the [Hardware  
385 - * Sync Guide](https://developer.ziyan.com/onboard-sdk/documentation/guides/component-guide-hardware-sync.html).  
386 - * @sensors IMU, sensor fusion output  
387 - * @units  
388 - * |Data Structure Element| Units|  
389 - * |----------------------|--------|  
390 - * |Timestamp |2.5ms, 1ns (See \ref SyncTimestamp)|  
391 - * |Quaternion |rad (after converting to rotation matrix)|  
392 - * |Acceleration |g|  
393 - * |Gyroscope |rad/sec|  
394 - * @datastruct \ref T_ZiyanFcSubscriptionHardSync  
395 - */  
396 - ZIYAN_FC_SUBSCRIPTION_TOPIC_HARD_SYNC = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 34),  
397 - /*!  
398 - * @brief Provides a measure of the quality of GPS signal, with a mechanism for guarding against unset homepoint @ up to 50Hz  
399 - * @details The level varies from 0 to 5, with 0 being the worst and 5 the best GPS signal. The key difference between  
400 - * this and TOPIC_GPS_SIGNAL_LEVEL is that this topic always returns 0 if the homepoint is not set. Once the home point is  
401 - * set, the behavior is exactly the same as TOPIC_GPS_SIGNAL_LEVEL.  
402 - * @sensors GPS  
403 - * @datastruct \ref T_ZiyanFcSubscriptionGpsControlLevel  
404 - * @also \ref TOPIC_GPS_SIGNAL_LEVEL  
405 - */  
406 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GPS_CONTROL_LEVEL = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 35),  
407 - /*!  
408 - * @brief Provides normalized remote controller stick input data, along with connection status @ up to 50Hz  
409 - * @note This topic was added in August 2018. Your aircraft may require a FW update to enable this feature.  
410 - * @details This topic will give you:  
411 - * - Stick inputs (R,P,Y,Thr)  
412 - * - Mode switch (P/A/F)  
413 - * - Landing gear switch (Up/Down)  
414 - * - Connection status for air system, ground system and MSDK apps. The connection status also includes a  
415 - * logicConnected element, which will change to false if either the air system or the ground system radios  
416 - * are disconnected for >3s.  
417 - * - Deadzones near the center of the stick positions are also handled in this topic.  
418 - *  
419 - * @datastruct \ref T_ZiyanFcSubscriptionRCWithFlagData  
420 - * @also \ref TOPIC_RC  
421 - */  
422 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RC_WITH_FLAG_DATA = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 36),  
423 - /*!  
424 - * @brief Provides raw data from the ESCs @ up to 50Hz  
425 - * @note This topic was added in August 2018. Your aircraft may require a FW update to enable this feature.  
426 - * @details This topic supports reporting data for up to 8 ESCs; note that only ZIYAN Intelligent ESCs are supported  
427 - * for this reporting feature. Use this topic to get data on elements close to the hardware - e.g. motor speeds,  
428 - * ESC current and voltage, error flags at the ESC level etc.  
429 - * @datastruct \ref T_ZiyanFcSubscriptionEscData  
430 - */  
431 - ZIYAN_FC_SUBSCRIPTION_TOPIC_ESC_DATA = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 37),  
432 - /*!  
433 - * @brief Provides RTK connection status @ up to 50Hz  
434 - * @note This topic was added in August 2018. Your aircraft may require a FW update to enable this feature.  
435 - * @details This topic will update in real time whether the RTK GPS system is connected or not; typical uses  
436 - * include app-level logic to switch between GPS and RTK sources of positioning based on this flag.  
437 - * @datastruct \ref T_ZiyanFcSubscriptionRTKConnectStatus  
438 - */  
439 - ZIYAN_FC_SUBSCRIPTION_TOPIC_RTK_CONNECT_STATUS = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 38),  
440 - /*!  
441 - * @brief Provides the mode in which the gimbal will interpret control commands @ up to 50Hz  
442 - * @note This topic was added in August 2018. Your aircraft may require a FW update to enable this feature.  
443 - * @details This topic will report the current control mode which can be set in the  
444 - * ZIYAN Go app, MSDK apps, or through Onboard SDK gimbal control APIs (see \ref Gimbal::AngleData "AngleData" struct  
445 - * for more information)  
446 - * @datastruct \ref T_ZiyanFcSubscriptionGimbalControlMode  
447 - */  
448 - ZIYAN_FC_SUBSCRIPTION_TOPIC_GIMBAL_CONTROL_MODE = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 39),  
449 - /*!  
450 - * @brief Provides a number of flags which report different errors the aircraft may encounter in flight @ up to 50Hz  
451 - * @note This topic was added in August 2018. Your aircraft may require a FW update to enable this feature.  
452 - * @warning Most of the errors reported by this topic are cases where immediate action is required; you can use these  
453 - * as a baseline for implementing safety-related error-handling routines.  
454 - * @datastruct \ref T_ZiyanFcSubscriptionFlightAnomaly  
455 - */  
456 - ZIYAN_FC_SUBSCRIPTION_TOPIC_FLIGHT_ANOMALY = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 40),  
457 - /*!  
458 - * @brief Provides aircraft's position in a Cartesian frame @ up to 50Hz, without the need for GPS  
459 - * @warning This topic does not follow a standard co-ordinate convention. Please read the details below for usage.  
460 - * @details This is the only topic which can provide positioning information without having a GPS fix; though this  
461 - * can be a big enabler please note the caveats of using this topic:  
462 - * - The topic will use an origin that does not have a global reference, and is not published to the SDK.  
463 - * - The topic uses a combination of VO and compass heading to identify the X-Y axes of its reference frame. This means  
464 - * that if your compass performance is not good in an environment, there is no guarantee the X-Y axes will point to  
465 - * North and East.  
466 - * - The actual directions of the X-Y axes are currently not published to the SDK.  
467 - * - If during a flight the compass performance were to change dramatically, the orientation of the X-Y axes may change  
468 - * to re-align with North-East. The aircraft's position in X and Y may exhibit discontinuities in these cases.  
469 - * - The reference frame is referred to as the Navigation Frame - Cartesian X,Y axes aligned with N,E directions on a best-effort  
470 - * basis, and Z aligned to D (down) direction.  
471 - * - A health flag for each axis provides some granularity on whether this data is valid or not.  
472 - *  
473 - * The key takeaway from these details is that this topic provides a best-effort attempt at providing position  
474 - * information in the absence of absolute references (GPS, compass etc.), without guarantees of consistency if  
475 - * environmental conditions change. So if your application is confined to a stable environment, or if you will  
476 - * have GPS and compass available at all times, this topic can still provide useful data that cannot be otherwise  
477 - * had. If using for control, make sure to have guards checking for the continuity of data.  
478 - *  
479 - * @note Since this topic relies on visual features and/or GPS, if your environment does not provide any of these  
480 - * sources of data, the quality of this topic will reduce significantly. VO data quality will reduce if you are too high  
481 - * above the ground. Make sure that the Vision Positioning System is enabled in ZIYAN Go 4 before using this topic  
482 - * (by default it is enabled).  
483 - * @sensors IMU, VO, GPS(if available), RTK (if available), ultrasonic, magnetometer, barometer  
484 - * @units m  
485 - * @datastruct \ref T_ZiyanFcSubscriptionPositionVO  
486 - */  
487 - ZIYAN_FC_SUBSCRIPTION_TOPIC_POSITION_VO = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 41),  
488 - /*!  
489 - * @brief Provides obstacle info around the vehicle @ up to 100Hz  
490 - * @datastruct \ref T_ZiyanFcSubscriptionAvoidData  
491 - */  
492 - ZIYAN_FC_SUBSCRIPTION_TOPIC_AVOID_DATA = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 42),  
493 - /*!  
494 - * @brief Provides status of whether the home point was set or not  
495 - * @datastruct \ref T_ZiyanFcSubscriptionHomePointSetStatus  
496 - */  
497 - ZIYAN_FC_SUBSCRIPTION_TOPIC_HOME_POINT_SET_STATUS = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 43),  
498 - /*!  
499 - * @brief Provides homepoint information, the valid of the home point infomation can ref to the  
500 - * topic ZIYAN_FC_SUBSCRIPTION_TOPIC_HOME_POINT_SET_STATUS  
501 - * @datastruct \ref T_ZiyanFcSubscriptionHomePointInfo  
502 - */  
503 - ZIYAN_FC_SUBSCRIPTION_TOPIC_HOME_POINT_INFO = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 44),  
504 - /*!  
505 - * @brief Provides three gimbal information, used for M300  
506 - * @datastruct \ref T_ZiyanFcSubscriptionThreeGimbalData  
507 - */  
508 - ZIYAN_FC_SUBSCRIPTION_TOPIC_THREE_GIMBAL_DATA = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 45),  
509 -  
510 - /*!  
511 - * @brief Battery information topic name. Please refer to ::T_ZiyanFcSubscriptionSingleBatteryInfo for information about data structure.  
512 - * @datastruct \ref T_ZiyanFcSubscriptionSingleBatteryInfo  
513 - */  
514 - ZIYAN_FC_SUBSCRIPTION_TOPIC_BATTERY_SINGLE_INFO_INDEX1 = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC,  
515 - 46),  
516 - /*!  
517 - * @brief Battery information topic name. Please refer to ::T_ZiyanFcSubscriptionSingleBatteryInfo for information about data structure.  
518 - * @datastruct \ref T_ZiyanFcSubscriptionSingleBatteryInfo  
519 - */  
520 - ZIYAN_FC_SUBSCRIPTION_TOPIC_BATTERY_SINGLE_INFO_INDEX2 = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC,  
521 - 47),  
522 -  
523 - /*!  
524 - * @brief Please refer to ::T_ZiyanFcSubscriptionImuAttiNaviDataWithTimestamp for information about data structure.  
525 - * @datastruct \ref T_ZiyanFcSubscriptionImuAttiNaviDataWithTimestamp  
526 - */  
527 - ZIYAN_FC_SUBSCRIPTION_TOPIC_IMU_ATTI_NAVI_DATA_WITH_TIMESTAMP = ZIYAN_DATA_SUBSCRIPTION_TOPIC(ZIYAN_DATA_SUBSCRIPTION_MODULE_FC, 48),  
528 -  
529 - /*! Total number of topics that can be subscribed. */  
530 - ZIYAN_FC_SUBSCRIPTION_TOPIC_TOTAL_NUMBER,  
531 -} E_ZiyanFcSubscriptionTopic;  
532 -  
533 -/**  
534 - * @brief Health state of data subscribed.  
535 - */  
536 -typedef enum {  
537 - ZIYAN_FC_SUBSCRIPTION_DATA_NOT_HEALTH = 0, /*!< Data subscribed is healthy and can be used. */  
538 - ZIYAN_FC_SUBSCRIPTION_DATA_HEALTH = 1, /*!< Data subscribed is not healthy and recommend not to use it. */  
539 -} E_ZiyanFcSubscriptionDataHealthFlag;  
540 -  
541 -/**  
542 - * @brief Position solution property.  
543 - */  
544 -typedef enum {  
545 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NOT_AVAILABLE = 0, /*!< Position solution is not available. */  
546 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_POSITION = 1, /*!< Position has been fixed by the FIX POSITION command. */  
547 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FIX_HEIGHT_AUTO = 2, /*!< Position has been fixed by the FIX HEIGHT/AUTO command. */  
548 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_INSTANTANEOUS_DOPPLER_COMPUTE_VELOCITY = 8, /*!< Velocity computed using instantaneous Doppler. */  
549 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SINGLE_PNT_SOLUTION = 16, /*!< Single point position solution. */  
550 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_PSEUDORANGE_DIFFERENTIAL_SOLUTION = 17, /*!< Pseudorange differential solution. */  
551 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_SBAS_CORRECTION_CALCULATED = 18, /*!< Solution calculated using corrections from an SBAS. */  
552 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_KALMAN_FILTER_WITHOUT_OBSERVATION_PROPAGATED = 19, /*!< Propagated by a Kalman filter without new observations. */  
553 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_OMNISTAR_VBS_POSITION = 20, /*!< OmniSTAR VBS position (L1 sub-metre). */  
554 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_L1_AMBIGUITY = 32, /*!< Floating L1 ambiguity solution. */  
555 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_IONOSPHERIC_FREE_AMBIGUITY = 33, /*!< Floating ionospheric-free ambiguity solution. */  
556 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_FLOAT_SOLUTION = 34, /*!< Float position solution. */  
557 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_L1_AMBIGUITY_INT = 48, /*!< Integer L1 ambiguity solution. */  
558 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_WIDE_LANE_AMBIGUITY_INT = 49, /*!< Integer wide-lane ambiguity solution. */  
559 - ZIYAN_FC_SUBSCRIPTION_POSITION_SOLUTION_PROPERTY_NARROW_INT = 50, /*!< Narrow fixed point position solution. */  
560 -} E_ZiyanFcSubscriptionPositionSolutionProperty;  
561 -  
562 -/**  
563 - * @brief GPS fix state.  
564 - */  
565 -typedef enum {  
566 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_NO_FIX = 0, /*!< GPS position has not been fixed. */  
567 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_DEAD_RECKONING_ONLY = 1, /*!< GPS position is dead reckoned only. */  
568 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_2D_FIX = 2, /*!< The horizontal position with latitude/longitude (or northing/easting or X/Y) is fixed. */  
569 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_3D_FIX = 3, /*!< The horizontal and vertical position with latitude/longitude/altitude (northing/easting/altitude or X/Y/Z) is fixed. */  
570 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_GPS_PLUS_DEAD_RECKONING = 4, /*!< Position is calculated by GPS and combined with dead reckoning. */  
571 - ZIYAN_FC_SUBSCRIPTION_GPS_FIX_STATE_TIME_ONLY_FIX = 5, /*!< Only time is fixed. */  
572 -} E_ZiyanFcSubscriptionGpsFixState;  
573 -  
574 -/**  
575 - * @brief Flight status of aircraft.  
576 - */  
577 -typedef enum {  
578 - ZIYAN_FC_SUBSCRIPTION_FLIGHT_STATUS_STOPED = 0, /*!< Aircraft is on ground and motors are still. */  
579 - ZIYAN_FC_SUBSCRIPTION_FLIGHT_STATUS_ON_GROUND = 1, /*!< Aircraft is on ground but motors are rotating. */  
580 - ZIYAN_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR = 2, /*!< Aircraft is in air. */  
581 -} E_ZiyanFcSubscriptionFlightStatus;  
582 -  
583 -/*!  
584 - * @brief "Mode" of the vehicle's state machine, as displayed on ZIYAN Go  
585 - * @details Available through Telemetry::TOPIC_STATUS_DISPLAYMODE  
586 - */  
587 -typedef enum {  
588 - /*! This mode requires the user to manually  
589 - * control the aircraft to remain stable in air. */  
590 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_MANUAL_CTRL = 0,  
591 - /*! In this mode, the aircraft can keep  
592 - * attitude stabilization and only use the  
593 - * barometer for positioning to control the altitude. <br>  
594 - * The aircraft can not autonomously locate and hover stably.*/  
595 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE = 1,  
596 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_2 = 2,  
597 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_3 = 3,  
598 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_4 = 4,  
599 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_5 = 5,  
600 - /*! The aircraft is in normal GPS mode. <br>  
601 - * In normal GPS mode, the aircraft can  
602 - * autonomously locate and hover stably. <br>  
603 - * The sensitivity of the aircraft to the  
604 - * command response is moderate.  
605 - */  
606 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_P_GPS = 6,  
607 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_7 = 7,  
608 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_8 = 8,  
609 - /*! In hotpoint mode */  
610 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_HOTPOINT_MODE = 9,  
611 - /*! In this mode, user can push the throttle  
612 - * stick to complete stable take-off. */  
613 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_ASSISTED_TAKEOFF = 10,  
614 - /*! In this mode, the aircraft will autonomously  
615 - * start motor, ascend and finally hover. */  
616 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_TAKEOFF = 11,  
617 - /*! In this mode, the aircraft can land autonomously. */  
618 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING = 12,  
619 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_13 = 13,  
620 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_14 = 14,  
621 - /*! In this mode, the aircraft can antonomously return the  
622 - * last recorded Home Point. <br>  
623 - * There are three types of this mode: Smart RTH(Return-to-Home),  
624 - * Low Batterry RTH, and Failsafe RTTH. */  
625 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_GO_HOME = 15,  
626 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_16 = 16,  
627 - /*! In this mode, the aircraft is controled by SDK API. <br>  
628 - * User can directly define the control mode of horizon  
629 - * and vertical directions and send control datas to aircraft. */  
630 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_SDK_CTRL = 17,  
631 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_18 = 18,  
632 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_19 = 19,  
633 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_20 = 20,  
634 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_21 = 21,  
635 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_22 = 22,  
636 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_23 = 23,  
637 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_24 = 24,  
638 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_25 = 25,  
639 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_26 = 26,  
640 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_27 = 27,  
641 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_28 = 28,  
642 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_29 = 29,  
643 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_30 = 30,  
644 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_31 = 31,  
645 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_32 = 32,  
646 - /*! drone is forced to land, might due to low battery */  
647 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_FORCE_AUTO_LANDING = 33,  
648 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_34 = 34,  
649 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_35 = 35,  
650 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_36 = 36,  
651 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_37 = 37,  
652 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_38 = 38,  
653 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_39 = 39,  
654 - /*! drone will search for the last position where the rc is not lost */  
655 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_SEARCH_MODE = 40,  
656 - /*! Mode for motor starting. <br>  
657 - * Every time user unlock the motor, this will be the first mode. */  
658 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_ENGINE_START = 41,  
659 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_42 = 42,  
660 - ZIYAN_FC_SUBSCRIPTION_DISPLAY_MODE_RESERVED_43 = 42,  
661 -} E_ZiyanFcSubscriptionDisplayMode;  
662 -  
663 -/**  
664 - * @brief Setting status of homepoint.  
665 - */  
666 -typedef enum {  
667 - ZIYAN_FC_SUBSCRIPTION_HOME_POINT_SET_STATUS_FAILED = 0, /*!< The home point was not set yet. */  
668 - ZIYAN_FC_SUBSCRIPTION_HOME_POINT_SET_STATUS_SUCCESS = 1, /*!< The home point was set successfully. */  
669 -} E_ZiyanFcSubscriptionHomePointSetStatus;  
670 -  
671 -/**  
672 - * @brief Smart battery self-check result.  
673 - */  
674 -typedef enum {  
675 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_NORMAL = 0, /*!< Battery self-check is normal. */  
676 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_NTC_ABNORMAL = 1, /*!< Battery self-check NTC is abnormal. */  
677 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_MOS_ABNORMAL = 2, /*!< Battery self-check MOS is abnormal. */  
678 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_R_ABNORMAL = 3, /*!< Battery self-check sampling resistance is abnormal. */  
679 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_CELL_DAMAGE = 4, /*!< Battery cell self-check is damaged. */  
680 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_CAL_EXP = 5, /*!< Battery self-check is not calibrated. */  
681 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SELF_CHECK_GAUGE_PARM_EXP = 6, /*!< Battery self-check fuel gauge parameters is abnormal. */  
682 -} E_ZIYANFcSubscriptionBatterySelfCheck;  
683 -  
684 -/**  
685 - * @brief Smart battery closed reason.  
686 - */  
687 -typedef enum {  
688 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_NORMAL = 0, /*!< Battery closed reason is normal shutdown. */  
689 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_FORCED = 1, /*!< Battery closed reason is forced by flight controller shutdown. */  
690 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_SCD = 2, /*!< Battery closed reason is discharge short circuit shutdown. */  
691 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_OLD = 3, /*!< Battery closed reason is discharge overload shutdown. */  
692 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_OCD = 4, /*!< Battery closed reason is discharge over current shutdown. */  
693 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_UVD = 5, /*!< Battery closed reason is discharge under voltage shutdown. */  
694 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_OTD = 6, /*!< Battery closed reason is discharge over temperature shutdown. */  
695 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_SCC = 16, /*!< Battery closed reason is charging short circuit shutdown. */  
696 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_OCC = 17, /*!< Battery closed reason is charging over current shutdown. */  
697 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_OVC = 18, /*!< Battery closed reason is charging over voltage shutdown. */  
698 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_CHARGER_OVC = 19, /*!< Battery closed reason is charger over voltage shutdown. */  
699 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_LTC = 20, /*!< Battery closed reason is charging low temperature shutdown. */  
700 - ZIYAN_FC_SUBSCRIPTION_BATTERY_CLOSED_HTC = 21, /*!< Battery closed reason is charging high temperature shutdown. */  
701 -} E_ZIYANFcSubscriptionBatteryClosedReason;  
702 -  
703 -/**  
704 - * @brief Smart battery SOH state.  
705 - */  
706 -typedef enum {  
707 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOH_NORMAL = 0, /*!< Battery SOH state is normal. */  
708 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOH_ALERT = 1, /*!< Battery SOH state is alert. */  
709 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOH_SAFE = 2, /*!< Battery SOH state is safe. */  
710 -} E_ZIYANFcSubscriptionBatterySohState;  
711 -  
712 -/**  
713 - * @brief Smart battery heart state.  
714 - */  
715 -typedef enum {  
716 - ZIYAN_FC_SUBSCRIPTION_BATTERY_NO_HEAT = 0, /*!< Battery is in no heat state. */  
717 - ZIYAN_FC_SUBSCRIPTION_BATTERY_IN_HEAT = 1, /*!< Battery is in heat state. */  
718 - ZIYAN_FC_SUBSCRIPTION_BATTERY_KEEP_WARM = 2, /*!< Battery is in keep warm state. */  
719 -} E_ZIYANFcSubscriptionBatteryHeatState;  
720 -  
721 -/**  
722 - * @brief Smart battery SOC state.  
723 - */  
724 -typedef enum {  
725 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOC_NORMAL = 0, /*!< Battery SOC state is normal. */  
726 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOC_ABNORMAL_HIGH = 1, /*!< Battery SOC state is abnormal high. */  
727 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOC_JUMP_DOWN = 2, /*!< Battery SOC state is jump down. */  
728 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOC_JUMP_UP = 3, /*!< Battery SOC state is jump up. */  
729 - ZIYAN_FC_SUBSCRIPTION_BATTERY_SOC_INVALID = 4, /*!< Battery SOC state is invalid. */  
730 -} E_ZIYANFcSubscriptionBatterySocState;  
731 -  
732 -/**  
733 - * @brief Flight control mode.  
734 - */  
735 -typedef enum {  
736 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_UNKNOWN = 0,  
737 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_VEL_YAW_ANG = 1, /*!< Horizontal mode is angle, vertical mode is velocity, yaw mode is angle. */  
738 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_VEL_YAW_RAT = 2, /*!< Horizontal mode is angle, vertical mode is velocity, yaw mode is rate. */  
739 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_VEL_YAW_ANG = 3, /*!< Horizontal mode is velocity, vertical mode is velocity, yaw mode is angle. */  
740 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_VEL_YAW_RAT = 4, /*!< Horizontal mode is velocity, vertical mode is velocity, yaw mode is rate. */  
741 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_VEL_YAW_ANG = 5, /*!< Horizontal mode is position, vertical mode is velocity, yaw mode is angle. */  
742 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_VEL_YAW_RAT = 6, /*!< Horizontal mode is position, vertical mode is velocity, yaw mode is rate. */  
743 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_POS_YAW_ANG = 7, /*!< Horizontal mode is angle, vertical mode is position, yaw mode is angle. */  
744 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_POS_YAW_RAT = 8, /*!< Horizontal mode is angle, vertical mode is position, yaw mode is rate. */  
745 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_POS_YAW_ANG = 9, /*!< Horizontal mode is velocity, vertical mode is position, yaw mode is angle. */  
746 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_POS_YAW_RAT = 10, /*!< Horizontal mode is velocity, vertical mode is position, yaw mode is rate. */  
747 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_POS_YAW_ANG = 11, /*!< Horizontal mode is position, vertical mode is position, yaw mode is angle. */  
748 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_POS_YAW_RAT = 12, /*!< Horizontal mode is position, vertical mode is position, yaw mode is rate. */  
749 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_THR_YAW_ANG = 13, /*!< Horizontal mode is angle, vertical mode is thrust, yaw mode is angle. */  
750 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_ANG_VER_THR_YAW_RAT = 14, /*!< Horizontal mode is angle, vertical mode is thrust, yaw mode is rate. */  
751 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_THR_YAW_ANG = 15, /*!< Horizontal mode is velocity, vertical mode is thrust, yaw mode is angle. */  
752 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_VEL_VER_THR_YAW_RAT = 16, /*!< Horizontal mode is velocity, vertical mode is thrust, yaw mode is rate. */  
753 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_THR_YAW_ANG = 17, /*!< Horizontal mode is position, vertical mode is thrust, yaw mode is angle. */  
754 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_POS_VER_THR_YAW_RAT = 18, /*!< Horizontal mode is position, vertical mode is thrust, yaw mode is rate. */  
755 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_AEL_VER_VEL_YAW_RAT = 19, /*!< Horizontal mode is angle-rate, vertical mode is velocity, yaw mode is rate. */  
756 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_AEL_VER_POS_YAW_RAT = 20, /*!< Horizontal mode is angle-rate, vertical mode is thrust, yaw mode is rate. */  
757 - ZIYAN_FC_SUBSCRIPTION_CONTROL_MODE_HOR_AEL_VER_THR_YAW_RAT = 21, /*!< Horizontal mode is angle-rate, vertical mode is velocity, yaw mode is rate. */  
758 -} E_ZIYANFcSubscriptionControlMode;  
759 -  
760 -/**  
761 - * @brief Flight control authority.  
762 - */  
763 -typedef enum {  
764 - ZIYAN_FC_SUBSCRIPTION_CONTROL_AUTHORITY_RC = 0, /*!< Authority is in remote control */  
765 - ZIYAN_FC_SUBSCRIPTION_CONTROL_AUTHORITY_MSDK = 1, /*!< Authority is in MSDK */  
766 - ZIYAN_FC_SUBSCRIPTION_CONTROL_AUTHORITY_PSDK = 4, /*!< Authority is in PSDK */  
767 - ZIYAN_FC_SUBSCRIPTION_CONTROL_AUTHORITY_DOCK = 5, /*!< Authority is in dock */  
768 -} E_ZIYANFcSubscriptionControlAuthority;  
769 -  
770 -/**  
771 - * @brief Flight control authority change reason.  
772 - */  
773 -typedef enum {  
774 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_UNKNOWN = 0, /*!< Reason unknown */  
775 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_MSDK_REQUEST = 1, /*!< Contro authority changed by MSDK request. */  
776 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_USER_REQUEST = 2, /*!< Contro authority changed by user request. */  
777 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_PSDK_REQUEST = 3, /*!< Contro authority changed by PSDK request. */  
778 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_RC_LOST = 4, /*!< Contro authority changed for remote control lost. */  
779 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_RC_NOT_P_MODE = 5, /*!< Contro authority changed for remote control not in P mode. */  
780 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_RC_SWITCH = 6, /*!< Contro authority changed for remote control switching mode. */  
781 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_RC_PAUSE_STOP = 7, /*!< Contro authority changed for remote control stop key paused. */  
782 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_RC_ONE_KEY_GO_HOME = 8, /*!< Contro authority changed for remote control go-home key paused. */  
783 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_BATTERY_LOW_GO_HOME = 9, /*!< Contro authority changed for remote control go-home key paused. */  
784 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_BATTERY_SUPER_LOW_LANDING = 10, /*!< Contro authority changed for going home caused by low batter power. */  
785 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_PSDK_LOST = 11, /*!< Contro authority changed for PSDK lost. */  
786 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_NEAR_BOUNDARY = 13, /*!< Contro authority changed for nearing boundary. */  
787 - ZIYAN_FC_SUBSCRIPTION_AUTHORITY_CHANGE_REASON_AIRPORT_REQUEST = 14, /*!< Contro authority changed by airport request. */  
788 -} E_ZIYANFcSubscriptionAuthorityChangeReason;  
789 -  
790 -#pragma pack(1)  
791 -  
792 -/**  
793 - * @brief Quaternion topic data structure.  
794 - */  
795 -typedef struct Quaternion {  
796 - ziyan_f32_t q0; /*!< w, rad (when converted to a rotation matrix or Euler angles). */  
797 - ziyan_f32_t q1; /*!< x, rad (when converted to a rotation matrix or Euler angles). */  
798 - ziyan_f32_t q2; /*!< y, rad (when converted to a rotation matrix or Euler angles). */  
799 - ziyan_f32_t q3; /*!< z, rad (when converted to a rotation matrix or Euler angles). */  
800 -} T_ZiyanFcSubscriptionQuaternion;  
801 -  
802 -/**  
803 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_GROUND topic data structure.  
804 - */  
805 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionAccelerationGround;  
806 -  
807 -/**  
808 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_BODY topic data structure.  
809 - */  
810 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionAccelerationBody;  
811 -  
812 -/**  
813 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ACCELERATION_RAW topic data structure.  
814 - */  
815 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionAccelerationRaw;  
816 -  
817 -/**  
818 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_VELOCITY topic data structure.  
819 - */  
820 -typedef struct Velocity {  
821 - /*! Velocity of aircraft. */  
822 - T_ZiyanVector3f data;  
823 - /*! Health state of aircraft velocity data. It can be any value of ::E_ZiyanFcSubscriptionDataHealthFlag. */  
824 - uint8_t health: 1;  
825 - /*! Reserved. */  
826 - uint8_t reserve: 7;  
827 -} T_ZiyanFcSubscriptionVelocity;  
828 -  
829 -/**  
830 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ANGULAR_RATE_FUSIONED topic data structure.  
831 - */  
832 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionAngularRateFusioned;  
833 -  
834 -/**  
835 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ANGULAR_RATE_RAW topic data structure.  
836 - */  
837 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionAngularRateRaw;  
838 -  
839 -/**  
840 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ANGULAR_RATE_RAW topic data structure.  
841 - */  
842 -typedef ziyan_f32_t T_ZiyanFcSubscriptionAltitudeFused;  
843 -  
844 -/**  
845 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ALTITUDE_BAROMETER topic data structure.  
846 - */  
847 -typedef ziyan_f32_t T_ZiyanFcSubscriptionAltitudeBarometer;  
848 -  
849 -/**  
850 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_ALTITUDE_OF_HOMEPOINT topic data structure.  
851 - */  
852 -typedef ziyan_f32_t T_ZiyanFcSubscriptionAltitudeOfHomePoint;  
853 -  
854 -/**  
855 - * @brief ZIYAN_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION topic data structure.  
856 - */  
857 -typedef ziyan_f32_t T_ZiyanFcSubscriptionHeightFusion;  
858 -  
859 -/**  
860 - * @brief Relative height above ground topic data structure, unit: m.  
861 - */  
862 -typedef ziyan_f32_t T_ZiyanFcSubscriptionHeightRelative;  
863 -  
864 -/**  
865 - * @brief Fused position topic data structure.  
866 - */  
867 -typedef struct PositionFused {  
868 - ziyan_f64_t longitude; /*!< Longitude, unit: rad. */  
869 - ziyan_f64_t latitude; /*!< Latitude, unit: rad. */  
870 - ziyan_f32_t altitude; /*!< Altitude, WGS 84 reference ellipsoid, unit: m. */  
871 - uint16_t visibleSatelliteNumber; /*!< Number of visible satellites. */  
872 -} T_ZiyanFcSubscriptionPositionFused;  
873 -  
874 -/**  
875 - * @brief GPS date topic data structure, format: yyyymmdd.  
876 - */  
877 -typedef uint32_t T_ZiyanFcSubscriptionGpsDate;  
878 -  
879 -/**  
880 - * @brief GPS time topic data structure, format: hhmmss.  
881 - */  
882 -typedef uint32_t T_ZiyanFcSubscriptionGpsTime;  
883 -  
884 -/**  
885 - * @brief GPS position topic data structure. x = Longitude, y = Latitude, z = Altitude, unit: deg*10<SUP>-7</SUP>  
886 - * (Lat,Lon), mm (Alt)  
887 - */  
888 -typedef T_ZiyanVector3d T_ZiyanFcSubscriptionGpsPosition;  
889 -  
890 -/**  
891 - * @brief GPS velocity topic data structure, unit: cm/s.  
892 - */  
893 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionGpsVelocity;  
894 -  
895 -/**  
896 - * @brief GPS details topic data structure.  
897 - */  
898 -typedef struct GpsDetail {  
899 - ziyan_f32_t hdop; /*!< Horizontal dilution of precision, unit: 0.01, eg: 100 = 1.00, <1: ideal, 1-2: excellent, 2-5: good, 5-10: moderate, 10-20: fair, >20: poor. */  
900 - ziyan_f32_t pdop; /*!< Position dilution of precision, unit: 0.01, eg: 100 = 1.00, <1: ideal, 1-2: excellent, 2-5: good, 5-10: moderate, 10-20: fair, >20: poor. */  
901 - ziyan_f32_t fixState; /*!< GPS fix state, and can be any value of ::E_ZiyanFcSubscriptionGpsFixState. Value other than ::E_ZiyanFcSubscriptionGpsFixState is invalid. */  
902 - ziyan_f32_t vacc; /*!< Vertical position accuracy (mm), the smaller, the better. */  
903 - ziyan_f32_t hacc; /*!< Horizontal position accuracy (mm), the smaller, the better. */  
904 - ziyan_f32_t sacc; /*!< Speed accuracy (cm/s), the smaller, the better. */  
905 - uint32_t gpsSatelliteNumberUsed; /*!< Number of GPS satellites used for fixing position. */  
906 - uint32_t glonassSatelliteNumberUsed; /*!< Number of GLONASS satellites used for fixing position. */  
907 - uint16_t totalSatelliteNumberUsed; /*!< Total number of satellites used for fixing position. */  
908 - uint16_t gpsCounter; /*!< Accumulated times of sending GPS data. */  
909 -} T_ZiyanFcSubscriptionGpsDetails;  
910 -  
911 -/**  
912 - * @brief GPS signal level topic data structure. Signal level of GPS. The level varies from 0 to 5, with 0 being the  
913 - * worst and 5 the best GPS signal.  
914 - */  
915 -typedef uint8_t T_ZiyanFcSubscriptionGpsSignalLevel;  
916 -  
917 -/**  
918 - * @brief RTK position topic data structure.  
919 - */  
920 -typedef struct PositionData {  
921 - ziyan_f64_t longitude; /*!< Longitude, unit: deg. */  
922 - ziyan_f64_t latitude; /*!< Latitude, unit: deg. */  
923 - ziyan_f32_t hfsl; /*!< Height above mean sea level, unit: m. */  
924 -} T_ZiyanFcSubscriptionRtkPosition;  
925 -  
926 -/**  
927 - * @brief RTK velocity topic data structure, unit: cm/s.  
928 - */  
929 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionRtkVelocity;  
930 -  
931 -/**  
932 - * @brief RTK yaw topic data structure, unit: deg.  
933 - */  
934 -typedef int16_t T_ZiyanFcSubscriptionRtkYaw;  
935 -  
936 -/**  
937 - * @brief RTK position information topic data structure. Specifies RTK position solution state, it can be any value of  
938 - * ::E_ZiyanFcSubscriptionPositionSolutionProperty.  
939 - */  
940 -typedef uint8_t T_ZiyanFcSubscriptionRtkPositionInfo;  
941 -  
942 -/**  
943 - * @brief RTK yaw information topic data structure. Specifies RTK yaw solution state, it can be any value of  
944 - * ::E_ZiyanFcSubscriptionPositionSolutionProperty.  
945 - */  
946 -typedef uint8_t T_ZiyanFcSubscriptionRtkYawInfo;  
947 -  
948 -/*!  
949 - * @brief struct for data broadcast, return magnetometer reading  
950 - *  
951 - * @note returned value is calibrated mag data,  
952 - * 1000 < |mag| < 2000 for normal operation  
953 - */  
954 -typedef struct Mag {  
955 - int16_t x;  
956 - int16_t y;  
957 - int16_t z;  
958 -} T_ZiyanFcSubscriptionCompass;  
959 -  
960 -/*!  
961 - * @brief struct for data broadcast and data subscription, return RC reading  
962 - */  
963 -typedef struct RC {  
964 - int16_t roll; /*!< [-10000,10000] */  
965 - int16_t pitch; /*!< [-10000,10000] */  
966 - int16_t yaw; /*!< [-10000,10000] */  
967 - int16_t throttle; /*!< [-10000,10000] */  
968 - int16_t mode; /*!< [-10000,10000] */  
969 - /*!< M100 [P: -8000, A: 0, F: 8000] */  
970 - int16_t gear; /*!< [-10000,10000] */  
971 - /*!< M100 [Up: -10000, Down: -4545] */  
972 -} T_ZiyanFcSubscriptionRC;  
973 -  
974 -typedef T_ZiyanVector3f T_ZiyanFcSubscriptionGimbalAngles;  
975 -  
976 -/*!  
977 - * @brief struct for TOPIC_GIMBAL_STATUS  
978 - */  
979 -typedef struct GimbalStatus {  
980 - uint32_t mountStatus: 1; /*!< 1 - gimbal mounted, 0 - gimbal not mounted*/  
981 - uint32_t isBusy: 1;  
982 - uint32_t pitchLimited: 1; /*!< 1 - axis reached limit, 0 - no */  
983 - uint32_t rollLimited: 1; /*!< 1 - axis reached limit, 0 - no */  
984 - uint32_t yawLimited: 1; /*!< 1 - axis reached limit, 0 - no */  
985 - uint32_t calibrating: 1; /*!< 1 - calibrating, 0 - no */  
986 - uint32_t prevCalibrationgResult: 1; /*!< 1 - success, 0 - fail */  
987 - uint32_t installedDirection: 1; /*!< 1 - reversed for OSMO, 0 - normal */  
988 - uint32_t disabled_mvo: 1;  
989 - uint32_t gear_show_unable: 1;  
990 - uint32_t gyroFalut: 1; /*!< 1 - fault, 0 - normal */  
991 - uint32_t escPitchStatus: 1; /*!< 1 - Pitch data is normal, 0 - fault */  
992 - uint32_t escRollStatus: 1; /*!< 1 - Roll data is normal, 0 - fault */  
993 - uint32_t escYawStatus: 1; /*!< 1 - Yaw data is normal , 0 - fault */  
994 - uint32_t droneDataRecv: 1; /*!< 1 - normal , 0 - at fault */  
995 - uint32_t initUnfinished: 1; /*!< 1 - init complete, 0 - not complete */  
996 - uint32_t FWUpdating: 1; /*!< 1 - updating, 0 - not updating */  
997 - uint32_t reserved2: 15;  
998 -} T_ZiyanFcSubscriptionGimbalStatus;  
999 -  
1000 -/**  
1001 - * @brief Flight status information topic data structure. It can be any value of ::E_ZiyanFcSubscriptionFlightStatus.  
1002 - */  
1003 -typedef uint8_t T_ZiyanFcSubscriptionFlightStatus;  
1004 -  
1005 -typedef uint8_t T_ZiyanFcSubscriptionDisplaymode;  
1006 -  
1007 -typedef uint8_t T_ZiyanFcSubscriptionLandinggear;  
1008 -  
1009 -typedef uint16_t T_ZiyanFcSubscriptionMotorStartError;  
1010 -  
1011 -typedef struct {  
1012 - uint32_t reserved: 12;  
1013 - uint32_t cellBreak: 5; /*!< 0: normal; other: under voltage core index(0x01-0x1F). */  
1014 - uint32_t selfCheckError: 3; /*!< enum-type: E_ZIYANFcSubscriptionBatterySelfCheck. */  
1015 - uint32_t reserved1: 7;  
1016 - uint32_t batteryClosedReason: 5; /*!< enum-type: E_ZIYANFcSubscriptionBatteryClosedReason. */  
1017 - uint8_t reserved2: 6; /*!< 0: CHG state; 1: DSG state; 2: ORING state. */  
1018 - uint8_t batSOHState: 2; /*!< enum-type: E_ZIYANFcSubscriptionBatterySohState. */  
1019 - uint8_t maxCycleLimit: 6; /*!< APP: cycle_limit*10. */  
1020 - uint8_t reserved3: 2;  
1021 - uint16_t lessBattery: 1;  
1022 - uint16_t batteryCommunicationAbnormal: 1;  
1023 - uint16_t reserved4: 3;  
1024 - uint16_t hasCellBreak: 1;  
1025 - uint16_t reserved5: 4;  
1026 - uint16_t isBatteryEmbed: 1; /*!< 0:embed; 1:not embed. */  
1027 - uint16_t heatState: 2; /*!< enum-type: E_ZIYANFcSubscriptionBatteryHeatState. */  
1028 - uint16_t socState: 3; /*!< enum-type: E_ZIYANFcSubscriptionBatterySocState. */  
1029 -} T_ZiyanFcSubscriptionSingleBatteryState;  
1030 -  
1031 -/**  
1032 - * @brief Battery information topic data structure.  
1033 - */  
1034 -typedef struct BatteryWholeInfo {  
1035 - uint32_t capacity; /*!< Battery capacity, unit: mAh. */  
1036 - int32_t voltage; /*!< Battery voltage, unit: mV. */  
1037 - int32_t current; /*!< Battery current, unit: mA. */  
1038 - uint8_t percentage; /*!< Battery capacity percentage, unit: 1%. */  
1039 -} T_ZiyanFcSubscriptionWholeBatteryInfo;  
1040 -  
1041 -typedef struct BatterySingleInfo {  
1042 - uint8_t reserve;  
1043 - uint8_t batteryIndex;  
1044 - int32_t currentVoltage; /*!< uint: mV. */  
1045 - int32_t currentElectric; /*!< uint: mA. */  
1046 - uint32_t fullCapacity; /*!< uint: mAh. */  
1047 - uint32_t remainedCapacity; /*!< uint: mAh. */  
1048 - int16_t batteryTemperature; /*!< uint: 0.1℃. */  
1049 - uint8_t cellCount;  
1050 - uint8_t batteryCapacityPercent; /*!< uint: %. */  
1051 - T_ZiyanFcSubscriptionSingleBatteryState batteryState;  
1052 - uint8_t reserve1;  
1053 - uint8_t reserve2;  
1054 - uint8_t SOP; /*!< Relative power percentage. */  
1055 -} T_ZiyanFcSubscriptionSingleBatteryInfo;  
1056 -  
1057 -/*!  
1058 - * @brief struct for TOPIC_CONTROL_DEVICE and data broadcast, return SDK info  
1059 - */  
1060 -typedef struct SDKCtrlInfo {  
1061 - union {  
1062 - /* Used by M300 & M350 */  
1063 - struct {  
1064 - uint8_t controlMode; /*!< enum-type: E_ZIYANFcSubscriptionControlMode. */  
1065 - uint8_t deviceStatus: 3; /*!< 0->rc 1->app 4->psdk */  
1066 - uint8_t flightStatus: 1; /*!< 1->open 0->closed */  
1067 - uint8_t vrcStatus: 1;  
1068 - uint8_t reserved: 3;  
1069 - };  
1070 -  
1071 - /* Used by other aircrafts */  
1072 - struct {  
1073 - uint8_t controlAuthority; /*!< enum-type: E_ZIYANFcSubscriptionControlAuthority. */  
1074 - uint8_t controlAuthorityChangeReason; /*!< enum-type: E_ZIYANFcSubscriptionAuthorityChangeReason. */  
1075 - };  
1076 - };  
1077 -} T_ZiyanFcSubscriptionControlDevice; // pack(1)  
1078 -  
1079 -/*!  
1080 - * @brief sub struct for TOPIC_HARD_SYNC  
1081 - */  
1082 -typedef struct SyncTimestamp {  
1083 - uint32_t time2p5ms; /*!< clock time in multiples of 2.5ms. Sync timer runs at  
1084 - 400Hz, this field increments in integer steps */  
1085 - uint32_t time1ns; /*!< nanosecond time offset from the 2.5ms pulse */  
1086 - uint32_t resetTime2p5ms; /*!< clock time in multiple of 2.5ms elapsed since the  
1087 - hardware sync started */  
1088 - uint16_t index; /*!< This is the tag field you filled out when using the  
1089 - setSyncFreq API above; use it to identify the packets that  
1090 - have sync data. This is useful when you call the  
1091 - setSyncFreq API with freqInHz = 0, so you get a single  
1092 - pulse that can be uniquely identified with a tag - allowing  
1093 - you to create your own pulse train with uniquely  
1094 - identifiable pulses. */  
1095 - uint8_t flag; /*!< This is true when the packet corresponds to a hardware  
1096 - pulse and false otherwise. This is useful because you can  
1097 - request the software packet to be sent at a higher frequency  
1098 - that the hardware line.*/  
1099 -} SyncTimestamp; // pack(1)  
1100 -  
1101 -/*!  
1102 - * @brief struct for TOPIC_HARD_SYNC  
1103 - */  
1104 -typedef struct HardSyncData {  
1105 - SyncTimestamp ts; /*!< time stamp for the incoming data */  
1106 - struct Quaternion q; /*!< quaternion */  
1107 - T_ZiyanVector3f a; /*!< accelerometer reading unit: g */  
1108 - T_ZiyanVector3f w; /*!< gyro reading unit: rad/sec */  
1109 -} T_ZiyanFcSubscriptionHardSync;  
1110 -  
1111 -typedef uint8_t T_ZiyanFcSubscriptionGpsControlLevel;  
1112 -  
1113 -/*!  
1114 - * @brief struct for TOPIC_RC_WITH_FLAG_DATA  
1115 - */  
1116 -typedef struct RCWithFlagData {  
1117 - ziyan_f32_t pitch; /*!< down = -0.999, middle = 0.000, up =0.999 */  
1118 - ziyan_f32_t roll; /*!< left = -0.999, middle = 0.000, right=0.999 */  
1119 - ziyan_f32_t yaw; /*!< left = -0.999, middle = 0.000, right=0.999 */  
1120 - ziyan_f32_t throttle; /*!< down = -0.999, middle = 0.000, up =0.999 */  
1121 - struct {  
1122 - uint8_t logicConnected: 1; /*!< 0 if sky or ground side is disconnected for 3 seconds */  
1123 - uint8_t skyConnected: 1; /*!< Sky side is connected, i.e., receiver is connected to FC */  
1124 - uint8_t groundConnected: 1; /*!< Ground side is connected, i.e., RC is on and connected to FC */  
1125 - uint8_t appConnected: 1; /*!< Mobile App is connected to RC */  
1126 - uint8_t reserved: 4;  
1127 - } flag;  
1128 -} T_ZiyanFcSubscriptionRCWithFlagData;  
1129 -  
1130 -/*!  
1131 - * @brief struct for status of each individual esc  
1132 - */  
1133 -typedef struct ESCStatusIndividual {  
1134 - int16_t current; /*!< ESC current, unit: mA */  
1135 - int16_t speed; /*!< ESC speed, unit: rpm */  
1136 - uint16_t voltage; /*!< Input power from battery to ESC, unit: mV */  
1137 - int16_t temperature; /*!< ESC temperature, unit: degree C */  
1138 - uint16_t stall: 1; /*!< Motor is stall */  
1139 - uint16_t empty: 1; /*!< Motor has no load */  
1140 - uint16_t unbalanced: 1; /*!< Motor speed is unbalanced */  
1141 - uint16_t escDisconnected: 1; /*!< ESC is disconnected */  
1142 - uint16_t temperatureHigh: 1; /*!< Temperature is high */  
1143 - uint16_t reserved: 11;  
1144 -} ESCStatusIndividual;  
1145 -  
1146 -/*!  
1147 - * @brief struct for TOPIC_ESC_DATA  
1148 - */  
1149 -typedef struct EscData {  
1150 - ESCStatusIndividual esc[8];  
1151 -} T_ZiyanFcSubscriptionEscData;  
1152 -  
1153 -/*!  
1154 - * @brief struct indicating RTK GPS Connection  
1155 - */  
1156 -typedef struct RTKConnectStatus {  
1157 - uint16_t rtkConnected: 1;  
1158 - uint16_t reserve: 15;  
1159 -} T_ZiyanFcSubscriptionRTKConnectStatus;  
1160 -  
1161 -typedef uint8_t T_ZiyanFcSubscriptionGimbalControlMode;  
1162 -  
1163 -/*!  
1164 - * @brief struct for TOPIC_FLIGHT_ANOMALY  
1165 - */  
1166 -typedef struct FlightAnomaly {  
1167 - uint32_t impactInAir: 1; /*!< 0: No impact, 1: Impact happens in Air */  
1168 - uint32_t randomFly: 1; /*!< 0: Normal, 1: Randomly fly in GPS mode without stick input*/  
1169 - uint32_t heightCtrlFail: 1; /*!< 0: Height control normal, 1: Height control failed */  
1170 - uint32_t rollPitchCtrlFail: 1; /*!< 0: Tilt control normal, 1: Tilt control failed */  
1171 - uint32_t yawCtrlFail: 1; /*!< 0: Yaw control normal, 1: Yaw control failed */  
1172 - uint32_t aircraftIsFalling: 1; /*!< 0: Aircraft is not falling, 1: Aircraft is falling */  
1173 - uint32_t strongWindLevel1: 1; /*!< 0: Wind is under big wind level 1, 1: wind is stronger than big wind level 1*/  
1174 - uint32_t strongWindLevel2: 1; /*!< 0: Wind is under big wind level 2, 1: wind is stronger than big wind level 2*/  
1175 - uint32_t compassInstallationError: 1; /*!< 0: Compass install right, 1: Compass install error */  
1176 - uint32_t imuInstallationError: 1; /*!< 0: IMU install right, 1: IMU install error */  
1177 - uint32_t escTemperatureHigh: 1; /*!< 0: ESC temperature is normal, 1: ESC temperature is high */  
1178 - uint32_t atLeastOneEscDisconnected: 1; /*!< 0: No ESC disconnected, 1: At least one ESC is disconnected */  
1179 - uint32_t gpsYawError: 1; /*!< 0: No GPS yaw error, 1: GPS yaw error */  
1180 - uint32_t reserved: 19;  
1181 -} T_ZiyanFcSubscriptionFlightAnomaly;  
1182 -  
1183 -/*!  
1184 - * @brief struct for TOPIC_POSITION_VO  
1185 - */  
1186 -typedef struct PositionVO {  
1187 - ziyan_f32_t x; /*!< North (best effort), unit: m */  
1188 - ziyan_f32_t y; /*!< East (best effort), unit: m */  
1189 - ziyan_f32_t z; /*!< Down, unit: m */  
1190 - uint8_t xHealth: 1;  
1191 - uint8_t yHealth: 1;  
1192 - uint8_t zHealth: 1;  
1193 - uint8_t reserved: 5;  
1194 -} T_ZiyanFcSubscriptionPositionVO;  
1195 -  
1196 -/*!  
1197 - * @brief struct for data broadcast and subscription, return obstacle info around the vehicle  
1198 - *  
1199 - */  
1200 -typedef struct RelativePosition {  
1201 - ziyan_f32_t down; /*!< distance from obstacle (m) */  
1202 - ziyan_f32_t front; /*!< distance from obstacle (m) */  
1203 - ziyan_f32_t right; /*!< distance from obstacle (m) */  
1204 - ziyan_f32_t back; /*!< distance from obstacle (m) */  
1205 - ziyan_f32_t left; /*!< distance from obstacle (m) */  
1206 - ziyan_f32_t up; /*!< distance from obstacle (m) */  
1207 - uint8_t downHealth: 1; /*!< Down sensor flag: 0 - not working, 1 - working */  
1208 - uint8_t frontHealth: 1; /*!< Front sensor flag: 0 - not working, 1 - working */  
1209 - uint8_t rightHealth: 1; /*!< Right sensor flag: 0 - not working, 1 - working */  
1210 - uint8_t backHealth: 1; /*!< Back sensor flag: 0 - not working, 1 - working */  
1211 - uint8_t leftHealth: 1; /*!< Left sensor flag: 0 - not working, 1 - working */  
1212 - uint8_t upHealth: 1; /*!< Up sensor health flag: 0 - not working, 1 - working */  
1213 - uint8_t reserved: 2; /*!< Reserved sensor health flag*/  
1214 -} T_ZiyanFcSubscriptionAvoidData;  
1215 -  
1216 -/**  
1217 - * @brief Struct for the topic ZIYAN_FC_SUBSCRIPTION_TOPIC_HOME_POINT_SET_STATUS. Specifies homepoint was set or not,  
1218 - * it can be any value of ::E_ZiyanFcSubscriptionHomePointSetStatus.  
1219 - */  
1220 -typedef uint8_t T_ZiyanFcSubscriptionHomePointSetStatus;  
1221 -  
1222 -/**  
1223 - * @brief Struct for the topic ZIYAN_FC_SUBSCRIPTION_TOPIC_HOME_POINT_INFO. Specifies homepoint.  
1224 - */  
1225 -typedef struct HomeLocationData {  
1226 - ziyan_f64_t latitude; /*!< unit: rad */  
1227 - ziyan_f64_t longitude; /*!< unit: rad */  
1228 -} T_ZiyanFcSubscriptionHomePointInfo; // pack(1)  
1229 -  
1230 -typedef struct GimbalSingleData {  
1231 - ziyan_f32_t roll;  
1232 - ziyan_f32_t pitch;  
1233 - ziyan_f32_t yaw;  
1234 -} GimbalAnglesData;  
1235 -  
1236 -/**  
1237 - * @brief Struct for the topic ZIYAN_FC_SUBSCRIPTION_TOPIC_THREE_GIMBAL_DATA. Used in M300  
1238 - */  
1239 -typedef struct GimbalThreeData {  
1240 - GimbalAnglesData anglesData[3];  
1241 -} T_ZiyanFcSubscriptionThreeGimbalData;  
1242 -  
1243 -/**  
1244 - * @brief Struct for the topic ZIYAN_FC_SUBSCRIPTION_TOPIC_IMU_ATTI_NAVI_DATA_WITH_TIMESTAMP. Used in M300  
1245 - */  
1246 -typedef struct ImuAttiNaviDataWithTimestamp {  
1247 - uint16_t version;  
1248 - uint16_t flag;  
1249 - ziyan_f32_t pn_x;  
1250 - ziyan_f32_t pn_y;  
1251 - ziyan_f32_t pn_z;  
1252 - ziyan_f32_t vn_x;  
1253 - ziyan_f32_t vn_y;  
1254 - ziyan_f32_t vn_z;  
1255 - ziyan_f32_t an_x;  
1256 - ziyan_f32_t an_y;  
1257 - ziyan_f32_t an_z;  
1258 - ziyan_f32_t q[4];  
1259 - uint16_t resv;  
1260 - uint16_t cnt;  
1261 - uint32_t timestamp;  
1262 -} T_ZiyanFcSubscriptionImuAttiNaviDataWithTimestamp;  
1263 -  
1264 -#pragma pack()  
1265 -  
1266 -/* Exported functions --------------------------------------------------------*/  
1267 -/**  
1268 - * @brief Initialise data subscription module in blocking mode. This function has to be called before subscribing any  
1269 - * data, to initialize run environment of data subscription module, if need to subscribe data from aircraft.  
1270 - * @note Max execution time of this function is slightly larger than 500ms.  
1271 - * @note This function has to be called in user task, rather than main() function, and after scheduler being started.  
1272 - * @return Execution result.  
1273 - */  
1274 -T_ZiyanReturnCode ZiyanFcSubscription_Init(void);  
1275 -  
1276 -/**  
1277 - * @brief Deinitialize data subscription module. When data subscription will no longer be used, can call this function  
1278 - * to deinitialize the data subscription module. Deinitialization function will help to release all system resource data  
1279 - * subscription has occupied.  
1280 - * @return Execution result.  
1281 - */  
1282 -T_ZiyanReturnCode ZiyanFcSubscription_DeInit(void);  
1283 -  
1284 -/**  
1285 - * @brief Subscribe a topic in blocking mode. Before subscribing any data from aircraft, ZiyanFcSubscription_Init()  
1286 - * function has to be called.  
1287 - * @details User can subscribe a topic by specifying topic name, push frequency and callback function used to receive  
1288 - * data of topic (if needed). After subscribing successfully, the user can call  
1289 - * ZiyanFcSubscription_GetLatestValueOfTopic() function to get the latest data of the topic have been  
1290 - * subscribed and the corresponding timestamp when aircraft sends the data out, and the callback function will be called to  
1291 - * push data of the topic and corresponding timestamp if the callback function is specified.  
1292 - * @note Max execution time of this function is slightly larger than 1200ms.  
1293 - * @note Topic to be subscribed can not have been subscribed, that is, one topic can not be subscribed repeatedly.  
1294 - * @note User must ensure that types of subscription frequency of all topics have been subscribed is less than or  
1295 - * equal to 4. Otherwise, the subscribing topic will fail.  
1296 - * @note User must ensure that the data length sum of all topics of the same subscription frequency is less than or equal to 242.  
1297 - * @param topic: topic name to be subscribed.  
1298 - * @param frequency: subscription frequency of topic to be subscribed. Subscription frequency can not beyond max  
1299 - * frequency limitation of the topic and must be the value of enum E_ZiyanFcSubscriptionTopicFreq. And, subscription  
1300 - * frequency has to be larger than 0. Users can find max frequency of topics in data subscription part of documentation  
1301 - * on developer website (developer.ziyan.com).  
1302 - * @param callback: callback function used to receive data of topic to be subscribed. If the callback function is not needed,  
1303 - * this item can be set as NULL.  
1304 - * @return Execution result.  
1305 - */  
1306 -T_ZiyanReturnCode ZiyanFcSubscription_SubscribeTopic(E_ZiyanFcSubscriptionTopic topic,  
1307 - E_ZiyanDataSubscriptionTopicFreq frequency,  
1308 - ZiyanReceiveDataOfTopicCallback callback);  
1309 -  
1310 -/**  
1311 - * @brief Unsubscribe a topic in blocking mode. Before unsubscribing any data from aircraft, ZiyanFcSubscription_Init()  
1312 - * and ZiyanFcSubscription_SubscribeTopic() function has to be called,  
1313 - * @details User can unsubscribe a topic by specifying topic name, but the topic must be unsubscribed in the order of subscription.  
1314 - * @note Topic to be unsubscribed must have been subscribed.  
1315 - * @note Topic to be unsubscribed must be in the order of subscription, similar to a queue, subscription is similar to enqueue,  
1316 - * unsubscription is similar to dequeue.  
1317 - * @param topic: topic name to be unsubscribed.  
1318 - * @return Execution result.  
1319 - */  
1320 -T_ZiyanReturnCode ZiyanFcSubscription_UnSubscribeTopic(E_ZiyanFcSubscriptionTopic topic);  
1321 -  
1322 -/**  
1323 - * @brief Get the latest data value and timestamp in aircraft time system when sending the data from aircraft of specified  
1324 - * topic. If the specified topic has not been subscribed successfully, this function will return the error code.  
1325 - * @note After calling this function, user need transfer type of data pointer that pointer to data of topic to  
1326 - * corresponding data structure pointer for getting every item of the topic conveniently.  
1327 - * @param topicName: topic name to be gotten value.  
1328 - * @param data: pointer to memory space used to store data of the topic. The memory space used to store data of topic  
1329 - * have to have been allocated correctly and should ensure its size is equal to data structure size corresponding to  
1330 - * the topic, otherwise, this function will not be able to return data and timestamp (return error code).  
1331 - * @param dataSizeOfTopic: the size of memory space used to store data of topic. Normally, this size is equal to data  
1332 - * structure size corresponding to the topic. If this size is not equal to the size of the memory space, may cause memory  
1333 - * overflow event  
1334 - * @param timestamp: pointer to memory space used to store timestamps. The memory space used to store timestamps  
1335 - * have to have been allocated correctly, and should ensure its size is equal to data structure size of timestamp,  
1336 - * otherwise, this function will not be able to return data and timestamp (return error code) or even cause memory  
1337 - * overflow event. If the user does not need timestamp information, can fill in NULL. Use flight controller power-on  
1338 - * timestamp on M300 RTK. Use payload local timestamp on M30/M30T.  
1339 - * @return Execution result.  
1340 - */  
1341 -T_ZiyanReturnCode ZiyanFcSubscription_GetLatestValueOfTopic(E_ZiyanFcSubscriptionTopic topic,  
1342 - uint8_t *data, uint16_t dataSizeOfTopic,  
1343 - T_ZiyanDataTimestamp *timestamp);  
1344 -#ifdef __cplusplus  
1345 -}  
1346 -#endif  
1347 -  
1348 -#endif // ZIYAN_FC_SUBSCRIPTION_H  
1349 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_flight_controller.h  
4 - * @brief This is the header file for "ziyan_flight_controller.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_FLIGHT_CONTROLLER_H  
28 -#define ZIYAN_FLIGHT_CONTROLLER_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -#define EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH 10 /*!< Max length of emergency stop motor message. */  
39 -  
40 -/* Exported types ------------------------------------------------------------*/  
41 -typedef uint16_t E_ZiyanFlightControllerGoHomeAltitude; /*!< Unit:meter, range 20~500 */  
42 -  
43 -/**  
44 - * @brief The aircraft's actions when RC is lost.  
45 - */  
46 -typedef enum {  
47 - ZIYAN_FLIGHT_CONTROLLER_RC_LOST_ACTION_HOVER = 0, /*!< Aircraft will execute hover action when RC is lost. */  
48 - ZIYAN_FLIGHT_CONTROLLER_RC_LOST_ACTION_LANDING = 1, /*!< Aircraft will execute land action when RC is lost. */  
49 - ZIYAN_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME = 2, /*!< Aircraft will execute go-home action when RC is lost. */  
50 -} E_ZiyanFlightControllerRCLostAction;  
51 -  
52 -/**  
53 - * @brief Enable/Disable RTK position enum  
54 - */  
55 -typedef enum {  
56 - ZIYAN_FLIGHT_CONTROLLER_DISABLE_RTK_POSITION = 0, /*!< 0: The aircraft will use GPS data instead of RTK data to execute  
57 - * actions which requires location information(waypoint, go home...)  
58 - */  
59 - ZIYAN_FLIGHT_CONTROLLER_ENABLE_RTK_POSITION = 1, /*!< 1:The aircraft will use RTK data instead of GPS data to execute  
60 - * actions which requires location information(waypoint, go home...)*/  
61 -} E_ZiyanFlightControllerRtkPositionEnableStatus;  
62 -  
63 -/**  
64 - * @brief Enable/Disable obstacle sensing enum  
65 - */  
66 -typedef enum {  
67 - ZIYAN_FLIGHT_CONTROLLER_DISABLE_OBSTACLE_AVOIDANCE = 0, /*!< 0: The aircraft will not perform obstacle sensing in  
68 - * the specified direction */  
69 - ZIYAN_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE = 1, /*!< 0: The aircraft will perform obstacle sensing in the  
70 - * specified direction */  
71 -} E_ZiyanFlightControllerObstacleAvoidanceEnableStatus;  
72 -  
73 -/**  
74 - * @brief Enable/Disable emergency stop motor function enum  
75 - * @note Enable emergency-stop-motor function is very dangerous in the air. It will make the aircraft crash!!!  
76 - */  
77 -typedef enum {  
78 - ZIYAN_FLIGHT_CONTROLLER_ENABLE_EMERGENCY_STOP_MOTOR = 0x01, /*!< Execute emergency-stop-motor action */  
79 -} E_ZiyanFlightControllerEmergencyStopMotor;  
80 -  
81 -/**  
82 - * @brief Obtain/Release joystick control permission command enum  
83 - * @note You have obtained joystick control permission successfully before using joystick.  
84 - */  
85 -typedef enum {  
86 - ZIYAN_FLIGHT_CONTROLLER_RELEASE_JOYSTICK_CTRL_AUTHORITY = 0, /*!< Obtain joystick permission */  
87 - ZIYAN_FLIGHT_CONTROLLER_OBTAIN_JOYSTICK_CTRL_AUTHORITY = 1, /*!< Release joystick permission */  
88 -} E_ZiyanFlightControllerJoystickCtrlAuthorityAction;  
89 -  
90 -/**  
91 - * @brief The aircraft's joystick control permission owner enum  
92 - */  
93 -typedef enum {  
94 - ZIYAN_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_RC = 0, /*!< RC could control aircraft with joystick. */  
95 - ZIYAN_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_MSDK = 1, /*!< MSDK could control aircraft with joystick. */  
96 - ZIYAN_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_INTERNAL = 2, /*!< Special Internal modules could control aircraft  
97 - * with joystick. */  
98 - ZIYAN_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_OSDK = 4, /*!< PSDK could control aircraft with joystick. */  
99 -} E_ZiyanFlightControllerJoystickCtrlAuthority;  
100 -  
101 -/**  
102 - * @brief The aircraft's joystick control permission switch reason enum  
103 - */  
104 -typedef enum {  
105 - ZIYAN_FLIGHT_CONTROLLER_MSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 1, /*!< MSDK gets the joystick control permission. */  
106 - ZIYAN_FLIGHT_CONTROLLER_INTERNAL_GET_JOYSTICK_CTRL_AUTH_EVENT = 2, /*!< A specific internal modules gets the joystick control permission. */  
107 - ZIYAN_FLIGHT_CONTROLLER_OSDK_GET_JOYSTICK_CTRL_AUTH_EVENT = 3, /*!< PSDK gets the joystick control permission. */  
108 - ZIYAN_FLIGHT_CONTROLLER_RC_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 4, /*!< Reset the joystick control permission to RC when executing RC lost action */  
109 - ZIYAN_FLIGHT_CONTROLLER_RC_NOT_P_MODE_RESET_JOYSTICK_CTRL_AUTH_EVENT = 5, /*!< Reset the joystick control permission to RC when RC is not in P mode */  
110 - ZIYAN_FLIGHT_CONTROLLER_RC_SWITCH_MODE_GET_JOYSTICK_CTRL_AUTH_EVENT = 6, /*!< Set the joystick control permission to RC when RC switches control mode(T/APS) */  
111 - ZIYAN_FLIGHT_CONTROLLER_RC_PAUSE_GET_JOYSTICK_CTRL_AUTH_EVENT = 7, /*!< Reset the joystick control permission to RC when RC pauses */  
112 - ZIYAN_FLIGHT_CONTROLLER_RC_REQUEST_GO_HOME_GET_JOYSTICK_CTRL_AUTH_EVENT = 8, /*!< Reset the joystick control permission to RC when RC requests to go home*/  
113 - ZIYAN_FLIGHT_CONTROLLER_LOW_BATTERY_GO_HOME_RESET_JOYSTICK_CTRL_AUTH_EVENT = 9, /*!< Reset the joystick control permission to RC when aircraft is executing low-battery-go-home*/  
114 - ZIYAN_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT = 10, /*!< Reset the joystick control permission to RC when aircraft is executing low-battery-landing*/  
115 - ZIYAN_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT = 11, /*!< Reset the joystick control permission to RC when PSDK is lost*/  
116 - ZIYAN_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT = 12, /*!< Reset the joystick control permission to RC when aircraft is near boundary.*/  
117 -} E_ZiyanFlightControllerJoystickCtrlAuthoritySwitchEvent;  
118 -  
119 -/**  
120 - * @brief The aircraft's joystick control permission switch event info enum  
121 - */  
122 -typedef struct {  
123 - E_ZiyanFlightControllerJoystickCtrlAuthority curJoystickCtrlAuthority; /*!< The aircraft's joystick control permission owner */  
124 - E_ZiyanFlightControllerJoystickCtrlAuthoritySwitchEvent joystickCtrlAuthoritySwitchEvent; /*!< The aircraft's joystick control permission switch reason */  
125 -} T_ZiyanFlightControllerJoystickCtrlAuthorityEventInfo;  
126 -  
127 -/**  
128 - * @brief Prototype of callback function used to get joystick control permission switch event info.  
129 - * @return Execution result.  
130 - */  
131 -typedef T_ZiyanReturnCode (*JoystickCtrlAuthorityEventCbFunc)(  
132 - T_ZiyanFlightControllerJoystickCtrlAuthorityEventInfo eventData);  
133 -  
134 -/**  
135 - * @brief Prototype of callback function used to get the trigger FTS event.  
136 - * @return Execution result.  
137 - */  
138 -typedef T_ZiyanReturnCode (*TriggerFtsEventCallback)(void);  
139 -  
140 -/**  
141 - * @brief Horizon control mode in joystick mode enum  
142 - * @note Only when the GPS signal is good (health_flag >=3),horizontal position control (ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE)  
143 - * related control modes can be used. Only when GPS signal is good (health_flag >=3),or advanced sensing system is working properly with Autopilot,  
144 - * horizontal velocity control(ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE) related control modes can be used.  
145 - */  
146 -typedef enum {  
147 - /**  
148 - * @brief Control pitch & roll & angle of the aircraft.  
149 - * @note Need to be referenced to either the ground or body frame by E_ZiyanFlightControllerHorizontalCoordinate setting.  
150 - * Limit: -35 degree to 35 degree  
151 - */  
152 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_ANGLE_CONTROL_MODE = 0,  
153 - /**  
154 - * @brief Set the control mode to control horizontal vehicle velocities.  
155 - * @note Need to be referenced to either the ground or body frame by E_ZiyanFlightControllerHorizontalCoordinate setting  
156 - * Limit: -30m/s to 30 m/s  
157 - */  
158 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE = 1,  
159 - /**  
160 - * @brief Set the control mode to control position offsets of pitch & roll directions.  
161 - * @note Need to be referenced to either the ground or body frame by E_ZiyanFlightControllerHorizontalCoordinate setting  
162 - * Limit: N/A  
163 - */  
164 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE = 2,  
165 - /**  
166 - * @brief Set the control mode to control rate of change of the vehicle's attitude.  
167 - * @note Need to be referenced to either the ground or body frame by E_ZiyanFlightControllerHorizontalCoordinate setting  
168 - * Limit: -150deg/s to 150.0 deg/s  
169 - */  
170 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_ANGULAR_RATE_CONTROL_MODE = 3  
171 -} E_ZiyanFlightControllerHorizontalControlMode;  
172 -  
173 -/**  
174 - * @brief Vertical control mode enum in joystick mode  
175 - * @note We don not recommend using VERTICAL_POSITION control mode indoors when the aircraft's flying height exceeds 3 meters.  
176 - * This is because barometer can be inaccurate indoors, and the vertical controller may fail to keep the height of the aircraft.  
177 - */  
178 -typedef enum {  
179 - /**  
180 - * @brief Set the control mode to control the vertical speed of aircraft, setting the upward as positive/  
181 - * @note Limit: -5 m/s to 5 m/s  
182 - */  
183 - ZIYAN_FLIGHT_CONTROLLER_VERTICAL_VELOCITY_CONTROL_MODE = 0,  
184 -  
185 - /**  
186 - * @brief Set the control mode to control the height of aircraft  
187 - * @note Limit: 0 m to 120 m  
188 - */  
189 - ZIYAN_FLIGHT_CONTROLLER_VERTICAL_POSITION_CONTROL_MODE = 1,  
190 -  
191 - /**  
192 - * @brief Set the control mode to directly control the thrust  
193 - * @note Range: 0 % to 100 %  
194 - */  
195 - ZIYAN_FLIGHT_CONTROLLER_VERTICAL_THRUST_CONTROL_MODE = 2,  
196 -} E_ZiyanFlightControllerVerticalControlMode;  
197 -  
198 -/**  
199 - * @brief Yaw control mode enum in joystick mode  
200 - */  
201 -typedef enum {  
202 - /**  
203 - * @brief Set the control mode to control yaw angle.  
204 - * @note Yaw angle is referenced to the ground frame. In this control mode, Ground frame is enforced in Autopilot.  
205 - */  
206 - ZIYAN_FLIGHT_CONTROLLER_YAW_ANGLE_CONTROL_MODE = 0x00,  
207 -  
208 - /**  
209 - * @brief Set the control-mode to control yaw angular velocity  
210 - * @note Same reference frame as YAW_ANGLE.  
211 - * Limit: -150 deg/s to 150 deg/s  
212 - */  
213 - ZIYAN_FLIGHT_CONTROLLER_YAW_ANGLE_RATE_CONTROL_MODE = 1  
214 -} E_ZiyanFlightControllerYawControlMode;  
215 -  
216 -/**  
217 - * @brief Horizontal coordinate enum in joystick mode  
218 - */  
219 -typedef enum {  
220 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_GROUND_COORDINATE = 0, /*!< Set the x-y of ground frame as the horizontal frame (NEU) */  
221 - ZIYAN_FLIGHT_CONTROLLER_HORIZONTAL_BODY_COORDINATE = 1 /*!< Set the x-y of body frame as the horizontal frame (FRU) */  
222 -} E_ZiyanFlightControllerHorizontalCoordinate;  
223 -  
224 -/*!  
225 - * @brief Stable mode enum in joystick mode  
226 - * @note Only works in horizontal velocity control mode. In velocity stable mode, aircraft will brake and hover at one position once  
227 - * the input command is zero. In velocity non-stable mode, aircraft will follow the velocity command and not hover when the command is zero.  
228 - * That means aircraft will drift with the wind.  
229 - */  
230 -typedef enum {  
231 - ZIYAN_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_DISABLE = 0, /*!< Disable the stable mode */  
232 - ZIYAN_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_ENABLE = 1 /*!< Enable the stable mode */  
233 -} E_ZiyanFlightControllerStableControlMode;  
234 -  
235 -typedef enum {  
236 - ZIYAN_FLIGHT_CONTROLLER_ENABLE_RC_LOST_ACTION = 0,  
237 - ZIYAN_FLIGHT_CONTROLLER_DISABLE_RC_LOST_ACTION = 1,  
238 -} E_ZiyanFlightControllerRCLostActionEnableStatus;  
239 -  
240 -/**  
241 - * @brief Joystick mode.  
242 - * @note You need to set joystick mode first before start to send joystick command to aircraft.  
243 - */  
244 -typedef struct {  
245 - E_ZiyanFlightControllerHorizontalControlMode horizontalControlMode; /*!< See reference of E_ZiyanFlightControllerHorizontalControlMode*/  
246 - E_ZiyanFlightControllerVerticalControlMode verticalControlMode; /*!< See reference of E_ZiyanFlightControllerVerticalControlMode*/  
247 - E_ZiyanFlightControllerYawControlMode yawControlMode; /*!< See reference of E_ZiyanFlightControllerYawControlMode*/  
248 - E_ZiyanFlightControllerHorizontalCoordinate horizontalCoordinate; /*!< See reference of E_ZiyanFlightControllerHorizontalCoordinate*/  
249 - E_ZiyanFlightControllerStableControlMode stableControlMode; /*!< See reference of E_ZiyanFlightControllerStableControlMode*/  
250 -} T_ZiyanFlightControllerJoystickMode;  
251 -  
252 -#pragma pack(1)  
253 -typedef struct {  
254 - ziyan_f32_t x; /*!< Controls the x axis.*/  
255 - ziyan_f32_t y; /*!< Controls the y axis.*/  
256 - ziyan_f32_t z; /*!< Controls the z axis, setting upward as positive. */  
257 - ziyan_f32_t yaw; /*!< Yaw position/velocity control w.r.t. the ground frame.*/  
258 -} T_ZiyanFlightControllerJoystickCommand;// pack(1)  
259 -  
260 -typedef struct {  
261 - ziyan_f64_t latitude; /*!< unit: rad */  
262 - ziyan_f64_t longitude; /*!< unit: rad */  
263 -} T_ZiyanFlightControllerHomeLocation; // pack(1)  
264 -  
265 -typedef struct {  
266 - char serialNum[32];  
267 -} T_ZiyanFlightControllerGeneralInfo;  
268 -  
269 -typedef struct {  
270 - ziyan_f64_t latitude; /*!< unit: rad */  
271 - ziyan_f64_t longitude; /*!< unit: rad */  
272 - uint16_t altitude;  
273 -} T_ZiyanFlightControllerRidInfo;  
274 -  
275 -#pragma pack()  
276 -  
277 -/* Exported functions --------------------------------------------------------*/  
278 -/**  
279 - * @brief Initialise flight controller module  
280 - * @param ridInfo: Must report the correct RID information before using PSDK to control the aircraft.  
281 - * @return Execution result.  
282 - */  
283 -T_ZiyanReturnCode ZiyanFlightController_Init(T_ZiyanFlightControllerRidInfo ridInfo);  
284 -  
285 -/**  
286 - * @brief DeInitialise flight controller module.  
287 - * @return Execution result.  
288 - */  
289 -T_ZiyanReturnCode ZiyanFlightController_DeInit(void);  
290 -  
291 -/**  
292 - * @brief Enable/Disable RTK position function.  
293 - * @details Enabling RTK means that RTK data will be used instead of GPS during flight.  
294 - * @param rtkEnableStatus: refer to "E_ZiyanFlightControllerRtkPositionEnableStatus", inheriting from Pilot.  
295 - * @return Execution result.  
296 - */  
297 -T_ZiyanReturnCode  
298 -ZiyanFlightController_SetRtkPositionEnableStatus(E_ZiyanFlightControllerRtkPositionEnableStatus rtkEnableStatus);  
299 -  
300 -/**  
301 - * @brief Get RTK enable status.  
302 - * @note Enabling RTK means that RTK data will be used during intelligent flight.  
303 - * @param rtkEnableStatus: refer to "E_ZiyanFlightControllerRtkPositionEnableStatus", inheriting from Pilot.  
304 - * @return Execution result.  
305 - */  
306 -T_ZiyanReturnCode  
307 -ZiyanFlightController_GetRtkPositionEnableStatus(E_ZiyanFlightControllerRtkPositionEnableStatus *rtkEnableStatus);  
308 -  
309 -/**  
310 - * @brief Set RC lost action.  
311 - * @note Valid when RC and PSDK are both lost. It only supports M30.  
312 - * @param rcLostAction: actions when RC is lost.(hover/landing/go home).It inherits from Pilot's param.  
313 - * @return Execution result.  
314 - */  
315 -T_ZiyanReturnCode ZiyanFlightController_SetRCLostAction(E_ZiyanFlightControllerRCLostAction rcLostAction);  
316 -  
317 -/**  
318 - * @brief Get RC lost action(hover/landing/gohome).  
319 - * @note Valid when RC and PSDK are both lost. It only supports M30.  
320 - * @param rcLostAction: see reference of E_ZiyanFlightControllerRCLostAction.It inherits from Pilot's param.  
321 - * @return Execution result.  
322 - */  
323 -T_ZiyanReturnCode ZiyanFlightController_GetRCLostAction(E_ZiyanFlightControllerRCLostAction *rcLostAction);  
324 -  
325 -/**  
326 - * @brief Enable/Disable horizontal visual(forwards,backwards,left,right) obstacle sensing.  
327 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
328 - * https://www.ziyan.com.  
329 - * @param horizontalObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
330 - * It inherits from Pilot's param.  
331 - * @return Execution result.  
332 - */  
333 -T_ZiyanReturnCode ZiyanFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus(  
334 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);  
335 -  
336 -/**  
337 - * @brief Get the switch status of horizontal visual(forwards,backwards,left,right) obstacle sensing.  
338 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
339 - * https://www.ziyan.com.  
340 - * @param horizontalObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
341 - * It inherits from Pilot's param.  
342 - * @return Execution result.  
343 - */  
344 -T_ZiyanReturnCode ZiyanFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus(  
345 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);  
346 -  
347 -/**  
348 - * @brief Enable/Disable horizontal radar obstacle sensing.  
349 - * @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing,  
350 - * it is recommended to read the official user manual in https://www.ziyan.com.  
351 - * @param horizontalObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
352 - * It inherits from Pilot's param.  
353 - * @return Execution result.  
354 - */  
355 -T_ZiyanReturnCode ZiyanFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus(  
356 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus horizontalObstacleAvoidanceEnableStatus);  
357 -  
358 -/**  
359 - * @brief Get the switch status of horizontal radar obstacle sensing.  
360 - * @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing,  
361 - * it is recommended to read the official user manual in https://www.ziyan.com/uk/matrice-300/downloads.  
362 - * @param horizontalObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
363 - * It inherits from Pilot's param.  
364 - * @return Execution result.  
365 - */  
366 -T_ZiyanReturnCode ZiyanFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus(  
367 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus *horizontalObstacleAvoidanceEnableStatus);  
368 -  
369 -/**  
370 - * @brief Enable/Disable upwards visual obstacle sensing.  
371 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
372 - * https://www.ziyan.com.  
373 - * @param upwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
374 - * It inherits from Pilot's param.  
375 - * @return Execution result.  
376 - */  
377 -T_ZiyanReturnCode ZiyanFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus(  
378 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);  
379 -  
380 -/**  
381 - * @brief Get the switch status of upwards visual obstacle sensing.  
382 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
383 - * https://www.ziyan.com.  
384 - * @param upwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
385 - * It inherits from Pilot's param.  
386 - * @return Execution result.  
387 - */  
388 -T_ZiyanReturnCode ZiyanFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus(  
389 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);  
390 -  
391 -/**  
392 - * @brief Enable/Disable upwards radar obstacle sensing.  
393 - * @note It will be valid only if you install CSM radar successfully.For detailed parameters of obstacle sensing,  
394 - * it is recommended to read the official user manual in https://www.ziyan.com.  
395 - * @param upwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
396 - * It inherits from Pilot's param.  
397 - * @return Execution result.  
398 - */  
399 -T_ZiyanReturnCode ZiyanFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus(  
400 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus upwardsObstacleAvoidanceEnableStatus);  
401 -  
402 -/**  
403 - * @brief Get the switch status of upwards radar obstacle sensing.  
404 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
405 - * https://www.ziyan.com.  
406 - * @param upwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
407 - * It inherits from Pilot's param.  
408 - * @return Execution result.  
409 - */  
410 -T_ZiyanReturnCode ZiyanFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus(  
411 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus *upwardsObstacleAvoidanceEnableStatus);  
412 -  
413 -/**  
414 - * @brief Enable/Disable downwards visual obstacle sensing.  
415 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
416 - * https://www.ziyan.com.  
417 - * @param downwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
418 - * It inherits from Pilot's param.  
419 - * @return Execution result.  
420 - */  
421 -T_ZiyanReturnCode ZiyanFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus(  
422 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus downwardsObstacleAvoidanceEnableStatus);  
423 -  
424 -/**  
425 - * @brief Get the switch status of downwards visual obstacle sensing.  
426 - * @note For detailed parameters of obstacle sensing, it is recommended to read the official user manual in  
427 - * https://www.ziyan.com.  
428 - * @param downwardsObstacleAvoidanceEnableStatus: see reference of E_ZiyanFlightControllerObstacleAvoidanceEnableStatus.  
429 - * It inherits from Pilot's param.  
430 - * @return Execution result.  
431 - */  
432 -T_ZiyanReturnCode ZiyanFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus(  
433 - E_ZiyanFlightControllerObstacleAvoidanceEnableStatus *downwardsObstacleAvoidanceEnableStatus);  
434 -  
435 -/**  
436 - * @brief Arrest flying means emergency braking  
437 - * @note When the aircraft is on the ground, it will stop motors and display "hms description" on App. when the aircraft is  
438 - * in the air, it will continue flying and display "hms description" on App only.  
439 - * If you use this interface, you need to use "ZiyanFlightController_CancelArrestFlying" to quit arrest-flying status, then  
440 - * then the aircraft can fly again.  
441 - * @return Execution result.  
442 - */  
443 -T_ZiyanReturnCode ZiyanFlightController_ArrestFlying(void);  
444 -  
445 -/**  
446 - * @brief Quit status of arrest-flying.  
447 - * @note The aircraft need to quit status of arrest-flying to continue flying after arresting flying.  
448 - * @return Execution result.  
449 - */  
450 -T_ZiyanReturnCode ZiyanFlightController_CancelArrestFlying(void);  
451 -  
452 -/**  
453 - * @brief Turn on motors when the aircraft is on the ground.  
454 - * @return Execution result.  
455 - */  
456 -T_ZiyanReturnCode ZiyanFlightController_TurnOnMotors(void);  
457 -  
458 -/**  
459 - * @brief Turn off motors when the aircraft is on the ground.  
460 - * @return Execution result.  
461 - */  
462 -T_ZiyanReturnCode ZiyanFlightController_TurnOffMotors(void);  
463 -  
464 -/**  
465 - * @brief Emergency stop motor in any case.  
466 - * @note If you want to turn on motor after emergency stopping motor, you need to use the interface to send disable  
467 - * command to quit lock-motor status.  
468 - * @param cmd: see reference of E_ZiyanFlightControllerEmergencyStopMotor  
469 - * @param debugMsg:inject debug message to flight control FW for logging, size limit: 10 bytes  
470 - * @return Execution result.  
471 - */  
472 -T_ZiyanReturnCode ZiyanFlightController_EmergencyStopMotor(E_ZiyanFlightControllerEmergencyStopMotor cmd,  
473 - char debugMsg[EMERGENCY_STOP_MOTOR_MSG_MAX_LENGTH]);  
474 -/**  
475 - * @brief Request taking off action when the aircraft is on the ground.  
476 - * @return Execution result.  
477 - */  
478 -T_ZiyanReturnCode ZiyanFlightController_StartTakeoff(void);  
479 -  
480 -/**  
481 - * @brief Request landing action when the aircraft is in the air.  
482 - * @return Execution result.  
483 - */  
484 -T_ZiyanReturnCode ZiyanFlightController_StartLanding(void);  
485 -  
486 -/**  
487 - * @brief Request cancelling landing action when the aircraft is landing  
488 - * @return Execution result.  
489 - */  
490 -T_ZiyanReturnCode ZiyanFlightController_CancelLanding(void);  
491 -  
492 -/**  
493 - * @brief Confirm the landing when the aircraft is 0.7 m above the ground.  
494 - * @note When the clearance between the aircraft and the ground is less than 0.7m, the aircraft will pause landing and  
495 - * wait for user's confirmation. This API is for confirm landing. If the ground is not suitable for landing, user  
496 - * must use RC to control it landing manually or force landing.  
497 - * @return Execution result.  
498 - */  
499 -T_ZiyanReturnCode ZiyanFlightController_StartConfirmLanding(void);  
500 -  
501 -/**  
502 - * @brief Force landing in any case.  
503 - * @note This API will ignore the smart landing function. When using this API, it will landing directly (would not stop  
504 - * at 0.7m and wait user's command). Attention: it may make the aircraft crash!!!  
505 - * @return Execution result.  
506 - */  
507 -T_ZiyanReturnCode ZiyanFlightController_StartForceLanding(void);  
508 -  
509 -/**  
510 - * @brief Set customized GPS(not RTK) home location.  
511 - * @note Set customized home location failed reason may as follows:  
512 - * 1. The distance between new home location and last home location is larger than MAX_FLY_RADIUS(20 km).  
513 - * 2. Record initial home location failed after start aircraft.  
514 - * @param homeLocation: homeLocation include latitude and longitude  
515 - * @return Execution result.  
516 - */  
517 -T_ZiyanReturnCode ZiyanFlightController_SetHomeLocationUsingGPSCoordinates(T_ZiyanFlightControllerHomeLocation homeLocation);  
518 -  
519 -/**  
520 - * @brief Set home location using current aircraft GPS (not RTK) location.  
521 - * @note Set home location failed reasons may as follows:  
522 - * 1. Aircraft's gps level can't reach the condition of recording home location.  
523 - * 2. Record initial home location failed after start aircraft.  
524 - * @return Execution result.  
525 - */  
526 -T_ZiyanReturnCode ZiyanFlightController_SetHomeLocationUsingCurrentAircraftLocation(void);  
527 -  
528 -/**  
529 - * @brief Set go home altitude.  
530 - * @note If aircraft's current altitude is higher than the setting value of go home altitude, aircraft will go home  
531 - * using current altitude. Otherwise, it will climb to setting of go home altitude ,and then execute go home action.  
532 - * Go home altitude setting is 20-1500 m.  
533 - * @param altitude: go home altitude, unit: meter  
534 - * @return Execution result.  
535 - */  
536 -T_ZiyanReturnCode ZiyanFlightController_SetGoHomeAltitude(E_ZiyanFlightControllerGoHomeAltitude altitude);  
537 -  
538 -/**  
539 - * @brief Get go home altitude.  
540 - * @param altitude: go home altitude, unit: meter  
541 - * @return Execution result.  
542 - */  
543 -T_ZiyanReturnCode ZiyanFlightController_GetGoHomeAltitude(E_ZiyanFlightControllerGoHomeAltitude *altitude);  
544 -  
545 -/**  
546 - * @brief Get country code.  
547 - * @param countryCode: Pointer of buffer to return country code. The country code indicates the current country or  
548 - * region where the aircraft is located. Please refer to the ISO 3166-1 code table for the specific meaning of the  
549 - * country code.  
550 - * @return Execution result.  
551 - */  
552 -T_ZiyanReturnCode ZiyanFlightController_GetCountryCode(uint16_t *countryCode);  
553 -  
554 -/**  
555 - * @brief Request go home action when the aircraft is in the air  
556 - * @return Execution result.  
557 - */  
558 -T_ZiyanReturnCode ZiyanFlightController_StartGoHome(void);  
559 -  
560 -/**  
561 - * @brief Request cancel go home action when the aircraft is going home  
562 - * @return Execution result.  
563 - */  
564 -T_ZiyanReturnCode ZiyanFlightController_CancelGoHome(void);  
565 -  
566 -/**  
567 - * @brief Obtain aircraft's joystick control permission.  
568 - * @note 1.You have to obtain joystick control permission successfully before you using joystick to control aircraft.  
569 - * 2. RC must be in p-mode.  
570 - * @return Execution result.  
571 - */  
572 -T_ZiyanReturnCode ZiyanFlightController_ObtainJoystickCtrlAuthority(void);  
573 -  
574 -/**  
575 - * @brief Release aircraft's joystick control permission.  
576 - * @note RC must be in p-mode.  
577 - * @return Execution result.  
578 - */  
579 -T_ZiyanReturnCode ZiyanFlightController_ReleaseJoystickCtrlAuthority(void);  
580 -  
581 -/**  
582 - * @brief Subscribe to joystick control permission switch event with a callback function.  
583 - * @note it will be triggered once the joystick control permission switch event occurs.  
584 - * @return Execution result.  
585 - */  
586 -T_ZiyanReturnCode ZiyanFlightController_RegJoystickCtrlAuthorityEventCallback(JoystickCtrlAuthorityEventCbFunc callback);  
587 -  
588 -/**  
589 - * @brief Set expected joystick mode before requesting joystick.  
590 - * @param joystickMode: include horizontal/vertical/yaw control mode, stable control mode.  
591 - */  
592 -void ZiyanFlightController_SetJoystickMode(T_ZiyanFlightControllerJoystickMode joystickMode);  
593 -  
594 -/**  
595 - * @brief Request execute joystick action.  
596 - * @param joystickCommand: include x/y/z/yaw.  
597 - * @return Execution result.  
598 - */  
599 -T_ZiyanReturnCode ZiyanFlightController_ExecuteJoystickAction(T_ZiyanFlightControllerJoystickCommand joystickCommand);  
600 -  
601 -/**  
602 - * @brief Request emergency brake action.  
603 - * @return Execution result.  
604 - */  
605 -T_ZiyanReturnCode ZiyanFlightController_ExecuteEmergencyBrakeAction(void);  
606 -  
607 -/**  
608 - * @brief Request cancel emergency brake action.  
609 - * @note It is only support on M30.If you use ZiyanFlightController_ExecuteEmergencyBrakeAction(), you need to use  
610 - * "ZiyanFlightController_CancelEmergencyBrakeAction()" to allow aircraft to execute aircraft action again.  
611 - * @return Execution result.  
612 - */  
613 -T_ZiyanReturnCode ZiyanFlightController_CancelEmergencyBrakeAction(void);  
614 -  
615 -/**  
616 - * @brief Get general info of the aircraft.  
617 - * @param generalInfo: the struct stored the serial num which contains a array of chars var in case the user gives an  
618 - * illegal length character pointer  
619 - * @return Execution result.  
620 - */  
621 -T_ZiyanReturnCode ZiyanFlightController_GetGeneralInfo(T_ZiyanFlightControllerGeneralInfo *generalInfo);  
622 -  
623 -/*! @brief The command decides whether execute RC lost action or not when PSDK is running  
624 - * @note This setting only affects the behavior of the aircraft when the RC lost and the PSDK is connected.  
625 - * if the command is enable, the aircraft will not execute RC lost action when RC is lost but PSDK is running;  
626 - * if the command is disable, the aircraft will execute RC lost action when RC is lost but PSDK is running  
627 - * the aircraft will execute RC lost action when RC is lost and PSDK is lost whatever the command is.  
628 - * default command is disable.  
629 - * @param executeRCLostActionOrNotWhenOnboardOn enable:1;disable:0  
630 - * @return T_ZiyanReturnCode error code  
631 - */  
632 -T_ZiyanReturnCode  
633 -ZiyanFlightController_SetRCLostActionEnableStatus(E_ZiyanFlightControllerRCLostActionEnableStatus command);  
634 -  
635 -/*! @brief get RC lost action enable status(enable or disable)  
636 - * @param command executeRCLostActionOrNotWhenOnboardOn, enable:1;disable:0  
637 - * @return T_ZiyanReturnCode error code  
638 - */  
639 -T_ZiyanReturnCode  
640 -ZiyanFlightController_GetEnableRCLostActionStatus(E_ZiyanFlightControllerRCLostActionEnableStatus *command);  
641 -  
642 -/**  
643 - * @brief Register callback function for the trigger FTS event.  
644 - * @note The timing of the trigger of the callback function of the FTS is determined by the aircraft, and the trigger  
645 - * execution action of the FTS needs to be implemented in the callback function and the correct return value  
646 -* must be returned, otherwise the aircraft will always be triggered.  
647 - * @param callback: the callback for the trigger FTS event.  
648 - * @return Execution result.  
649 - */  
650 -T_ZiyanReturnCode ZiyanFlightController_RegTriggerFtsEventCallback(TriggerFtsEventCallback callback);  
651 -  
652 -#ifdef __cplusplus  
653 -}  
654 -#endif  
655 -  
656 -#endif // ZIYAN_FLIGHT_CONTROLLER_H  
657 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_gimbal.h  
4 - * @brief ZIYAN gimbal module is used to achieve the third gimbal for developer. The module can be used only when the ZIYAN  
5 - * adapter is Skyport, rather than XPort.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_GIMBAL_H  
28 -#define ZIYAN_GIMBAL_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -  
40 -/* Exported types ------------------------------------------------------------*/  
41 -/**  
42 - * @brief Gimbal calibration stage and result.  
43 - */  
44 -typedef enum {  
45 - ZIYAN_GIMBAL_CALIBRATION_STAGE_COMPLETE = 0, /*!< Calibration have been completed and the result is successful. */  
46 - ZIYAN_GIMBAL_CALIBRATION_STAGE_PROCRESSING = 1, /*!< Gimbal is calibrating. */  
47 - ZIYAN_GIMBAL_CALIBRATION_STAGE_FAILED = 3, /*!< Calibration have been completed and the result is failure. */  
48 -} E_ZiyanGimbalCalibrationStage;  
49 -  
50 -/**  
51 - * @brief Axis of gimbal.  
52 - */  
53 -typedef enum {  
54 - ZIYAN_GIMBAL_AXIS_PITCH = 0, /*!< Pitch axis. */  
55 - ZIYAN_GIMBAL_AXIS_ROLL = 1, /*!< Roll axis. */  
56 - ZIYAN_GIMBAL_AXIS_YAW = 2, /*!< Yaw axis. */  
57 -} E_ZiyanGimbalAxis;  
58 -  
59 -/**  
60 - * @brief Reset mode of gimbal.  
61 - */  
62 -typedef enum {  
63 - /*! Only reset yaw axis of gimbal. Reset angle of yaw axis to the sum of yaw axis angle of aircraft and fine tune angle  
64 - * of yaw axis of gimbal. */  
65 - ZIYAN_GIMBAL_RESET_MODE_YAW = 1,  
66 - /*! Reset yaw axis and pitch axis of gimbal. Reset angle of yaw axis to sum of yaw axis angle of aircraft and fine tune  
67 - * angle of yaw axis of gimbal, and reset pitch axis angle to the fine tune angle. */  
68 - ZIYAN_GIMBAL_RESET_MODE_PITCH_AND_YAW = 3,  
69 - /*! Reset only pitch axis of gimbal. */  
70 - ZIYAN_GIMBAL_RESET_MODE_PITCH_ONLY = 4,  
71 - /*! Reset only roll axis of gimbal. */  
72 - ZIYAN_GIMBAL_RESET_MODE_ROLL_ONLY = 5,  
73 - /*! Reset only yaw axis of gimbal. */  
74 - ZIYAN_GIMBAL_RESET_MODE_YAW_ONLY = 6,  
75 - /*! Reset yaw axis and pitch axis of gimbal. Reset angle of yaw axis to sum of yaw axis angle of aircraft and fine tune  
76 - * angle of yaw axis of gimbal, and reset pitch axis angle to sum of -90 degree and fine tune angle if gimbal  
77 - * downward, sum of 90 degree and fine tune angle if upward. */  
78 - ZIYAN_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD_AND_YAW = 11,  
79 - /*! Reset pitch axis of gimbal. Reset pitch axis angle to sum of -90 degree and fine tune angle if gimbal downward,  
80 - * sum of 90 degree and fine tune angle if upward. */  
81 - ZIYAN_GIMBAL_RESET_MODE_PITCH_DOWNWARD_UPWARD = 12,  
82 -} E_ZiyanGimbalResetMode;  
83 -  
84 -/**  
85 - * @brief Smooth factor of gimbal controller.  
86 - */  
87 -typedef struct {  
88 - uint8_t pitch; /*!< Smooth factor of pitch axis, range from 0 to 30. */  
89 - uint8_t yaw; /*!< Smooth factor of yaw axis, range from 0 to 30. */  
90 -} T_ZiyanGimbalControllerSmoothFactor;  
91 -  
92 -/**  
93 - * @brief Max speed percentage of every axis of gimbal.  
94 - */  
95 -typedef struct {  
96 - uint8_t pitch; /*!< Max speed percentage of pitch axis, range from 1 to 100. */  
97 - uint8_t yaw; /*!< Max speed percentage of yaw axis, range from 1 to 100. */  
98 -} T_ZiyanGimbalControllerMaxSpeedPercentage;  
99 -  
100 -/**  
101 - * @brief Data structure describes gimbal system state.  
102 - */  
103 -typedef struct {  
104 - bool resettingFlag; /*!< Specifies whether gimbal is resetting now or not. */  
105 - bool mountedUpward; /*!< Specifies whether gimbal is upward or not. */  
106 - bool blockingFlag; /*!< Specifies whether gimbal is stuck or not. */  
107 - bool pitchRangeExtensionEnabledFlag; /*!< Specifies whether extended angle range of gimbal pitch axis is enabled or not. */  
108 - E_ZiyanGimbalMode gimbalMode; /*!< Gimbal mode. */  
109 - T_ZiyanAttitude3d fineTuneAngle; /*!< Fine tune angles, unit: 0.1 degree. */  
110 - T_ZiyanGimbalControllerSmoothFactor smoothFactor; /*!< Smooth factor of gimbal controller. */  
111 - T_ZiyanGimbalControllerMaxSpeedPercentage maxSpeedPercentage; /*!< Max speed percentage of gimbal controller. */  
112 -} T_ZiyanGimbalSystemState;  
113 -  
114 -/**  
115 - * @brief Reach limit flag.  
116 - */  
117 -typedef struct {  
118 - bool pitch; /*!< Specifies whether gimbal has reached angle limit of pitch axis, if true, reached the limit. */  
119 - bool roll; /*!< Specifies whether gimbal has reached angle limit of roll axis, if true, reached the limit. */  
120 - bool yaw; /*!< Specifies whether gimbal has reached angle limit of yaw axis, if true, reached the limit. */  
121 -} T_ZiyanGimbalReachLimitFlag;  
122 -  
123 -/**  
124 - * @brief Gimbal attitude related information.  
125 - */  
126 -typedef struct {  
127 - T_ZiyanAttitude3d attitude; /*!< Gimbal attitude in the ground coordinate, unit: 0.1 degree. */  
128 - T_ZiyanGimbalReachLimitFlag reachLimitFlag; /*!< Reach limit flag, being set when the joint angles of gimbal reach limits. */  
129 -} T_ZiyanGimbalAttitudeInformation;  
130 -  
131 -/**  
132 - * @brief Gimbal calibration state.  
133 - */  
134 -typedef struct {  
135 - bool calibratingFlag; /*!< Specifies whether gimbal is calibrating now or not. */  
136 - bool lastCalibrationResult; /*!< Result of the last calibration, and true specifies success. */  
137 - 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. */  
138 - E_ZiyanGimbalCalibrationStage currentCalibrationStage; /*!< Current calibration stage and result. If gimbal is calibrating now and fill in ::ZIYAN_GIMBAL_CALIBRATION_STAGE_PROCRESSING, if not, fill in result of the last calibration. */  
139 -} T_ZiyanGimbalCalibrationState;  
140 -  
141 -/**  
142 - * @brief Gimbal rotation command property.  
143 - */  
144 -typedef struct {  
145 - struct {  
146 - bool pitch; /*!< Specifies whether ignore rotation command of pitch axis, and true specifies ignoring. */  
147 - bool roll; /*!< Specifies whether ignore rotation command of roll axis, and true specifies ignoring. */  
148 - bool yaw; /*!< Specifies whether ignore rotation command of yaw axis, and true specifies ignoring. */  
149 - } rotationValueInvalidFlag; /*!< Specifies whether ignore rotation command of some axis, including pitch, roll and yaw. */  
150 -  
151 - union {  
152 - struct {  
153 - uint16_t actionTime; /*!< Action time during which gimbal move to target angles, unit: 0.01s. */  
154 - } relativeAngleRotation; /*!< Property of relative angle rotation command. */  
155 - struct {  
156 - uint16_t actionTime; /*!< Action time during which gimbal move to target angles, unit: 0.01s. */  
157 - /*! Joint angle valid flag, specifying whether  
158 - * T_ZiyanGimbalRotationProperty::absoluteAngleRotation::jointAngle is valid when absolute angle control. */  
159 - bool jointAngleValid;  
160 - /*! Joint angles of gimbal, unit: 0.1 degree. If  
161 - * T_ZiyanGimbalRotationProperty::absoluteAngleRotation::jointAngleValid is false, specifying here joint  
162 - * angles are invalid, and please ignore the joint angles. If joint angles are valid, users should ensure  
163 - * that target joint angles of gimbal is approximately the same as the specified value. */  
164 - T_ZiyanAttitude3d jointAngle;  
165 - } absoluteAngleRotation; /*!< Property of absolute angle rotation command. */  
166 - };  
167 -} T_ZiyanGimbalRotationProperty;  
168 -  
169 -/**  
170 - * @brief Common handler function prototypes of gimbal, that is, some common callback function prototypes of gimbal.  
171 - * @warning User can not execute blocking style operations or functions in callback function, because that will block ZIYAN  
172 - * root thread, causing problems such as slow system response, payload disconnection or infinite loop.  
173 - */  
174 -typedef struct {  
175 - /*!  
176 - * @brief Prototype of callback function used to report system state of gimbal.  
177 - * @param systemState: pointer to memory space used to store gimbal system state.  
178 - * @return Execution result.  
179 - */  
180 - T_ZiyanReturnCode (*GetSystemState)(T_ZiyanGimbalSystemState *systemState);  
181 -  
182 - /*!  
183 - * @brief Prototype of callback function used to report attitude information of gimbal.  
184 - * @param attitudeInformation: pointer to memory space used to store gimbal attitude information.  
185 - * @return Execution result.  
186 - */  
187 - T_ZiyanReturnCode (*GetAttitudeInformation)(T_ZiyanGimbalAttitudeInformation *attitudeInformation);  
188 -  
189 - /*!  
190 - * @brief Prototype of callback function used to report calibration state of gimbal.  
191 - * @param calibrationState: pointer to memory space used to store gimbal calibration state.  
192 - * @return Execution result.  
193 - */  
194 - T_ZiyanReturnCode (*GetCalibrationState)(T_ZiyanGimbalCalibrationState *calibrationState);  
195 -  
196 - /*!  
197 - * @brief Prototype of callback function used to rotate gimbal. Rotation callback function will be called when  
198 - * other modules control gimbal.  
199 - * @warning User should control execution time of the callback function to be short, because this callback function  
200 - * may be called at very high frequency in some scenarios, just like 200Hz.  
201 - * @param rotationMode: mode of rotation command.  
202 - * @param rotationProperty: property of rotation command.  
203 - * @param rotationValue: value of rotation command, unit: 0.1 degree (if rotation mode is  
204 - * ::ZIYAN_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE or ::ZIYAN_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE), 0.1 degree/s  
205 - * (if rotation mode is ::ZIYAN_GIMBAL_ROTATION_MODE_SPEED).  
206 - * @return Execution result.  
207 - */  
208 - T_ZiyanReturnCode (*Rotate)(E_ZiyanGimbalRotationMode rotationMode, T_ZiyanGimbalRotationProperty rotationProperty,  
209 - T_ZiyanAttitude3d rotationValue);  
210 -  
211 - /*!  
212 - * @brief Prototype of callback function used to start calibrating gimbal.  
213 - * @note Maximum allowable time of gimbal calibration is 120s. If gimbal has not completed calibration during  
214 - * 120s, ZIYAN Pilot believe calibration failed.  
215 - * @return Execution result.  
216 - */  
217 - T_ZiyanReturnCode (*StartCalibrate)(void);  
218 -  
219 - /**  
220 - * @brief Set smooth factor for gimbal controller, using to smooth control.  
221 - * @param smoothingFactor: smooth factor. The larger the value, the smaller the acceleration of gimbal. Recommended  
222 - * calculation formula is "acc = 10000 * (0.8 ^ (1 + x)) deg/s^2", x is smooth factor. Range from 0 to 30.  
223 - * @param axis: axis to be set.  
224 - * @return Execution result.  
225 - */  
226 - T_ZiyanReturnCode (*SetControllerSmoothFactor)(uint8_t smoothingFactor, E_ZiyanGimbalAxis axis);  
227 -  
228 - /*!  
229 - * @brief Prototype of callback function used to enable or disable extended pitch axis angle range.  
230 - * @details Switching the gimbal limit euler angle of pitch axis to the extended limit angle or the default limit  
231 - * angle.  
232 - * @param enabledFlag: flag specified whether enable or disable extended pitch axis angle range.  
233 - * @return Execution result.  
234 - */  
235 - T_ZiyanReturnCode (*SetPitchRangeExtensionEnabled)(bool enabledFlag);  
236 -  
237 - /**  
238 - * @brief Set max speed percentage for gimbal controller.  
239 - * @param maxSpeedPercentage: max speed value. Recommended calculation formula is "spd = default_max_spd * x / 100",  
240 - * x is default max speed value. Range from 1 to 100.  
241 - * @param axis: axis to be set.  
242 - * @return Execution result.  
243 - */  
244 - T_ZiyanReturnCode (*SetControllerMaxSpeedPercentage)(uint8_t maxSpeedPercentage, E_ZiyanGimbalAxis axis);  
245 -  
246 - /**  
247 - * @brief Restore factory settings of gimbal, including fine tune angle, pitch angle extension enable flag and max  
248 - * speed etc.  
249 - * @return Execution result.  
250 - */  
251 - T_ZiyanReturnCode (*RestoreFactorySettings)(void);  
252 -  
253 - /*!  
254 - * @brief Prototype of callback function used to set gimbal work mode.  
255 - * @param mode: gimbal work mode.  
256 - * @return Execution result.  
257 - */  
258 - T_ZiyanReturnCode (*SetMode)(E_ZiyanGimbalMode mode);  
259 -  
260 - /*!  
261 - * @brief Prototype of callback function used to reset gimbal.  
262 - * @note Reset command will interrupt rotation process.  
263 - * @param mode: Reset mode.  
264 - * @return Execution result.  
265 - */  
266 - T_ZiyanReturnCode (*Reset)(E_ZiyanGimbalResetMode mode);  
267 -  
268 - /*!  
269 - * @brief Prototype of callback function used to fine tune angle of gimbal.  
270 - * @param fineTuneAngle: fine tune angle, unit: 0.1 degree. Angle value of greater than 0 specifies rotation  
271 - * towards the positive direction of body coordinate.  
272 - * @return Execution result.  
273 - */  
274 - T_ZiyanReturnCode (*FineTuneAngle)(T_ZiyanAttitude3d fineTuneAngle);  
275 -  
276 - /**  
277 - * @brief Prototype of callback function used to report rotation speed of gimbal.  
278 - * @note The callback function will be called at 50 Hz. Developers should ensure that, the average rotation speed  
279 - * of gimbal within 20 ms after the callback function is called is approximately equal to the reported rotation  
280 - * speed.  
281 - * @param rotationSpeed: pointer to memory space used to store rotation speed, in body coordinate, unit:  
282 - * 0.1 degree/s.  
283 - * @return Execution result.  
284 - */  
285 - T_ZiyanReturnCode (*GetRotationSpeed)(T_ZiyanAttitude3d *rotationSpeed);  
286 -  
287 - /**  
288 - * @brief Prototype of callback function used to report joint angle of gimbal.  
289 - * @param jointAngle: pointer to memory space used to store joint angles, unit: 0.1 degree.  
290 - * @return Execution result.  
291 - */  
292 - T_ZiyanReturnCode (*GetJointAngle)(T_ZiyanAttitude3d *jointAngle);  
293 -} T_ZiyanGimbalCommonHandler;  
294 -  
295 -/* Exported functions --------------------------------------------------------*/  
296 -/**  
297 - * @brief Initialise gimbal module, and user should call this function before using gimbal features.  
298 - * @return Execution result.  
299 - */  
300 -T_ZiyanReturnCode ZiyanGimbal_Init(void);  
301 -  
302 -/**  
303 - * @brief Deinitialise gimbal module.  
304 - * @return Execution result.  
305 - */  
306 -T_ZiyanReturnCode ZiyanGimbal_DeInit(void);  
307 -  
308 -/**  
309 - * @brief Register common handler functions/callback functions of gimbal. After registering, callback functions will be  
310 - * called automatically.  
311 - * @param commonHandler: pointer to common handler functions of gimbal.  
312 - * @return Execution result.  
313 - */  
314 -T_ZiyanReturnCode ZiyanGimbal_RegCommonHandler(const T_ZiyanGimbalCommonHandler *commonHandler);  
315 -  
316 -#ifdef __cplusplus  
317 -}  
318 -#endif  
319 -  
320 -#endif // ZIYAN_GIMBAL_H  
321 -  
322 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_gimbal_manager.h  
4 - * @brief This is the header file for "ziyan_gimbal_manager.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_GIMBAL_MANAGER_H  
28 -#define ZIYAN_GIMBAL_MANAGER_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include <ziyan_gimbal.h>  
32 -#include "ziyan_typedef.h"  
33 -  
34 -#ifdef __cplusplus  
35 -extern "C" {  
36 -#endif  
37 -  
38 -/* Exported constants --------------------------------------------------------*/  
39 -  
40 -/* Exported types ------------------------------------------------------------*/  
41 -/**  
42 - * @brief Gimbal manager rotation command property.  
43 - */  
44 -typedef struct {  
45 - E_ZiyanGimbalRotationMode rotationMode; /*!< Rotation gimbal mode. */  
46 - ziyan_f32_t pitch; /*!< Pitch angle in degree, unit: deg */  
47 - ziyan_f32_t roll; /*!< Roll angle in degree, unit: deg */  
48 - ziyan_f32_t yaw; /*!< Yaw angle in degree, unit: deg */  
49 - ziyan_f64_t time; /*!< Expected execution time for gimbal rotation, in seconds. */  
50 -} T_ZiyanGimbalManagerRotation;  
51 -  
52 -/* Exported functions --------------------------------------------------------*/  
53 -/**  
54 - * @brief Initialize the gimbal manager module.  
55 - * @note This interface must be initialized after ZiyanCore_Init.  
56 - * @return Execution result.  
57 - */  
58 -T_ZiyanReturnCode ZiyanGimbalManager_Init(void);  
59 -  
60 -/**  
61 - * @brief DeInitialize the gimbal manager module.  
62 - * @return Execution result.  
63 - */  
64 -T_ZiyanReturnCode ZiyanGimbalManager_Deinit(void);  
65 -  
66 -/**  
67 - * @brief Set the work mode of the gimbal.  
68 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
69 - * @param mode: gimbal work mode, input limit see enum E_ZiyanGimbalMode  
70 - * @return Execution result.  
71 - */  
72 -T_ZiyanReturnCode ZiyanGimbalManager_SetMode(E_ZiyanMountPosition mountPosition, E_ZiyanGimbalMode mode);  
73 -  
74 -/**  
75 - * @brief Reset the pitch and yaw of the gimbal.  
76 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
77 - * @param mode: reset mode, input limit see enum E_ZiyanGimbalResetMode  
78 - * @return Execution result.  
79 - */  
80 -T_ZiyanReturnCode ZiyanGimbalManager_Reset(E_ZiyanMountPosition mountPosition, E_ZiyanGimbalResetMode resetMode);  
81 -  
82 -/**  
83 - * @brief Rotate the angle of the gimbal.  
84 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
85 - * @param rotation: the rotation parameters to be executed on the target gimbal, including the rotation mode, target  
86 - * angle value and executed time, refer to T_ZiyanGimbalManagerRotation  
87 - * @return Execution result.  
88 - */  
89 -T_ZiyanReturnCode ZiyanGimbalManager_Rotate(E_ZiyanMountPosition mountPosition, T_ZiyanGimbalManagerRotation rotation);  
90 -  
91 -/*!  
92 - * @brief Prototype of callback function used to enable or disable extended pitch axis angle range.  
93 - * @note Switching the gimbal limit euler angle of pitch axis to the extended limit angle or the default limit  
94 - * angle.  
95 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
96 - * @param enabledFlag: flag specifying whether to enable or disable the extended pitch axis angle range..  
97 - * @return Execution result.  
98 - */  
99 -T_ZiyanReturnCode ZiyanGimbalManager_SetPitchRangeExtensionEnabled(E_ZiyanMountPosition mountPosition, bool enabledFlag);  
100 -  
101 -/**  
102 - * @brief Set max speed percentage for gimbal controller.  
103 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
104 - * @param axis: axis to be set.  
105 - * @param maxSpeedPercentage: max speed value. Recommended calculation formula is "spd = default_max_spd * x / 100",  
106 - * where 'x' is the default maximum speed value. Range from 1 to 100.  
107 - * @return Execution result.  
108 - */  
109 -T_ZiyanReturnCode ZiyanGimbalManager_SetControllerMaxSpeedPercentage(E_ZiyanMountPosition mountPosition, E_ZiyanGimbalAxis axis,  
110 - uint8_t maxSpeedPercentage);  
111 -  
112 -/**  
113 - * @brief Set smooth factor for gimbal controller, using for smooth control.  
114 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
115 - * @param axis: axis to be set.  
116 - * @param smoothingFactor: smooth factor. A larger value results in slower gimbal acceleration. Recommended  
117 - * calculation formula is "acc = 10000 * (0.8 ^ (1 + x)) deg/s^2", x is smooth factor. Range from 0 to 30.  
118 - * @return Execution result.  
119 - */  
120 -T_ZiyanReturnCode ZiyanGimbalManager_SetControllerSmoothFactor(E_ZiyanMountPosition mountPosition, E_ZiyanGimbalAxis axis,  
121 - uint8_t smoothingFactor);  
122 -  
123 -/**  
124 - * @brief Restore factory settings of gimbal, including fine tune angle, pitch angle extension enable flag and max  
125 - * speed etc.  
126 - * @param mountPosition: gimbal mount position, input limit see enum E_ZiyanMountPosition  
127 - * @return Execution result.  
128 - */  
129 -T_ZiyanReturnCode ZiyanGimbalManager_RestoreFactorySettings(E_ZiyanMountPosition mountPosition);  
130 -  
131 -#ifdef __cplusplus  
132 -}  
133 -#endif  
134 -  
135 -#endif // ZIYAN_GIMBAL_MANAGER_H  
136 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -  
2 -/**  
3 - ********************************************************************  
4 - * @file ziyan_high_speed_data_channel.h  
5 - * @brief This is the header file for "ziyan_high_speed_data_channel.c", defining the structure and  
6 - * (exported) function prototypes.  
7 - *  
8 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
9 - *  
10 - * All information contained herein is, and remains, the property of ZIYAN.  
11 - * The intellectual and technical concepts contained herein are proprietary  
12 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
13 - * and protected by trade secret or copyright law. Dissemination of this  
14 - * information, including but not limited to data and other proprietary  
15 - * material(s) incorporated within the information, in any form, is strictly  
16 - * prohibited without the express written consent of ZIYAN.  
17 - *  
18 - * If you receive this source code without ZIYAN’s authorization, you may not  
19 - * further disseminate the information, and you must immediately remove the  
20 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
21 - * legal actions against you for any loss(es) or damage(s) caused by your  
22 - * failure to do so.  
23 - *  
24 - *********************************************************************  
25 - */  
26 -  
27 -/* Define to prevent recursive inclusion -------------------------------------*/  
28 -#ifndef ZIYAN_HIGH_SPEED_DATA_CHANNEL_H  
29 -#define ZIYAN_HIGH_SPEED_DATA_CHANNEL_H  
30 -  
31 -/* Includes ------------------------------------------------------------------*/  
32 -#include "ziyan_typedef.h"  
33 -  
34 -#ifdef __cplusplus  
35 -extern "C" {  
36 -#endif  
37 -  
38 -/* Exported constants --------------------------------------------------------*/  
39 -  
40 -/* Exported types ------------------------------------------------------------*/  
41 -typedef struct {  
42 - uint8_t dataStream; /*!< Bandwidth proportion of data stream, range from 0 to 100. */  
43 - uint8_t videoStream; /*!< Bandwidth proportion of video stream, range from 0 to 100. */  
44 - uint8_t downloadStream; /*!< Bandwidth proportion of download stream, range from 0 to 100. */  
45 -} T_ZiyanDataChannelBandwidthProportionOfHighspeedChannel;  
46 -  
47 -/* Exported functions --------------------------------------------------------*/  
48 -/**  
49 - * @brief Set bandwidth proportion for the data stream, video stream and download stream of high-speed channel.  
50 - * @details Self-defined bandwidth distribution mechanism allows that user can control bandwidth limitation  
51 - * freely. System multiplies total bandwidth limitation of the high-speed channel by a proportion of the corresponding stream to  
52 - * get realtime bandwidth limitation of the specified stream. Realtime bandwidth limitation of data and video stream can be  
53 - * gotten by PsdkDataTransmission_GetDataStreamState() and PsdkPayloadCamera_GetVideoStreamState() interfaces. Total  
54 - * bandwidth of the high-speed channel is determined by the environment in which the system located and loading of system. If  
55 - * user does not set bandwidth proportion for each stream, the default proportion is 33% (data stream), 33% (video  
56 - * stream) and 34% (download stream).  
57 - * @note The bandwidth proportion will be effective after a while, the max value is 1s. If you want use this interface, should calling  
58 - * PsdkPlatform_RegHalNetworkHandler interface firstly, otherwise this interface will not work.  
59 - * @param bandwidthProportion: bandwidth proportion of each stream of high-speed channel. The Sum of bandwidth proportion  
60 - * must equal 100.  
61 - * @return Execution result.  
62 - */  
63 -T_ZiyanReturnCode ZiyanHighSpeedDataChannel_SetBandwidthProportion(  
64 - T_ZiyanDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion);  
65 -  
66 -/**  
67 - * @brief Get the network remote address for sending data stream.  
68 - * @note The interface is used to get the network remote address for sending data stream. You can get this info for another  
69 - * heterogeneous system to do somethings. This interface should be used after calling PsdkCore_Init function.  
70 - * @param ipAddr: the remote ip address for sending data stream.  
71 - * @param port: the remote port for sending data stream.  
72 - * @return Execution result.  
73 - */  
74 -T_ZiyanReturnCode ZiyanHighSpeedDataChannel_GetDataStreamRemoteAddress(char *ipAddr, uint16_t *port);  
75 -  
76 -/**  
77 - * @brief Send data to mobile end via data stream of the data channel.  
78 - * @note This function can be used only in Linux operating system.  
79 - * @note Must ensure actual bandwidth is less than bandwidth limitation of corresponding channel or stream, please  
80 - * refer to developer documentation and state of channel/stream for details related to bandwidth limitation. User can  
81 - * get state of "dataStream" channel via PsdkDataTransmission_GetDataStreamState() function. If actual bandwidth  
82 - * exceeds the limitation or busy state is set, the user should stop transmitting data or decrease amount of data to be  
83 - * sent. Otherwise, data may be discarded.  
84 - * @param data: pointer to data to be sent.  
85 - * @param len: length of data to be sent via data stream, and it must be less than or equal to 65000, unit: byte.  
86 - * @return Execution result.  
87 - */  
88 -T_ZiyanReturnCode ZiyanHighSpeedDataChannel_SendDataStreamData(const uint8_t *data, uint16_t len);  
89 -  
90 -/**  
91 - * @brief Get data transmission state of "dataStream" channel. User can use the state as base for controlling data  
92 - * transmission of data stream. This function exists and can be used only in Linux operation system.  
93 - * @param state: pointer to "dataStream" channel state.  
94 - * @return Execution result.  
95 - */  
96 -T_ZiyanReturnCode ZiyanHighSpeedDataChannel_GetDataStreamState(T_ZiyanDataChannelState *state);  
97 -  
98 -#ifdef __cplusplus  
99 -}  
100 -#endif  
101 -  
102 -#endif // ZIYAN_HIGH_SPEED_DATA_CHANNEL_H  
103 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_hms.h  
4 - * @brief This is the header file for "ziyan_hms.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2021 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_HMS_H  
28 -#define ZIYAN_HMS_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -#include "ziyan_hms_customization.h"  
33 -#include "ziyan_hms_manager.h"  
34 -  
35 -#ifdef __cplusplus  
36 -extern "C" {  
37 -#endif  
38 -  
39 -/* Exported constants --------------------------------------------------------*/  
40 -  
41 -/* Exported types ------------------------------------------------------------*/  
42 -  
43 -/* Exported functions --------------------------------------------------------*/  
44 -  
45 -#ifdef __cplusplus  
46 -}  
47 -#endif  
48 -  
49 -#endif // ZIYAN_HMS_H  
50 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/  
1 -/**  
2 - ********************************************************************  
3 - * @file ziyan_hms_customization.h  
4 - * @brief This is the header file for "ziyan_hms_customization.c", defining the structure and  
5 - * (exported) function prototypes.  
6 - *  
7 - * @copyright (c) 2018 ZIYAN. All rights reserved.  
8 - *  
9 - * All information contained herein is, and remains, the property of ZIYAN.  
10 - * The intellectual and technical concepts contained herein are proprietary  
11 - * to ZIYAN and may be covered by U.S. and foreign patents, patents in process,  
12 - * and protected by trade secret or copyright law. Dissemination of this  
13 - * information, including but not limited to data and other proprietary  
14 - * material(s) incorporated within the information, in any form, is strictly  
15 - * prohibited without the express written consent of ZIYAN.  
16 - *  
17 - * If you receive this source code without ZIYAN’s authorization, you may not  
18 - * further disseminate the information, and you must immediately remove the  
19 - * source code and notify ZIYAN of its removal. ZIYAN reserves the right to pursue  
20 - * legal actions against you for any loss(es) or damage(s) caused by your  
21 - * failure to do so.  
22 - *  
23 - *********************************************************************  
24 - */  
25 -  
26 -/* Define to prevent recursive inclusion -------------------------------------*/  
27 -#ifndef ZIYAN_HMS_CUSTOMIZATION_H  
28 -#define ZIYAN_HMS_CUSTOMIZATION_H  
29 -  
30 -/* Includes ------------------------------------------------------------------*/  
31 -#include "ziyan_typedef.h"  
32 -  
33 -#ifdef __cplusplus  
34 -extern "C" {  
35 -#endif  
36 -  
37 -/* Exported constants --------------------------------------------------------*/  
38 -  
39 -/* Exported types ------------------------------------------------------------*/  
40 -typedef enum {  
41 - ZIYAN_HMS_ERROR_LEVEL_NONE = 0,  
42 - ZIYAN_HMS_ERROR_LEVEL_HINT,  
43 - ZIYAN_HMS_ERROR_LEVEL_WARN,  
44 - ZIYAN_HMS_ERROR_LEVEL_CRITICAL,  
45 - ZIYAN_HMS_ERROR_LEVEL_FATAL,  
46 -} E_ZiyanHmsErrorLevel;  
47 -  
48 -typedef struct {  
49 - char *fileName; /*!< The file name of the hms text config file */  
50 - uint32_t fileSize; /*!< The file size of the hms text config file, uint : byte */  
51 - const uint8_t *fileBinaryArray; /*!< The binary C array of the hms text config file */  
52 -} T_ZiyanHmsFileBinaryArray;  
53 -  
54 -typedef struct {  
55 - uint16_t binaryArrayCount; /*!< Binary array count. */  
56 - T_ZiyanHmsFileBinaryArray *fileBinaryArrayList; /*!< Pointer to binary array list */  
57 -} T_ZiyanHmsBinaryArrayConfig;  
58 -  
59 -  
60 -/* Exported functions --------------------------------------------------------*/  
61 -/**  
62 - * @brief Initialise hms customization module, and user should call this function  
63 - * before using hms customization features.  
64 - * @return Execution result.  
65 - */  
66 -T_ZiyanReturnCode ZiyanHmsCustomization_Init(void);  
67 -  
68 -/**  
69 - * @brief DeInitialize hms manager module.  
70 - * @return Execution result.  
71 - */  
72 -T_ZiyanReturnCode ZiyanHmsCustomization_DeInit(void);  
73 -  
74 -/**  
75 - * @brief Inject custom hms error code to APP.  
76 - * @note: For the same hms error code, a single call is enough, no need to call repeatedly.  
77 - * @param errorCode: hms error code, value range: [0x1E020000 ~ 0x1E02FFFF].  
78 - * @param errorLevel: hms error level, see reference of E_ZiyanHmsErrorLevel.  
79 - * @return Execution result.  
80 - */  
81 -T_ZiyanReturnCode ZiyanHmsCustomization_InjectHmsErrorCode(uint32_t errorCode, E_ZiyanHmsErrorLevel errorLevel);  
82 -  
83 -/**  
84 - * @brief Eliminate custom hms error code to APP.  
85 - * @note: For the same hms error code, a single call is enough, no need to call repeatedly.  
86 - * @param errorCode: hms error code, value range: [0x1E020000 ~ 0x1E02FFFF].  
87 - * @return Execution result.  
88 - */  
89 -T_ZiyanReturnCode ZiyanHmsCustomization_EliminateHmsErrorCode(uint32_t errorCode);  
90 -  
91 -/**  
92 - * @brief Register default hms text configuration file by directory path.  
93 - * @param configDirPath: the hms text configuration by directory path.  
94 - * @return Execution result.  
95 - */  
96 -T_ZiyanReturnCode ZiyanHmsCustomization_RegDefaultHmsTextConfigByDirPath(const char *configDirPath);  
97 -  
98 -/**  
99 - * @brief Register hms text configuration file by directory path.  
100 - * @note Different hms text configurations for several language require the same hms config.  
101 - * @param appLanguage: mobile app language type.  
102 - * @param configDirPath: the hms text configuration by directory path.  
103 - * @return Execution result.  
104 - */  
105 -T_ZiyanReturnCode ZiyanHmsCustomization_RegHmsTextConfigByDirPath(E_ZiyanMobileAppLanguage appLanguage,  
106 - const char *configDirPath);  
107 -  
108 -/**  
109 - * @brief Register default hms text configuration config by binary array.  
110 - * @note In RTOS, most likely there is no file system. The hms text config file content can use C array express. Use this  
111 - * function and ZiyanHms_RegDefaultHmsTextConfigByBinaryArray set hms text configuration. When the language is not cover in  
112 - * your setting by ZiyanHms_RegHmsTextConfigByBinaryArray, the hms text configuration uses setting by this function.  
113 - * @param binaryArrayConfig: the binary array config for hms text configuration.  
114 - * @return Execution result.  
115 - */  
116 -T_ZiyanReturnCode ZiyanHmsCustomization_RegDefaultHmsTextConfigByBinaryArray(const T_ZiyanHmsBinaryArrayConfig  
117 - *binaryArrayConfig);  
118 -  
119 -/**  
120 - * @brief Register hms text config by binary array configuration.  
121 - * @note Different hms text configurations for several language require the same hms config.  
122 - * @param appLanguage: mobile app language type.  
123 - * @param binaryArrayConfig: the binary array config for hms text configuration.  
124 - * @return Execution result.  
125 - */  
126 -T_ZiyanReturnCode ZiyanHmsCustomization_RegHmsTextConfigByBinaryArray(E_ZiyanMobileAppLanguage appLanguage,  
127 - const T_ZiyanHmsBinaryArrayConfig *binaryArrayConfig);  
128 -  
129 -#ifdef __cplusplus  
130 -}  
131 -#endif  
132 -  
133 -#endif // ZIYAN_HMS_CUSTOMIZATION_H  
134 -/************************ (C) COPYRIGHT ZIYAN Innovations *******END OF FILE******/