合并分支 'dev' 到 'master'
Dev 查看合并请求 !20
正在显示
41 个修改的文件
包含
3106 行增加
和
308 行删除
| @@ -26,4 +26,7 @@ project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/* | @@ -26,4 +26,7 @@ project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/* | ||
| 26 | !project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/hal | 26 | !project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/hal |
| 27 | !project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/CMakeLists.txt | 27 | !project_build/DJI_大疆PSDK/samples/sample_c/platform/linux/all/CMakeLists.txt |
| 28 | 28 | ||
| 29 | +project_build/Payload-SDK-release-v3.11.0/* | ||
| 30 | + | ||
| 31 | + | ||
| 29 | project_build/Attention_提示程序 | 32 | project_build/Attention_提示程序 |
| @@ -132,7 +132,8 @@ | @@ -132,7 +132,8 @@ | ||
| 132 | "dji_sdk_config.h": "c", | 132 | "dji_sdk_config.h": "c", |
| 133 | "hal_uart.h": "c", | 133 | "hal_uart.h": "c", |
| 134 | "jzsdkbase.h": "c", | 134 | "jzsdkbase.h": "c", |
| 135 | - "dji_logger.h": "c" | 135 | + "dji_logger.h": "c", |
| 136 | + "dji_platform.h": "c" | ||
| 136 | }, | 137 | }, |
| 137 | "Codegeex.GenerationPreference": "automatic", | 138 | "Codegeex.GenerationPreference": "automatic", |
| 138 | "C_Cpp.dimInactiveRegions": false | 139 | "C_Cpp.dimInactiveRegions": false |
| 1 | # 编译链的配置 | 1 | # 编译链的配置 |
| 2 | 2 | ||
| 3 | #1、编译链与设备类型的选择 | 3 | #1、编译链与设备类型的选择 |
| 4 | -set(DEVICE_NAME JZ_U30) | 4 | +set(DEVICE_NAME JZ_H10) |
| 5 | #上一行为禁止修改行 | 5 | #上一行为禁止修改行 |
| 6 | 6 | ||
| 7 | message("**************************JZSDK构建编译开始***************************\n") | 7 | message("**************************JZSDK构建编译开始***************************\n") |
| @@ -40,15 +40,15 @@ if(${MAKE_COMPILER} STREQUAL "ARM_CORTEXA9_LINUX") | @@ -40,15 +40,15 @@ if(${MAKE_COMPILER} STREQUAL "ARM_CORTEXA9_LINUX") | ||
| 40 | 40 | ||
| 41 | elseif(${MAKE_COMPILER} STREQUAL "ARM_CORTEX_LINUX") | 41 | elseif(${MAKE_COMPILER} STREQUAL "ARM_CORTEX_LINUX") |
| 42 | set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc) | 42 | set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc) |
| 43 | - set(CMAKE_C_COMPILER "/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc") | ||
| 44 | - set(CMAKE_CXX_COMPILER "/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++") | 43 | + set(CMAKE_C_COMPILER "/usr/local/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc") |
| 44 | + set(CMAKE_CXX_COMPILER "/usr/local/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++") | ||
| 45 | message("使用ARM_CORTEX_LINUX编译链") | 45 | message("使用ARM_CORTEX_LINUX编译链") |
| 46 | 46 | ||
| 47 | elseif(${MAKE_COMPILER} STREQUAL "ARM_X86_64_ARRCH64") | 47 | elseif(${MAKE_COMPILER} STREQUAL "ARM_X86_64_ARRCH64") |
| 48 | # 交叉编译链3 | 48 | # 交叉编译链3 |
| 49 | set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc) | 49 | set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc) |
| 50 | - set(CMAKE_C_COMPILER "/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc") | ||
| 51 | - set(CMAKE_CXX_COMPILER "/opt/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++") | 50 | + set(CMAKE_C_COMPILER "/usr/local/arm/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc") |
| 51 | + set(CMAKE_CXX_COMPILER "/usr/local/arm/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++") | ||
| 52 | message("使用ARM_X86_64_ARRCH64编译链") | 52 | message("使用ARM_X86_64_ARRCH64编译链") |
| 53 | 53 | ||
| 54 | elseif(${MAKE_COMPILER} STREQUAL "LOCAL") | 54 | elseif(${MAKE_COMPILER} STREQUAL "LOCAL") |
| @@ -143,6 +143,7 @@ typedef enum { | @@ -143,6 +143,7 @@ typedef enum { | ||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | JZ_INSCODE_5AFRAME_LASER_CONTROL = 0x10000C00, //激光控制 | 145 | JZ_INSCODE_5AFRAME_LASER_CONTROL = 0x10000C00, //激光控制 |
| 146 | + JZ_INSCODE_5AFRAME_LASER_MODE = 0x10000C01, //激光模式 | ||
| 146 | 147 | ||
| 147 | JZ_INSCODE_5AFRAME_SEARCHLIGHT_CONTROL = 0x10000E00, //探照灯开光 | 148 | JZ_INSCODE_5AFRAME_SEARCHLIGHT_CONTROL = 0x10000E00, //探照灯开光 |
| 148 | JZ_INSCODE_5AFRAME_SEARCHLIGHT_SET_LUMEN = 0x10000E10, //设置探照灯亮度 | 149 | JZ_INSCODE_5AFRAME_SEARCHLIGHT_SET_LUMEN = 0x10000E10, //设置探照灯亮度 |
| @@ -221,10 +222,11 @@ typedef enum { | @@ -221,10 +222,11 @@ typedef enum { | ||
| 221 | 222 | ||
| 222 | 223 | ||
| 223 | JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE = 0x10004600, //查询探照灯温度 | 224 | JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE = 0x10004600, //查询探照灯温度 |
| 224 | - JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS = 0x10004601, //查询激光状态 | ||
| 225 | - JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY = 0x10004602, //查询探照灯频率 | ||
| 226 | - JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_MODE = 0x10004603, //查询探照灯模式 | ||
| 227 | - JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_LUMEN = 0x10004604, //查询探照灯流明 | 225 | + JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_CONTROL = 0x10004601, //查询激光状态_控制 |
| 226 | + JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_MODE = 0x10004602, //查询激光状态_模式 | ||
| 227 | + JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY = 0x10004610, //查询探照灯频率 | ||
| 228 | + JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_MODE = 0x10004611, //查询探照灯模式 | ||
| 229 | + JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_LUMEN = 0x10004612, //查询探照灯流明 | ||
| 228 | 230 | ||
| 229 | JZ_INSCODE_5BFRAME_CHECKSTATUS_WARNINGLIGHT_STATUS = 0x10004700, //警示灯模式控制 | 231 | JZ_INSCODE_5BFRAME_CHECKSTATUS_WARNINGLIGHT_STATUS = 0x10004700, //警示灯模式控制 |
| 230 | JZ_INSCODE_5BFRAME_CHECKSTATUS_WARNINGLIGHT_COLOR = 0x10004701, //警示灯颜色控制 | 232 | JZ_INSCODE_5BFRAME_CHECKSTATUS_WARNINGLIGHT_COLOR = 0x10004701, //警示灯颜色控制 |
| @@ -270,7 +270,7 @@ static int Comparison_5AFRAME_FirstLevelCode_0x55(char *getdata) | @@ -270,7 +270,7 @@ static int Comparison_5AFRAME_FirstLevelCode_0x55(char *getdata) | ||
| 270 | 270 | ||
| 271 | //设置循环播放间隔 | 271 | //设置循环播放间隔 |
| 272 | case 0x01: | 272 | case 0x01: |
| 273 | - return JZ_INSCODE_5AFRAME_CHECKSTATUS_ADUIO_LOOP_INTERVAL; | 273 | + return JZ_INSCODE_5AFRAME_ADUIO_PLAY_LOOP_INTERVAL; |
| 274 | break; | 274 | break; |
| 275 | 275 | ||
| 276 | default: | 276 | default: |
| @@ -441,6 +441,10 @@ static int Comparison_5AFRAME_FirstLevelCode_0x60(char *getdata) | @@ -441,6 +441,10 @@ static int Comparison_5AFRAME_FirstLevelCode_0x60(char *getdata) | ||
| 441 | return JZ_INSCODE_5AFRAME_LASER_CONTROL; | 441 | return JZ_INSCODE_5AFRAME_LASER_CONTROL; |
| 442 | break; | 442 | break; |
| 443 | 443 | ||
| 444 | + case 0x52: | ||
| 445 | + return JZ_INSCODE_5AFRAME_LASER_MODE; | ||
| 446 | + break; | ||
| 447 | + | ||
| 444 | default: | 448 | default: |
| 445 | return JZ_ERROR_SYSTEM_FRAME_ERROR; | 449 | return JZ_ERROR_SYSTEM_FRAME_ERROR; |
| 446 | break; | 450 | break; |
| @@ -599,7 +603,7 @@ static int Comparison_5AFRAME_FirstLevelCode_0x6F(char *getdata) | @@ -599,7 +603,7 @@ static int Comparison_5AFRAME_FirstLevelCode_0x6F(char *getdata) | ||
| 599 | 603 | ||
| 600 | //激光查询 | 604 | //激光查询 |
| 601 | case 0x53: | 605 | case 0x53: |
| 602 | - return JZ_ERROR_SYSTEM_FRAME_ERROR; | 606 | + return JZ_INSCODE_5AFRAME_CHECKSTATUS_LASER_STATUS; |
| 603 | break; | 607 | break; |
| 604 | 608 | ||
| 605 | //云台角度查询 | 609 | //云台角度查询 |
| @@ -196,7 +196,11 @@ static int Comparison_5BFRAME_FirstLevelCode_0x60(char *getdata) | @@ -196,7 +196,11 @@ static int Comparison_5BFRAME_FirstLevelCode_0x60(char *getdata) | ||
| 196 | { | 196 | { |
| 197 | //回复激光查询 | 197 | //回复激光查询 |
| 198 | case 0x51: | 198 | case 0x51: |
| 199 | - return JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS; | 199 | + return JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_CONTROL; |
| 200 | + break; | ||
| 201 | + | ||
| 202 | + case 0x52: | ||
| 203 | + return JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_MODE; | ||
| 200 | break; | 204 | break; |
| 201 | 205 | ||
| 202 | default: | 206 | default: |
| @@ -486,7 +486,23 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -486,7 +486,23 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 486 | memcpy(str, sendbuf, 12); | 486 | memcpy(str, sendbuf, 12); |
| 487 | *str_len = 12; | 487 | *str_len = 12; |
| 488 | } | 488 | } |
| 489 | - break; | 489 | + break; |
| 490 | + | ||
| 491 | + case JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_CONTROL: | ||
| 492 | + { | ||
| 493 | + char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x60, 0x51, 0x00, 0x00, 0x00, 0x23}; | ||
| 494 | + memcpy(str, sendbuf, 13); | ||
| 495 | + *str_len = 13; | ||
| 496 | + } | ||
| 497 | + break; | ||
| 498 | + | ||
| 499 | + case JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_MODE: | ||
| 500 | + { | ||
| 501 | + char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x60, 0x52, 0x00, 0x00, 0x00, 0x23}; | ||
| 502 | + memcpy(str, sendbuf, 13); | ||
| 503 | + *str_len = 13; | ||
| 504 | + } | ||
| 505 | + break; | ||
| 490 | 506 | ||
| 491 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY: | 507 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY: |
| 492 | { | 508 | { |
| @@ -71,6 +71,7 @@ typedef struct T_JZC1_info | @@ -71,6 +71,7 @@ typedef struct T_JZC1_info | ||
| 71 | #define JZ_C1_IRC_HEIGHT 256 | 71 | #define JZ_C1_IRC_HEIGHT 256 |
| 72 | #define JZ_C1_IRC_FRAMERATE 30 | 72 | #define JZ_C1_IRC_FRAMERATE 30 |
| 73 | #define JZ_C1_IRC_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_FIRST | 73 | #define JZ_C1_IRC_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_FIRST |
| 74 | +#define JZ_C1_IRC_BPS 4000000 | ||
| 74 | 75 | ||
| 75 | #define JZ_C1_OPT_WIDTH 1920 | 76 | #define JZ_C1_OPT_WIDTH 1920 |
| 76 | #define JZ_C1_OPT_HEIGHT 1080 | 77 | #define JZ_C1_OPT_HEIGHT 1080 |
| @@ -78,11 +79,13 @@ typedef struct T_JZC1_info | @@ -78,11 +79,13 @@ typedef struct T_JZC1_info | ||
| 78 | #define JZ_C1_OPT_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_SECOND | 79 | #define JZ_C1_OPT_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_SECOND |
| 79 | #define JZ_C1_OPT_DEV_PATH ("/dev/video21") | 80 | #define JZ_C1_OPT_DEV_PATH ("/dev/video21") |
| 80 | #define JZ_C1_OPT_PIXEL V4L2_PIX_FMT_MJPEG | 81 | #define JZ_C1_OPT_PIXEL V4L2_PIX_FMT_MJPEG |
| 82 | +#define JZ_C1_OPT_BPS 4000000 | ||
| 81 | 83 | ||
| 82 | #define JZ_C1_FUSE_WIDTH 1920 | 84 | #define JZ_C1_FUSE_WIDTH 1920 |
| 83 | #define JZ_C1_FUSE_HEIGHT 1080 | 85 | #define JZ_C1_FUSE_HEIGHT 1080 |
| 84 | -#define JZ_C1_FUSE_FRAMERATE 30 | 86 | +#define JZ_C1_FUSE_FRAMERATE 25 |
| 85 | #define JZ_C1_FUSE_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_THIRD | 87 | #define JZ_C1_FUSE_INDEX VIDEOMGMT_STREAMING_FLOW_INDEX_THIRD |
| 88 | +#define JZ_C1_FUSE_BPS 3000000 | ||
| 86 | 89 | ||
| 87 | static unsigned char *g_MixedIrc_Buffer = NULL; | 90 | static unsigned char *g_MixedIrc_Buffer = NULL; |
| 88 | static unsigned char *g_MixedOpt_Buffer = NULL; | 91 | static unsigned char *g_MixedOpt_Buffer = NULL; |
| @@ -1168,6 +1171,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | @@ -1168,6 +1171,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | ||
| 1168 | g_JZC1_info.IRC_enc_info->height = JZ_C1_IRC_HEIGHT; | 1171 | g_JZC1_info.IRC_enc_info->height = JZ_C1_IRC_HEIGHT; |
| 1169 | g_JZC1_info.IRC_enc_info->FrameNum = JZ_C1_IRC_FRAMERATE; | 1172 | g_JZC1_info.IRC_enc_info->FrameNum = JZ_C1_IRC_FRAMERATE; |
| 1170 | g_JZC1_info.IRC_enc_info->IDR_gop = 5; | 1173 | g_JZC1_info.IRC_enc_info->IDR_gop = 5; |
| 1174 | + g_JZC1_info.IRC_enc_info->bps_target = JZ_C1_IRC_BPS; | ||
| 1171 | 1175 | ||
| 1172 | g_JZC1_info.IRC_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.IRC_enc_info->width, 16); | 1176 | g_JZC1_info.IRC_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.IRC_enc_info->width, 16); |
| 1173 | g_JZC1_info.IRC_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.IRC_enc_info->height, 16); | 1177 | g_JZC1_info.IRC_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.IRC_enc_info->height, 16); |
| @@ -1204,6 +1208,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | @@ -1204,6 +1208,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | ||
| 1204 | g_JZC1_info.Opt_enc_info->height = JZ_C1_OPT_HEIGHT; | 1208 | g_JZC1_info.Opt_enc_info->height = JZ_C1_OPT_HEIGHT; |
| 1205 | g_JZC1_info.Opt_enc_info->FrameNum = JZ_C1_OPT_FRAMERATE; | 1209 | g_JZC1_info.Opt_enc_info->FrameNum = JZ_C1_OPT_FRAMERATE; |
| 1206 | g_JZC1_info.Opt_enc_info->IDR_gop = 15; | 1210 | g_JZC1_info.Opt_enc_info->IDR_gop = 15; |
| 1211 | + g_JZC1_info.Opt_enc_info->bps_target = JZ_C1_OPT_BPS; | ||
| 1207 | 1212 | ||
| 1208 | g_JZC1_info.Opt_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.Opt_enc_info->width, 16); | 1213 | g_JZC1_info.Opt_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.Opt_enc_info->width, 16); |
| 1209 | g_JZC1_info.Opt_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.Opt_enc_info->height, 16); | 1214 | g_JZC1_info.Opt_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.Opt_enc_info->height, 16); |
| @@ -1223,6 +1228,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | @@ -1223,6 +1228,7 @@ T_JZsdkReturnCode JZC1_Init(int mode) | ||
| 1223 | g_JZC1_info.Fuse_enc_info->height = JZ_C1_FUSE_HEIGHT; | 1228 | g_JZC1_info.Fuse_enc_info->height = JZ_C1_FUSE_HEIGHT; |
| 1224 | g_JZC1_info.Fuse_enc_info->FrameNum = JZ_C1_FUSE_FRAMERATE; | 1229 | g_JZC1_info.Fuse_enc_info->FrameNum = JZ_C1_FUSE_FRAMERATE; |
| 1225 | g_JZC1_info.Fuse_enc_info->IDR_gop = 15; | 1230 | g_JZC1_info.Fuse_enc_info->IDR_gop = 15; |
| 1231 | + g_JZC1_info.Fuse_enc_info->bps_target = JZ_C1_FUSE_BPS; | ||
| 1226 | 1232 | ||
| 1227 | g_JZC1_info.Fuse_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.Fuse_enc_info->width, 16); | 1233 | g_JZC1_info.Fuse_enc_info->hor_stride = JZ_ALIGN(g_JZC1_info.Fuse_enc_info->width, 16); |
| 1228 | g_JZC1_info.Fuse_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.Fuse_enc_info->height, 16); | 1234 | g_JZC1_info.Fuse_enc_info->ver_stride = JZ_ALIGN(g_JZC1_info.Fuse_enc_info->height, 16); |
| @@ -1270,7 +1276,8 @@ T_JZsdkReturnCode JZC1_Init(int mode) | @@ -1270,7 +1276,8 @@ T_JZsdkReturnCode JZC1_Init(int mode) | ||
| 1270 | } | 1276 | } |
| 1271 | 1277 | ||
| 1272 | //默认推送红外摄像头 后续改成 红外+光学 的组合画面 | 1278 | //默认推送红外摄像头 后续改成 红外+光学 的组合画面 |
| 1273 | - VideoMgmt_VideoStreamFlowIndex(JZ_C1_FUSE_INDEX); | 1279 | + //VideoMgmt_VideoStreamFlowIndex(JZ_C1_FUSE_INDEX); |
| 1280 | + VideoMgmt_VideoStreamFlowIndex(JZ_C1_IRC_INDEX); | ||
| 1274 | 1281 | ||
| 1275 | //设置快门为开 | 1282 | //设置快门为开 |
| 1276 | JZsdk_Camera_ShutterSwitch(JZ_FLAGCODE_ON); | 1283 | JZsdk_Camera_ShutterSwitch(JZ_FLAGCODE_ON); |
| @@ -7,18 +7,18 @@ | @@ -7,18 +7,18 @@ | ||
| 7 | #define VERSION_CHOOSE_H | 7 | #define VERSION_CHOOSE_H |
| 8 | #include "JZsdk_Base/JZsdk_Code/JZsdk_DeviceCode.h" | 8 | #include "JZsdk_Base/JZsdk_Code/JZsdk_DeviceCode.h" |
| 9 | //1~10行 除了D可以修改版本选择 禁止动任何东西 | 9 | //1~10行 除了D可以修改版本选择 禁止动任何东西 |
| 10 | -#define DEVICE_VERSION JZ_U30 | 10 | +#define DEVICE_VERSION JZ_H10 |
| 11 | 11 | ||
| 12 | //禁止修改行 选择是串口程序 还是 psdk程序 | 12 | //禁止修改行 选择是串口程序 还是 psdk程序 |
| 13 | #define APP_VERSION APP_PSDK | 13 | #define APP_VERSION APP_PSDK |
| 14 | 14 | ||
| 15 | //禁止修改行 板子型号 | 15 | //禁止修改行 板子型号 |
| 16 | -#define PLATFORM_VERSION PLATFORM_V3S | 16 | +#define PLATFORM_VERSION PLATFORM_H3 |
| 17 | 17 | ||
| 18 | //禁止修改行 串口连接程序的软件版本号 | 18 | //禁止修改行 串口连接程序的软件版本号 |
| 19 | #define MAJOR_VERSION 0x01 | 19 | #define MAJOR_VERSION 0x01 |
| 20 | #define MINOR_VERSION 0x03 | 20 | #define MINOR_VERSION 0x03 |
| 21 | -#define MODIFY_VERSION 0x10 | 21 | +#define MODIFY_VERSION 0x11 |
| 22 | #define DEBUG_VERSION 0x00 | 22 | #define DEBUG_VERSION 0x00 |
| 23 | 23 | ||
| 24 | //禁止修改行 滤波方式 | 24 | //禁止修改行 滤波方式 |
| @@ -27,6 +27,10 @@ | @@ -27,6 +27,10 @@ | ||
| 27 | #include "Megaphone/PcmAudio/PcmAudioFile.h" | 27 | #include "Megaphone/PcmAudio/PcmAudioFile.h" |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | +#ifdef SIDE_LASER_STATUS_ON | ||
| 31 | + #include "SideLaser/SideLaser.h" | ||
| 32 | +#endif | ||
| 33 | + | ||
| 30 | #ifdef AUDIODEAL_CONFIG_STATUS_ON | 34 | #ifdef AUDIODEAL_CONFIG_STATUS_ON |
| 31 | #include "AudioDeal/AudioDeal.h" | 35 | #include "AudioDeal/AudioDeal.h" |
| 32 | #endif | 36 | #endif |
| @@ -1287,7 +1291,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_volume(int Port, char *getbuf) | @@ -1287,7 +1291,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_volume(int Port, char *getbuf) | ||
| 1287 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); | 1291 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); |
| 1288 | 1292 | ||
| 1289 | //2、发送音量 | 1293 | //2、发送音量 |
| 1290 | - HalSend_type1Send_Reply_Volume(Port, volume); | 1294 | + HalSend_type1Send_Reply_Volume(Port, FrameSequence, volume); |
| 1291 | 1295 | ||
| 1292 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1296 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1293 | } | 1297 | } |
| @@ -1315,7 +1319,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_play(int Port, char *getbuf) | @@ -1315,7 +1319,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_play(int Port, char *getbuf) | ||
| 1315 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); | 1319 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); |
| 1316 | 1320 | ||
| 1317 | //2、发送播放状态 | 1321 | //2、发送播放状态 |
| 1318 | - HalSend_type1Send_Send_PlayStatus(Port, status); | 1322 | + HalSend_type1Send_Send_PlayStatus(Port, FrameSequence, status); |
| 1319 | 1323 | ||
| 1320 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1324 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1321 | } | 1325 | } |
| @@ -1342,7 +1346,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_gimbal(int Port, char *getbuf) | @@ -1342,7 +1346,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_gimbal(int Port, char *getbuf) | ||
| 1342 | UIcontrol_CheckStatus_GimbalAngle(&PitchAngle, &YawAngle); | 1346 | UIcontrol_CheckStatus_GimbalAngle(&PitchAngle, &YawAngle); |
| 1343 | 1347 | ||
| 1344 | //2、发送本地云台值 | 1348 | //2、发送本地云台值 |
| 1345 | - HalSend_type1Send_Reply_GimbalPitchAngle(Port, PitchAngle); | 1349 | + HalSend_type1Send_Reply_GimbalPitchAngle(Port, FrameSequence, PitchAngle); |
| 1346 | 1350 | ||
| 1347 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1351 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1348 | } | 1352 | } |
| @@ -1402,7 +1406,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_PLayFileName(int Port, char *getbu | @@ -1402,7 +1406,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_PLayFileName(int Port, char *getbu | ||
| 1402 | JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); | 1406 | JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); |
| 1403 | 1407 | ||
| 1404 | //2、发送名字 | 1408 | //2、发送名字 |
| 1405 | - HalSend_type1Send_Reply_MusicName(Port, MusicName,MusicName_Len); | 1409 | + HalSend_type1Send_Reply_MusicName(Port, FrameSequence, MusicName,MusicName_Len); |
| 1406 | } | 1410 | } |
| 1407 | else | 1411 | else |
| 1408 | { | 1412 | { |
| @@ -1441,7 +1445,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_SoftwareVersion(int Port, char *ge | @@ -1441,7 +1445,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_SoftwareVersion(int Port, char *ge | ||
| 1441 | JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, MinjorVersion, modifyVersion, debugVersion); | 1445 | JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, MinjorVersion, modifyVersion, debugVersion); |
| 1442 | 1446 | ||
| 1443 | //2、发送版本号 | 1447 | //2、发送版本号 |
| 1444 | - HalSend_type1Send_Reply_SoftVersion(Port, majorVersion, MinjorVersion, modifyVersion, debugVersion); | 1448 | + HalSend_type1Send_Reply_SoftVersion(Port, FrameSequence, majorVersion, MinjorVersion, modifyVersion, debugVersion); |
| 1445 | 1449 | ||
| 1446 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1450 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1447 | } | 1451 | } |
| @@ -1478,7 +1482,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_LoopPlay(int Port, char *getbuf) | @@ -1478,7 +1482,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_LoopPlay(int Port, char *getbuf) | ||
| 1478 | } | 1482 | } |
| 1479 | 1483 | ||
| 1480 | //2、发送循环状态 | 1484 | //2、发送循环状态 |
| 1481 | - HalSend_type1Send_Reply_LoopPlayStatus(Port ,LoopStatus); | 1485 | + HalSend_type1Send_Reply_LoopPlayStatus(Port, FrameSequence, LoopStatus); |
| 1482 | 1486 | ||
| 1483 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1487 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1484 | } | 1488 | } |
| @@ -1518,7 +1522,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_TTS_tone(int Port, char *getbuf) | @@ -1518,7 +1522,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_TTS_tone(int Port, char *getbuf) | ||
| 1518 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); | 1522 | //HalSend_type1Send_Reply_Success(Port, FrameSequence); |
| 1519 | 1523 | ||
| 1520 | //2、发送音色 | 1524 | //2、发送音色 |
| 1521 | - HalSend_type1Send_Reply_TTS_tone(Port ,TTS_tone); | 1525 | + HalSend_type1Send_Reply_TTS_tone(Port, FrameSequence,TTS_tone); |
| 1522 | 1526 | ||
| 1523 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1527 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1524 | } | 1528 | } |
| @@ -1555,7 +1559,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_TTS_speed(int Port, char *getbuf) | @@ -1555,7 +1559,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_TTS_speed(int Port, char *getbuf) | ||
| 1555 | } | 1559 | } |
| 1556 | 1560 | ||
| 1557 | //2、发送语速 | 1561 | //2、发送语速 |
| 1558 | - HalSend_type1Send_Reply_TTS_speed(Port ,TTS_speed); | 1562 | + HalSend_type1Send_Reply_TTS_speed(Port, FrameSequence, TTS_speed); |
| 1559 | 1563 | ||
| 1560 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1564 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 1561 | } | 1565 | } |
| @@ -2125,7 +2129,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_CurrentPlayTime(int Port, char *ge | @@ -2125,7 +2129,7 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_CurrentPlayTime(int Port, char *ge | ||
| 2125 | #ifdef MEGAPHONE_CONFIG_STATUS_ON | 2129 | #ifdef MEGAPHONE_CONFIG_STATUS_ON |
| 2126 | 2130 | ||
| 2127 | int mode = Megaphone_PlayBackGetMode(Port); | 2131 | int mode = Megaphone_PlayBackGetMode(Port); |
| 2128 | - HalSend_type1Send_Reply_CurrentPlayTimeStatus(Port, mode); | 2132 | + HalSend_type1Send_Reply_CurrentPlayTimeStatus(Port, FrameSequence, mode); |
| 2129 | 2133 | ||
| 2130 | #endif | 2134 | #endif |
| 2131 | 2135 | ||
| @@ -3042,6 +3046,100 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_SearchLightTemperture(int Port, ch | @@ -3042,6 +3046,100 @@ static T_JZsdkReturnCode RecvDeal_CheckStatus_SearchLightTemperture(int Port, ch | ||
| 3042 | 3046 | ||
| 3043 | /********* | 3047 | /********* |
| 3044 | * | 3048 | * |
| 3049 | + * 激光控制 | ||
| 3050 | + * | ||
| 3051 | +**********/ | ||
| 3052 | +static T_JZsdkReturnCode RecvDeal_Laser_Control(int Port, char *getbuf) | ||
| 3053 | +{ | ||
| 3054 | + JZSDK_LOG_INFO("%s,激光控制",JZsdk_DefineCode_GetPortName(Port)); | ||
| 3055 | + | ||
| 3056 | + //1、获取帧的序列号 | ||
| 3057 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 3058 | + | ||
| 3059 | + //2、获取激光控制值 | ||
| 3060 | + int LaserControl = getbuf[10]; | ||
| 3061 | + T_JZsdkReturnCode ReturnCode = JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 3062 | + | ||
| 3063 | + | ||
| 3064 | + ReturnCode = UIcontrol_SideLaser_SetControl(Port, LaserControl); | ||
| 3065 | + if (ReturnCode == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 3066 | + { | ||
| 3067 | + //回复操作成功 | ||
| 3068 | + HalSend_type1Send_Reply_Success(Port, FrameSequence); | ||
| 3069 | + } | ||
| 3070 | + else | ||
| 3071 | + { | ||
| 3072 | + //回复操作失败 | ||
| 3073 | + HalSend_type1Send_Reply_Failure(Port, FrameSequence); | ||
| 3074 | + } | ||
| 3075 | + | ||
| 3076 | + return ReturnCode; | ||
| 3077 | +} | ||
| 3078 | + | ||
| 3079 | +/********* | ||
| 3080 | + * | ||
| 3081 | + * 激光模式控制 | ||
| 3082 | + * | ||
| 3083 | +**********/ | ||
| 3084 | +static T_JZsdkReturnCode RecvDeal_Laser_Mode(int Port, char *getbuf) | ||
| 3085 | +{ | ||
| 3086 | + JZSDK_LOG_INFO("%s,激光模式控制",JZsdk_DefineCode_GetPortName(Port)); | ||
| 3087 | + | ||
| 3088 | + //1、获取帧的序列号 | ||
| 3089 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 3090 | + | ||
| 3091 | + //2、获取激光控制值 | ||
| 3092 | + int mode = getbuf[10]; | ||
| 3093 | + T_JZsdkReturnCode ReturnCode = JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 3094 | + | ||
| 3095 | + ReturnCode = UIcontrol_SideLaser_SetMode(Port, mode); | ||
| 3096 | + if (ReturnCode == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 3097 | + { | ||
| 3098 | + //回复操作成功 | ||
| 3099 | + HalSend_type1Send_Reply_Success(Port, FrameSequence); | ||
| 3100 | + } | ||
| 3101 | + else | ||
| 3102 | + { | ||
| 3103 | + //回复操作失败 | ||
| 3104 | + HalSend_type1Send_Reply_Failure(Port, FrameSequence); | ||
| 3105 | + } | ||
| 3106 | + | ||
| 3107 | + return ReturnCode; | ||
| 3108 | +} | ||
| 3109 | + | ||
| 3110 | +/********* | ||
| 3111 | + * | ||
| 3112 | + * 激光状态查询 | ||
| 3113 | + * | ||
| 3114 | +**********/ | ||
| 3115 | +static T_JZsdkReturnCode RecvDeal_CheckStatus_LaserStatus(int Port, char *getbuf) | ||
| 3116 | +{ | ||
| 3117 | + JZSDK_LOG_INFO("%s,激光状态查询",JZsdk_DefineCode_GetPortName(Port)); | ||
| 3118 | + | ||
| 3119 | + //1、获取帧的序列号 | ||
| 3120 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 3121 | + | ||
| 3122 | + //2、查询激光状态 | ||
| 3123 | + int LaserControl = JZ_FLAGCODE_OFF; | ||
| 3124 | + int LaserMode = 0; | ||
| 3125 | + T_JZsdkReturnCode ReturnCode = JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 3126 | + | ||
| 3127 | +#ifdef SIDE_LASER_STATUS_ON | ||
| 3128 | + | ||
| 3129 | + ReturnCode = SideLaser_param(JZ_FLAGCODE_GET, SIDELASER_MODE, &LaserMode); | ||
| 3130 | + ReturnCode = SideLaser_param(JZ_FLAGCODE_GET, SIDELASER_CONTROL, &LaserControl); | ||
| 3131 | + | ||
| 3132 | +#endif | ||
| 3133 | + | ||
| 3134 | + // 2、回复激光状态 | ||
| 3135 | + HalSend_type1Send_LaserControl(Port, LaserControl); | ||
| 3136 | + HalSend_type1Send_LaserMode(Port, LaserMode); | ||
| 3137 | + | ||
| 3138 | + return ReturnCode; | ||
| 3139 | +} | ||
| 3140 | + | ||
| 3141 | +/********* | ||
| 3142 | + * | ||
| 3045 | * 消息订阅控制 | 3143 | * 消息订阅控制 |
| 3046 | * | 3144 | * |
| 3047 | **********/ | 3145 | **********/ |
| @@ -4902,7 +5000,7 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi | @@ -4902,7 +5000,7 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi | ||
| 4902 | break; | 5000 | break; |
| 4903 | 5001 | ||
| 4904 | //设置循环间隔 | 5002 | //设置循环间隔 |
| 4905 | - case JZ_INSCODE_5AFRAME_CHECKSTATUS_ADUIO_LOOP_INTERVAL: | 5003 | + case JZ_INSCODE_5AFRAME_ADUIO_PLAY_LOOP_INTERVAL: |
| 4906 | RecvDeal_PlayLoopInterval(Port,getbuf); | 5004 | RecvDeal_PlayLoopInterval(Port,getbuf); |
| 4907 | return 0; | 5005 | return 0; |
| 4908 | break; | 5006 | break; |
| @@ -5093,8 +5191,21 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi | @@ -5093,8 +5191,21 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi | ||
| 5093 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE: | 5191 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE: |
| 5094 | RecvDeal_CheckStatus_SearchLightTemperture(Port,getbuf); | 5192 | RecvDeal_CheckStatus_SearchLightTemperture(Port,getbuf); |
| 5095 | break; | 5193 | break; |
| 5194 | + | ||
| 5195 | + //激光控制 | ||
| 5196 | + case JZ_INSCODE_5AFRAME_LASER_CONTROL: | ||
| 5197 | + RecvDeal_Laser_Control(Port,getbuf); | ||
| 5198 | + break; | ||
| 5199 | + | ||
| 5200 | + //激光模式 | ||
| 5201 | + case JZ_INSCODE_5AFRAME_LASER_MODE: | ||
| 5202 | + RecvDeal_Laser_Mode(Port,getbuf); | ||
| 5203 | + break; | ||
| 5204 | + | ||
| 5096 | //激光查询 | 5205 | //激光查询 |
| 5097 | - | 5206 | + case JZ_INSCODE_5AFRAME_CHECKSTATUS_LASER_STATUS: |
| 5207 | + RecvDeal_CheckStatus_LaserStatus(Port,getbuf); | ||
| 5208 | + break; | ||
| 5098 | 5209 | ||
| 5099 | //警灯控制 | 5210 | //警灯控制 |
| 5100 | case JZ_INSCODE_5AFRAME_WARNINGLIGHT_CONTROL: | 5211 | case JZ_INSCODE_5AFRAME_WARNINGLIGHT_CONTROL: |
| @@ -5455,9 +5566,9 @@ T_JZsdkReturnCode HalRecv_type1_FrameDeal(int Port, unsigned char *getbuf, int | @@ -5455,9 +5566,9 @@ T_JZsdkReturnCode HalRecv_type1_FrameDeal(int Port, unsigned char *getbuf, int | ||
| 5455 | int flag = JZsdk_FrameComparsion(getbuf, len); | 5566 | int flag = JZsdk_FrameComparsion(getbuf, len); |
| 5456 | if (flag == JZ_ERROR_SYSTEM_FRAME_ERROR || flag == JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE) | 5567 | if (flag == JZ_ERROR_SYSTEM_FRAME_ERROR || flag == JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE) |
| 5457 | { | 5568 | { |
| 5458 | - if (len >= 7) | 5569 | + if (len >= 9) |
| 5459 | { | 5570 | { |
| 5460 | - JZSDK_LOG_ERROR("%s 得到了无法正常识别的帧 [0]0x%x [5]0x%x [6]0x%x", JZsdk_DefineCode_GetPortName(Port),getbuf[0],getbuf[5],getbuf[6]); | 5571 | + JZSDK_LOG_ERROR("%s 得到了无法正常识别的帧 [0]0x%x [7]0x%x [8]0x%x", JZsdk_DefineCode_GetPortName(Port),getbuf[0],getbuf[7],getbuf[8]); |
| 5461 | } | 5572 | } |
| 5462 | else | 5573 | else |
| 5463 | { | 5574 | { |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | #include "Hal_Send/HalSend.h" | 11 | #include "Hal_Send/HalSend.h" |
| 12 | +#include "./HalSend_type1.h" | ||
| 12 | 13 | ||
| 13 | //发送主动连接帧 | 14 | //发送主动连接帧 |
| 14 | T_JZsdkReturnCode HalSend_type1Send_ConnectFrame(int PortNum) | 15 | T_JZsdkReturnCode HalSend_type1Send_ConnectFrame(int PortNum) |
| @@ -585,7 +586,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport) | @@ -585,7 +586,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport) | ||
| 585 | } | 586 | } |
| 586 | 587 | ||
| 587 | //发送播放状态帧 | 588 | //发送播放状态帧 |
| 588 | -T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) | 589 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport, int FrameSequence ,int num) |
| 589 | { | 590 | { |
| 590 | printf("向"); | 591 | printf("向"); |
| 591 | switch (Uartport) | 592 | switch (Uartport) |
| @@ -611,6 +612,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) | @@ -611,6 +612,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) | ||
| 611 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYSTATUS , sendbuf, &send_buf_len); | 612 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYSTATUS , sendbuf, &send_buf_len); |
| 612 | 613 | ||
| 613 | //2、写入数据 | 614 | //2、写入数据 |
| 615 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 614 | sendbuf[9] = (char)num; | 616 | sendbuf[9] = (char)num; |
| 615 | 617 | ||
| 616 | //3、发送帧 | 618 | //3、发送帧 |
| @@ -618,7 +620,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) | @@ -618,7 +620,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) | ||
| 618 | } | 620 | } |
| 619 | 621 | ||
| 620 | //回复当前播放的歌曲名字 | 622 | //回复当前播放的歌曲名字 |
| 621 | -T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_name, int music_name_len) | 623 | +T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport , int FrameSequence, char *music_name, int music_name_len) |
| 622 | { | 624 | { |
| 623 | printf("发送当前歌曲名字帧"); | 625 | printf("发送当前歌曲名字帧"); |
| 624 | unsigned char sendbuf[256]; | 626 | unsigned char sendbuf[256]; |
| @@ -628,6 +630,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_na | @@ -628,6 +630,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_na | ||
| 628 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYFILENAME , sendbuf, &send_buf_len); | 630 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYFILENAME , sendbuf, &send_buf_len); |
| 629 | 631 | ||
| 630 | //2、写入数据 | 632 | //2、写入数据 |
| 633 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 631 | memcpy(&sendbuf[9],music_name,music_name_len); | 634 | memcpy(&sendbuf[9],music_name,music_name_len); |
| 632 | sendbuf[9+music_name_len]=0x00; | 635 | sendbuf[9+music_name_len]=0x00; |
| 633 | sendbuf[10+music_name_len]=0x23; | 636 | sendbuf[10+music_name_len]=0x23; |
| @@ -642,7 +645,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_na | @@ -642,7 +645,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_na | ||
| 642 | } | 645 | } |
| 643 | 646 | ||
| 644 | //回复当前音量 | 647 | //回复当前音量 |
| 645 | -T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) | 648 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport, int FrameSequence ,int num) |
| 646 | { | 649 | { |
| 647 | printf("发送当前音量帧\n"); | 650 | printf("发送当前音量帧\n"); |
| 648 | unsigned char sendbuf[256]; | 651 | unsigned char sendbuf[256]; |
| @@ -652,6 +655,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) | @@ -652,6 +655,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) | ||
| 652 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_VOLUME, sendbuf, &send_buf_len); | 655 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_VOLUME, sendbuf, &send_buf_len); |
| 653 | 656 | ||
| 654 | //2、写入数据 | 657 | //2、写入数据 |
| 658 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 655 | sendbuf[9] = (char)num; | 659 | sendbuf[9] = (char)num; |
| 656 | 660 | ||
| 657 | //3、发送帧 | 661 | //3、发送帧 |
| @@ -662,7 +666,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) | @@ -662,7 +666,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) | ||
| 662 | 666 | ||
| 663 | 667 | ||
| 664 | //回复软件版本号 | 668 | //回复软件版本号 |
| 665 | -T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion) | 669 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport, int FrameSequence, char majorVersion, char minorVersion, char modifyVersion, char debugVersion) |
| 666 | { | 670 | { |
| 667 | printf("发送软件版本号帧\n"); | 671 | printf("发送软件版本号帧\n"); |
| 668 | unsigned char sendbuf[256]; | 672 | unsigned char sendbuf[256]; |
| @@ -672,6 +676,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVe | @@ -672,6 +676,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVe | ||
| 672 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_SORTWAREVERSION, sendbuf, &send_buf_len); | 676 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_SORTWAREVERSION, sendbuf, &send_buf_len); |
| 673 | 677 | ||
| 674 | //2、写入数据 | 678 | //2、写入数据 |
| 679 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 675 | sendbuf[9] = majorVersion; | 680 | sendbuf[9] = majorVersion; |
| 676 | sendbuf[10] = minorVersion; | 681 | sendbuf[10] = minorVersion; |
| 677 | sendbuf[11] = modifyVersion; | 682 | sendbuf[11] = modifyVersion; |
| @@ -682,7 +687,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVe | @@ -682,7 +687,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVe | ||
| 682 | } | 687 | } |
| 683 | 688 | ||
| 684 | //发送循环状态 | 689 | //发送循环状态 |
| 685 | -T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int status) | 690 | +T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport , int FrameSequence, int status) |
| 686 | { | 691 | { |
| 687 | printf("发送循环状态帧\n"); | 692 | printf("发送循环状态帧\n"); |
| 688 | 693 | ||
| @@ -693,6 +698,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int statu | @@ -693,6 +698,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int statu | ||
| 693 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYLOOPSTATUS, sendbuf, &send_buf_len); | 698 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_AUDIO_PLAYLOOPSTATUS, sendbuf, &send_buf_len); |
| 694 | 699 | ||
| 695 | //2、写入数据 | 700 | //2、写入数据 |
| 701 | + sendbuf[6] = FrameSequence; | ||
| 696 | sendbuf[9] = status; | 702 | sendbuf[9] = status; |
| 697 | 703 | ||
| 698 | //3、发送帧 | 704 | //3、发送帧 |
| @@ -701,7 +707,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int statu | @@ -701,7 +707,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int statu | ||
| 701 | } | 707 | } |
| 702 | 708 | ||
| 703 | //发送音色 | 709 | //发送音色 |
| 704 | -T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) | 710 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport, int FrameSequence, int tone) |
| 705 | { | 711 | { |
| 706 | printf("发送音色帧\n"); | 712 | printf("发送音色帧\n"); |
| 707 | 713 | ||
| @@ -712,6 +718,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) | @@ -712,6 +718,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) | ||
| 712 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_TTS_TONE, sendbuf, &send_buf_len); | 718 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_TTS_TONE, sendbuf, &send_buf_len); |
| 713 | 719 | ||
| 714 | //2、写入数据 | 720 | //2、写入数据 |
| 721 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 715 | sendbuf[9] = tone; | 722 | sendbuf[9] = tone; |
| 716 | 723 | ||
| 717 | //3、发送帧 | 724 | //3、发送帧 |
| @@ -719,7 +726,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) | @@ -719,7 +726,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) | ||
| 719 | } | 726 | } |
| 720 | 727 | ||
| 721 | //发送语速 | 728 | //发送语速 |
| 722 | -T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) | 729 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport, int FrameSequence, int speed) |
| 723 | { | 730 | { |
| 724 | printf("发送语速帧\n"); | 731 | printf("发送语速帧\n"); |
| 725 | 732 | ||
| @@ -730,6 +737,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) | @@ -730,6 +737,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) | ||
| 730 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_TTS_SPEED, sendbuf, &send_buf_len); | 737 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_TTS_SPEED, sendbuf, &send_buf_len); |
| 731 | 738 | ||
| 732 | //2、写入数据 | 739 | //2、写入数据 |
| 740 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 733 | sendbuf[9] = speed; | 741 | sendbuf[9] = speed; |
| 734 | 742 | ||
| 735 | //3、发送帧 | 743 | //3、发送帧 |
| @@ -737,7 +745,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) | @@ -737,7 +745,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) | ||
| 737 | } | 745 | } |
| 738 | 746 | ||
| 739 | //发送当前播放时间状态 | 747 | //发送当前播放时间状态 |
| 740 | -T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport ,int mode) | 748 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport, int FrameSequence ,int mode) |
| 741 | { | 749 | { |
| 742 | printf("发送当前播放时间状态帧\n"); | 750 | printf("发送当前播放时间状态帧\n"); |
| 743 | 751 | ||
| @@ -748,6 +756,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport ,in | @@ -748,6 +756,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport ,in | ||
| 748 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_CURRENT_PLAYTIME, sendbuf, &send_buf_len); | 756 | JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_CURRENT_PLAYTIME, sendbuf, &send_buf_len); |
| 749 | 757 | ||
| 750 | //2、写入数据 | 758 | //2、写入数据 |
| 759 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 751 | sendbuf[9] = mode; | 760 | sendbuf[9] = mode; |
| 752 | 761 | ||
| 753 | //3、发送帧 | 762 | //3、发送帧 |
| @@ -882,7 +891,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Stop(int Uartport, int FrameSe | @@ -882,7 +891,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Stop(int Uartport, int FrameSe | ||
| 882 | ****************************************************************************************************************************************************/ | 891 | ****************************************************************************************************************************************************/ |
| 883 | 892 | ||
| 884 | //回复当前俯仰云台角度 | 893 | //回复当前俯仰云台角度 |
| 885 | -T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int angle) | 894 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport, int FrameSequence ,int angle) |
| 886 | { | 895 | { |
| 887 | printf("发送当前俯仰云台角度帧\n"); | 896 | printf("发送当前俯仰云台角度帧\n"); |
| 888 | unsigned char sendbuf[256]; | 897 | unsigned char sendbuf[256]; |
| @@ -899,6 +908,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int ang | @@ -899,6 +908,7 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int ang | ||
| 899 | angle = -angle; | 908 | angle = -angle; |
| 900 | } | 909 | } |
| 901 | 910 | ||
| 911 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 902 | sendbuf[9] = (char)signal; | 912 | sendbuf[9] = (char)signal; |
| 903 | sendbuf[10] = (char)(angle >> 8); | 913 | sendbuf[10] = (char)(angle >> 8); |
| 904 | sendbuf[11] = (char)(angle & 255); | 914 | sendbuf[11] = (char)(angle & 255); |
| @@ -1513,6 +1523,51 @@ T_JZsdkReturnCode HalSend_type1Send_SearchLight_Lumen(int Uartport,int LeftLumen | @@ -1513,6 +1523,51 @@ T_JZsdkReturnCode HalSend_type1Send_SearchLight_Lumen(int Uartport,int LeftLumen | ||
| 1513 | HalSend_SendData(Uartport ,sendbuf, send_buf_len, MULTI_THREAD_SEND); | 1523 | HalSend_SendData(Uartport ,sendbuf, send_buf_len, MULTI_THREAD_SEND); |
| 1514 | } | 1524 | } |
| 1515 | 1525 | ||
| 1526 | +/******************** | ||
| 1527 | + * | ||
| 1528 | + * 发送侧面激光控制值 | ||
| 1529 | + * | ||
| 1530 | + * *************/ | ||
| 1531 | +T_JZsdkReturnCode HalSend_type1Send_LaserControl(int Uartport, int Control) | ||
| 1532 | +{ | ||
| 1533 | + printf("发送侧面激光控制值帧\n"); | ||
| 1534 | + | ||
| 1535 | + unsigned char sendbuf[256]; | ||
| 1536 | + int send_buf_len; | ||
| 1537 | + | ||
| 1538 | + //1、获取帧样板 | ||
| 1539 | + JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_CONTROL, sendbuf, &send_buf_len); | ||
| 1540 | + | ||
| 1541 | + //2、写入数据 | ||
| 1542 | + sendbuf[10] = Control; | ||
| 1543 | + | ||
| 1544 | + //3、发送帧 | ||
| 1545 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, MULTI_THREAD_SEND); | ||
| 1546 | +} | ||
| 1547 | + | ||
| 1548 | +/******************** | ||
| 1549 | + * | ||
| 1550 | + * 发送侧面激光模式 | ||
| 1551 | + * | ||
| 1552 | + * *************/ | ||
| 1553 | +T_JZsdkReturnCode HalSend_type1Send_LaserMode(int Uartport, int mode) | ||
| 1554 | +{ | ||
| 1555 | + printf("发送侧面激光模式值帧\n"); | ||
| 1556 | + | ||
| 1557 | + unsigned char sendbuf[256]; | ||
| 1558 | + int send_buf_len; | ||
| 1559 | + | ||
| 1560 | + //1、获取帧样板 | ||
| 1561 | + JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_LASER_STATUS_MODE, sendbuf, &send_buf_len); | ||
| 1562 | + | ||
| 1563 | + //2、写入数据 | ||
| 1564 | + sendbuf[10] = mode; | ||
| 1565 | + | ||
| 1566 | + //3、发送帧 | ||
| 1567 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, MULTI_THREAD_SEND); | ||
| 1568 | +} | ||
| 1569 | + | ||
| 1570 | + | ||
| 1516 | /************* | 1571 | /************* |
| 1517 | * | 1572 | * |
| 1518 | * 发送探照灯温度 | 1573 | * 发送探照灯温度 |
| @@ -58,9 +58,9 @@ T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Stop(int Uartport, int FrameS | @@ -58,9 +58,9 @@ T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Stop(int Uartport, int FrameS | ||
| 58 | 58 | ||
| 59 | 59 | ||
| 60 | T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport); | 60 | T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport); |
| 61 | -T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num); | ||
| 62 | -T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_name, int music_name_len); | ||
| 63 | -T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num); | 61 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport, int FrameSequence ,int num); |
| 62 | +T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport , int FrameSequence, char *music_name, int music_name_len); | ||
| 63 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport, int FrameSequence ,int num); | ||
| 64 | T_JZsdkReturnCode HalSend_type1Send_OpusDecodeStatus(int Uartport,int value); | 64 | T_JZsdkReturnCode HalSend_type1Send_OpusDecodeStatus(int Uartport,int value); |
| 65 | 65 | ||
| 66 | T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Start(int Uartport, int FrameSequence, int music_sum); | 66 | T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Start(int Uartport, int FrameSequence, int music_sum); |
| @@ -68,7 +68,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Trans(int Uartport, int FrameS | @@ -68,7 +68,7 @@ T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Trans(int Uartport, int FrameS | ||
| 68 | T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Stop(int Uartport, int FrameSequence); | 68 | T_JZsdkReturnCode HalSend_type1Send_Send_OpusList_Stop(int Uartport, int FrameSequence); |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | -T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int angle); | 71 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport, int FrameSequence ,int angle); |
| 72 | T_JZsdkReturnCode HalSend_type1Send_Set_GimbalPitchAngle(int Uartport ,int angle); | 72 | T_JZsdkReturnCode HalSend_type1Send_Set_GimbalPitchAngle(int Uartport ,int angle); |
| 73 | T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch); | 73 | T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch); |
| 74 | T_JZsdkReturnCode HalSend_type1Send_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning); | 74 | T_JZsdkReturnCode HalSend_type1Send_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning); |
| @@ -80,12 +80,12 @@ T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalAngle(int Uartport ,int Fr | @@ -80,12 +80,12 @@ T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalAngle(int Uartport ,int Fr | ||
| 80 | T_JZsdkReturnCode HalSend_type1Send_SetGimbalRange(int Uartport,int FrameSequence,int value); | 80 | T_JZsdkReturnCode HalSend_type1Send_SetGimbalRange(int Uartport,int FrameSequence,int value); |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | -T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion); | ||
| 84 | -T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int status); | ||
| 85 | -T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone); | ||
| 86 | -T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed); | 83 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport, int FrameSequence, char majorVersion, char minorVersion, char modifyVersion, char debugVersion); |
| 84 | +T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport , int FrameSequence, int status); | ||
| 85 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport, int FrameSequence, int tone); | ||
| 86 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport, int FrameSequence, int speed); | ||
| 87 | T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTime(int Uartport ,int time); | 87 | T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTime(int Uartport ,int time); |
| 88 | -T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport ,int mode); | 88 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CurrentPlayTimeStatus(int Uartport, int FrameSequence ,int mode); |
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | T_JZsdkReturnCode HalSend_type1Send_Set_SearchLightFrequency(int Uartport ,int Frequency); | 91 | T_JZsdkReturnCode HalSend_type1Send_Set_SearchLightFrequency(int Uartport ,int Frequency); |
| @@ -132,6 +132,8 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeStart(int Uartport); | @@ -132,6 +132,8 @@ T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeStart(int Uartport); | ||
| 132 | T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeEnd(int Uartport); | 132 | T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeEnd(int Uartport); |
| 133 | T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeCheckResult(int Uartport, int status); | 133 | T_JZsdkReturnCode HalSend_type1Send_Reply_UpgradeCheckResult(int Uartport, int status); |
| 134 | 134 | ||
| 135 | +T_JZsdkReturnCode HalSend_type1Send_LaserControl(int Uartport, int Control); | ||
| 136 | +T_JZsdkReturnCode HalSend_type1Send_LaserMode(int Uartport, int mode); | ||
| 135 | 137 | ||
| 136 | 138 | ||
| 137 | 139 |
| @@ -167,6 +167,25 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message) | @@ -167,6 +167,25 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message) | ||
| 167 | snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); | 167 | snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); |
| 168 | //JZSDK_LOG_INFO("获取的信息%s",message); | 168 | //JZSDK_LOG_INFO("获取的信息%s",message); |
| 169 | } | 169 | } |
| 170 | + | ||
| 171 | + // //某些特殊固件增加了功率模拟显示 | ||
| 172 | + // if (g_MessageLanguage == DEVICE_MESSAGE_CHINESE) | ||
| 173 | + // { | ||
| 174 | + // memset(new_message,0,sizeof(new_message)); | ||
| 175 | + // memset(old_message,0,sizeof(old_message)); | ||
| 176 | + // snprintf(new_message,MESSAGE_MAX_LEN,"当前功率:%0.1fW\n", JZsdk_GetMagaphonePowerSimulation()); | ||
| 177 | + // snprintf(old_message,MESSAGE_MAX_LEN,"%s",message); | ||
| 178 | + // snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); | ||
| 179 | + // } | ||
| 180 | + // else | ||
| 181 | + // { | ||
| 182 | + // memset(new_message,0,sizeof(new_message)); | ||
| 183 | + // memset(old_message,0,sizeof(old_message)); | ||
| 184 | + // snprintf(new_message,MESSAGE_MAX_LEN,"Current Power:%0.1fW\n", JZsdk_GetMagaphonePowerSimulation()); | ||
| 185 | + // snprintf(old_message,MESSAGE_MAX_LEN,"%s",message); | ||
| 186 | + // snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); | ||
| 187 | + // } | ||
| 188 | + | ||
| 170 | #endif | 189 | #endif |
| 171 | 190 | ||
| 172 | #ifdef IRC_CONFIG_STATUS_ON | 191 | #ifdef IRC_CONFIG_STATUS_ON |
| @@ -195,6 +195,7 @@ T_JZsdkReturnCode Lighting_Set_SearchLightFrequency(int value) | @@ -195,6 +195,7 @@ T_JZsdkReturnCode Lighting_Set_SearchLightFrequency(int value) | ||
| 195 | 195 | ||
| 196 | if (DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) | 196 | if (DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) |
| 197 | { | 197 | { |
| 198 | + SearchLight_Frequency = value; | ||
| 198 | return SearchLight_V3S_U3_Set_SearchLightFrequency(value); | 199 | return SearchLight_V3S_U3_Set_SearchLightFrequency(value); |
| 199 | } | 200 | } |
| 200 | else if (DEVICE_VERSION == JZ_H1T) | 201 | else if (DEVICE_VERSION == JZ_H1T) |
| @@ -306,6 +307,8 @@ T_JZsdkReturnCode Lighting_Set_WarningLight_Status(int status, int mode) | @@ -306,6 +307,8 @@ T_JZsdkReturnCode Lighting_Set_WarningLight_Status(int status, int mode) | ||
| 306 | #elif DEVICE_VERSION == TF_A1 | 307 | #elif DEVICE_VERSION == TF_A1 |
| 307 | return WarningLight_V3S_TFA1_Set_WarningLight_Status(status, mode); | 308 | return WarningLight_V3S_TFA1_Set_WarningLight_Status(status, mode); |
| 308 | #elif DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30 | 309 | #elif DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30 |
| 310 | + WarningLight_Status = status; | ||
| 311 | + WarningLight_Mode = mode; | ||
| 309 | return HalSend_type1Send_Set_WarningLight_Status(UART_DEV_2, status, mode); | 312 | return HalSend_type1Send_Set_WarningLight_Status(UART_DEV_2, status, mode); |
| 310 | #else | 313 | #else |
| 311 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 314 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| @@ -344,6 +347,10 @@ T_JZsdkReturnCode Lighting_CheckStatus_WarningLightStatus(int *ValueSwitch, int | @@ -344,6 +347,10 @@ T_JZsdkReturnCode Lighting_CheckStatus_WarningLightStatus(int *ValueSwitch, int | ||
| 344 | { | 347 | { |
| 345 | WarningLight_V3S_H1T_CheckStatus_WarningLightStatus(); | 348 | WarningLight_V3S_H1T_CheckStatus_WarningLightStatus(); |
| 346 | } | 349 | } |
| 350 | + else if (DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) | ||
| 351 | + { | ||
| 352 | + HalSend_type1Send_CheckStatus_WarningLightStatus(UART_DEV_2); | ||
| 353 | + } | ||
| 347 | 354 | ||
| 348 | //2、获取一次本地警灯状态 | 355 | //2、获取一次本地警灯状态 |
| 349 | Lighting_Get_WarningLight_Status(ValueSwitch, ValueMode); | 356 | Lighting_Get_WarningLight_Status(ValueSwitch, ValueMode); |
| @@ -367,7 +374,14 @@ T_JZsdkReturnCode Lighting_Set_WarningLight_Color(int color1, int color2) | @@ -367,7 +374,14 @@ T_JZsdkReturnCode Lighting_Set_WarningLight_Color(int color1, int color2) | ||
| 367 | #elif DEVICE_VERSION == TF_A1 | 374 | #elif DEVICE_VERSION == TF_A1 |
| 368 | return WarningLight_V3S_TFA1_Set_WarningLight_Color(color1, color2); | 375 | return WarningLight_V3S_TFA1_Set_WarningLight_Color(color1, color2); |
| 369 | #elif DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30 | 376 | #elif DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30 |
| 370 | - HalSend_type1Send_Set_WarningLight_Color(UART_DEV_2, color1, color2); | 377 | + |
| 378 | + //临时方案,u3s查不到警灯颜色 | ||
| 379 | + #if DEVICE_VERSION == JZ_U3S | ||
| 380 | + WarningLight_Color1 = color1; | ||
| 381 | + WarningLight_Color2 = color2; | ||
| 382 | + #endif | ||
| 383 | + | ||
| 384 | + return HalSend_type1Send_Set_WarningLight_Color(UART_DEV_2, color1, color2); | ||
| 371 | #else | 385 | #else |
| 372 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 386 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 373 | #endif | 387 | #endif |
| @@ -115,7 +115,7 @@ typedef struct IRC_param | @@ -115,7 +115,7 @@ typedef struct IRC_param | ||
| 115 | unsigned int Width; | 115 | unsigned int Width; |
| 116 | unsigned int Height; | 116 | unsigned int Height; |
| 117 | unsigned int PixelNum; //像素个数 | 117 | unsigned int PixelNum; //像素个数 |
| 118 | - unsigned int OutputPixelColorMode; //输出色彩模式 0 默认模式 1 伪彩模式 2 气体增强模式 | 118 | + unsigned int OutputPixelColorMode; //输出色彩模式 0 默认模式 1 伪彩模式 2 气体增强模式 3 气体增强模式2类 |
| 119 | 119 | ||
| 120 | unsigned int IRC_outPixelMode; //IRC输出像素模式 RGB888 YUV420 | 120 | unsigned int IRC_outPixelMode; //IRC输出像素模式 RGB888 YUV420 |
| 121 | 121 |
| @@ -448,7 +448,7 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U16_t *rawData ,unsigned int * | @@ -448,7 +448,7 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U16_t *rawData ,unsigned int * | ||
| 448 | /*************************************气体增强部分,标记气体增图像图像******************************************************************/ | 448 | /*************************************气体增强部分,标记气体增图像图像******************************************************************/ |
| 449 | 449 | ||
| 450 | //如果开启气体增强时,未标记过气体画面,则标记 | 450 | //如果开启气体增强时,未标记过气体画面,则标记 |
| 451 | - if (dealInfo->OutputPixelColorMode == 2 && dealInfo->First_DGCE_flag == JZ_FLAGCODE_OFF) | 451 | + if ((dealInfo->OutputPixelColorMode == 2 || dealInfo->OutputPixelColorMode == 3) && dealInfo->First_DGCE_flag == JZ_FLAGCODE_OFF) |
| 452 | { | 452 | { |
| 453 | JZSDK_LOG_INFO("未标记过气体画面"); | 453 | JZSDK_LOG_INFO("未标记过气体画面"); |
| 454 | dealInfo->First_DGCE_flag = JZ_FLAGCODE_ON; | 454 | dealInfo->First_DGCE_flag = JZ_FLAGCODE_ON; |
| @@ -899,7 +899,7 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | @@ -899,7 +899,7 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | ||
| 899 | { | 899 | { |
| 900 | T_JZsdkReturnCode ret; | 900 | T_JZsdkReturnCode ret; |
| 901 | 901 | ||
| 902 | - if (value < 0 || value > 2) | 902 | + if (value < 0 || value > 3) |
| 903 | { | 903 | { |
| 904 | JZSDK_LOG_ERROR("像素输出模式出错1"); | 904 | JZSDK_LOG_ERROR("像素输出模式出错1"); |
| 905 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 905 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| @@ -911,11 +911,11 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | @@ -911,11 +911,11 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | ||
| 911 | return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER; | 911 | return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER; |
| 912 | } | 912 | } |
| 913 | 913 | ||
| 914 | - if (value == 1 || value == 0) | ||
| 915 | - { | 914 | + // if (value == 1 || value == 0) |
| 915 | + // { | ||
| 916 | //切换模式后要重新设置气体增强 | 916 | //切换模式后要重新设置气体增强 |
| 917 | g_IRC_Param->First_DGCE_flag = JZ_FLAGCODE_OFF; | 917 | g_IRC_Param->First_DGCE_flag = JZ_FLAGCODE_OFF; |
| 918 | - } | 918 | + //} |
| 919 | 919 | ||
| 920 | switch (value) | 920 | switch (value) |
| 921 | { | 921 | { |
| @@ -930,6 +930,10 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | @@ -930,6 +930,10 @@ T_JZsdkReturnCode IRC_Set_OutputPixelColorMode(int value) | ||
| 930 | case 0x02: | 930 | case 0x02: |
| 931 | JZSDK_LOG_INFO("红外气体增强输出"); | 931 | JZSDK_LOG_INFO("红外气体增强输出"); |
| 932 | break; | 932 | break; |
| 933 | + | ||
| 934 | + case 0x03: | ||
| 935 | + JZSDK_LOG_INFO("红外气体增强输出2"); | ||
| 936 | + break; | ||
| 933 | 937 | ||
| 934 | default: | 938 | default: |
| 935 | JZSDK_LOG_ERROR("红外输出模式出错"); | 939 | JZSDK_LOG_ERROR("红外输出模式出错"); |
| @@ -249,8 +249,8 @@ T_JZsdkReturnCode KtLib_writeMarkData(int type, U16_t* in ,int size) | @@ -249,8 +249,8 @@ T_JZsdkReturnCode KtLib_writeMarkData(int type, U16_t* in ,int size) | ||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static int lastCorrectMode = JZ_FLAGCODE_OFF; | 251 | static int lastCorrectMode = JZ_FLAGCODE_OFF; |
| 252 | -static int DynamicGasesColorFlag = JZ_FLAGCODE_OFF; | ||
| 253 | -static int PseudoColorFlag = JZ_FLAGCODE_OFF; | 252 | +static int LastColorMode = JZ_FLAGCODE_OFF; |
| 253 | +static int ColorMode = JZ_FLAGCODE_OFF; | ||
| 254 | 254 | ||
| 255 | 255 | ||
| 256 | T_JZsdkReturnCode KtLib_DataDeal(U16_t* U16_data, unsigned int U16_dataSize, | 256 | T_JZsdkReturnCode KtLib_DataDeal(U16_t* U16_data, unsigned int U16_dataSize, |
| @@ -320,73 +320,60 @@ T_JZsdkReturnCode KtLib_DataDeal(U16_t* U16_data, unsigned int U16_dataSize, | @@ -320,73 +320,60 @@ T_JZsdkReturnCode KtLib_DataDeal(U16_t* U16_data, unsigned int U16_dataSize, | ||
| 320 | *RGB_data = new U8_t[dealInfo->PixelNum*3]; | 320 | *RGB_data = new U8_t[dealInfo->PixelNum*3]; |
| 321 | *RGB_dataSize = 0; | 321 | *RGB_dataSize = 0; |
| 322 | 322 | ||
| 323 | - // 图像输出模式 | ||
| 324 | - switch (dealInfo->OutputPixelColorMode) | 323 | + //检查图像输入模式 |
| 324 | + ColorMode = dealInfo->OutputPixelColorMode; | ||
| 325 | + if (LastColorMode != ColorMode) | ||
| 325 | { | 326 | { |
| 326 | - case 0: // 默认输出模式 | 327 | + //上次色彩模式为无 |
| 328 | + if (LastColorMode == 0) | ||
| 327 | { | 329 | { |
| 328 | - if (DynamicGasesColorFlag == JZ_FLAGCODE_ON) | ||
| 329 | - { | ||
| 330 | - CloseDynamicGasesColorEnhance(); | ||
| 331 | - DynamicGasesColorFlag = JZ_FLAGCODE_OFF; | ||
| 332 | - } | ||
| 333 | - | ||
| 334 | - if (PseudoColorFlag == JZ_FLAGCODE_ON) | ||
| 335 | - { | ||
| 336 | - ClosePseudoColor(); | ||
| 337 | - PseudoColorFlag = JZ_FLAGCODE_OFF; | ||
| 338 | - } | ||
| 339 | - | ||
| 340 | - bool_ret = GetImageSynchronous(inputDataChar, inputDataSize, (char *)*RGB_data, dealInfo->PixelNum*3, (int *)RGB_dataSize); //同步处理数据 | 330 | + //不用管 |
| 341 | } | 331 | } |
| 342 | - break; | ||
| 343 | - | ||
| 344 | - case 1: // 伪彩输出模式 | 332 | + //上次为伪彩模式 |
| 333 | + else if (LastColorMode == 1) | ||
| 345 | { | 334 | { |
| 346 | - if (DynamicGasesColorFlag == JZ_FLAGCODE_ON) | ||
| 347 | - { | ||
| 348 | - CloseDynamicGasesColorEnhance(); | ||
| 349 | - DynamicGasesColorFlag = JZ_FLAGCODE_OFF; | ||
| 350 | - } | ||
| 351 | - | ||
| 352 | - if (PseudoColorFlag == JZ_FLAGCODE_OFF) | ||
| 353 | - { | ||
| 354 | - OpenPseudoColor(); | ||
| 355 | - PseudoColorFlag = JZ_FLAGCODE_ON; | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - bool_ret = GetImageSynchronous(inputDataChar, inputDataSize, (char *)*RGB_data, dealInfo->PixelNum*3, (int *)RGB_dataSize); //同步处理数据 | 335 | + //关闭伪彩 |
| 336 | + ClosePseudoColor(); | ||
| 337 | + } | ||
| 338 | + //上次为气体增强模式1 | ||
| 339 | + else if (LastColorMode == 2) | ||
| 340 | + { | ||
| 341 | + //关闭气体增强 | ||
| 342 | + CloseDynamicGasesColorEnhance(); | ||
| 343 | + } | ||
| 344 | + //上次为气体增强模式2 | ||
| 345 | + else if (LastColorMode == 3) | ||
| 346 | + { | ||
| 347 | + //关闭气体增强 | ||
| 348 | + CloseDynamicGasesColorEnhance2(); | ||
| 349 | + } | ||
| 359 | 350 | ||
| 360 | - // //将rgb888数据反转为灰度数据并进行颜色映射 | ||
| 361 | - // PseudoColor_GrayRgb2Rgb((*RGB_data), dealInfo->PixelNum); | 351 | + //根据当前模式选择打开模式 |
| 352 | + if (ColorMode == 0) | ||
| 353 | + { | ||
| 354 | + //不用管 | ||
| 362 | } | 355 | } |
| 363 | - break; | ||
| 364 | - | ||
| 365 | - case 2: // 气体色彩增强输出模式 | 356 | + else if (ColorMode == 1) |
| 366 | { | 357 | { |
| 367 | - if (PseudoColorFlag == JZ_FLAGCODE_ON) | ||
| 368 | - { | ||
| 369 | - ClosePseudoColor(); | ||
| 370 | - PseudoColorFlag = JZ_FLAGCODE_OFF; | ||
| 371 | - } | ||
| 372 | - | ||
| 373 | - if (DynamicGasesColorFlag == JZ_FLAGCODE_OFF) | ||
| 374 | - { | ||
| 375 | - OpenDynamicGasesColorEnhance(); | ||
| 376 | - DynamicGasesColorFlag = JZ_FLAGCODE_ON; | ||
| 377 | - } | ||
| 378 | - | ||
| 379 | - bool_ret = GetImageSynchronous(inputDataChar, inputDataSize, (char *)*RGB_data, dealInfo->PixelNum*3, (int *)RGB_dataSize); //同步处理数据 | ||
| 380 | - | 358 | + //打开伪彩 |
| 359 | + OpenPseudoColor(); | ||
| 381 | } | 360 | } |
| 382 | - break; | ||
| 383 | - | ||
| 384 | - default: | ||
| 385 | - delete[] inputDataChar; | ||
| 386 | - return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 387 | - break; | 361 | + else if (ColorMode == 2) |
| 362 | + { | ||
| 363 | + //打开气体增强模式1 | ||
| 364 | + OpenDynamicGasesColorEnhance(); | ||
| 365 | + } | ||
| 366 | + else if (ColorMode == 3) | ||
| 367 | + { | ||
| 368 | + //打开气体增强模式2 | ||
| 369 | + OpenDynamicGasesColorEnhance2(); | ||
| 370 | + } | ||
| 371 | + | ||
| 372 | + LastColorMode = ColorMode; | ||
| 388 | } | 373 | } |
| 389 | - | 374 | + |
| 375 | + bool_ret = GetImageSynchronous(inputDataChar, inputDataSize, (char *)*RGB_data, dealInfo->PixelNum*3, (int *)RGB_dataSize); //同步处理数据 | ||
| 376 | + | ||
| 390 | if (bool_ret == false) | 377 | if (bool_ret == false) |
| 391 | { | 378 | { |
| 392 | JZSDK_LOG_ERROR("sdk处理错误"); | 379 | JZSDK_LOG_ERROR("sdk处理错误"); |
| @@ -149,7 +149,7 @@ T_JZsdkReturnCode RTK_mmp_enc_Init(T_rtk_mmp_enc_info *enc_info) | @@ -149,7 +149,7 @@ T_JZsdkReturnCode RTK_mmp_enc_Init(T_rtk_mmp_enc_info *enc_info) | ||
| 149 | mpp_enc_cfg_set_s32(enc_info->cfg, "rc:mode", MPP_ENC_RC_MODE_CBR); | 149 | mpp_enc_cfg_set_s32(enc_info->cfg, "rc:mode", MPP_ENC_RC_MODE_CBR); |
| 150 | 150 | ||
| 151 | //设置码率 dji要小于8M 先填个4M 4000000 | 151 | //设置码率 dji要小于8M 先填个4M 4000000 |
| 152 | - mpp_enc_cfg_set_s32(enc_info->cfg, "rc:bps_target", 4000000); | 152 | + mpp_enc_cfg_set_s32(enc_info->cfg, "rc:bps_target", enc_info->bps_target); |
| 153 | 153 | ||
| 154 | //设置输入帧率不变 | 154 | //设置输入帧率不变 |
| 155 | mpp_enc_cfg_set_s32(enc_info->cfg, "rc:fps_in_flex", 0); | 155 | mpp_enc_cfg_set_s32(enc_info->cfg, "rc:fps_in_flex", 0); |
| @@ -18,6 +18,7 @@ typedef struct T_rtk_mmp_enc_info | @@ -18,6 +18,7 @@ typedef struct T_rtk_mmp_enc_info | ||
| 18 | unsigned int width; //输入视频的宽度 | 18 | unsigned int width; //输入视频的宽度 |
| 19 | unsigned int height; //输入视频的高度 | 19 | unsigned int height; //输入视频的高度 |
| 20 | unsigned int FrameNum; //帧数 | 20 | unsigned int FrameNum; //帧数 |
| 21 | + unsigned int bps_target; //目标码率 | ||
| 21 | 22 | ||
| 22 | MppCodingType encType; //编码的类型 | 23 | MppCodingType encType; //编码的类型 |
| 23 | unsigned int IDR_gop; //i帧间隔数 | 24 | unsigned int IDR_gop; //i帧间隔数 |
| @@ -96,6 +96,9 @@ T_JZsdkReturnCode VideoMgmt_VideoStreamFlowIndex(int index) | @@ -96,6 +96,9 @@ T_JZsdkReturnCode VideoMgmt_VideoStreamFlowIndex(int index) | ||
| 96 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 96 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 97 | break; | 97 | break; |
| 98 | } | 98 | } |
| 99 | + | ||
| 100 | + //增加一个i帧 | ||
| 101 | + VideoStramPhoto_DevelopH264FlowGenerateIDR(); | ||
| 99 | 102 | ||
| 100 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 103 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 101 | } | 104 | } |
| @@ -136,12 +139,11 @@ T_JZsdkReturnCode VideoStramPhoto_DevelopH264FlowGenerateIDR() | @@ -136,12 +139,11 @@ T_JZsdkReturnCode VideoStramPhoto_DevelopH264FlowGenerateIDR() | ||
| 136 | { | 139 | { |
| 137 | 140 | ||
| 138 | T_JZsdkVideoMgmtHandler *VideoMgmtHandler = JZsdk_GetVideoMgmtHandler(); | 141 | T_JZsdkVideoMgmtHandler *VideoMgmtHandler = JZsdk_GetVideoMgmtHandler(); |
| 139 | - if (VideoMgmtHandler == NULL) | 142 | + if (VideoMgmtHandler == NULL || VideoMgmtHandler->SetNextFrame_IDR == NULL) |
| 140 | { | 143 | { |
| 141 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 144 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 142 | } | 145 | } |
| 143 | - | ||
| 144 | - | 146 | + |
| 145 | VideoMgmtHandler->SetNextFrame_IDR(g_VideoStreamFlowIndexNum); | 147 | VideoMgmtHandler->SetNextFrame_IDR(g_VideoStreamFlowIndexNum); |
| 146 | 148 | ||
| 147 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 149 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| @@ -51,6 +51,7 @@ T_JZsdkReturnCode Megaphone_SetVolume(int value, int mode);//霈曄蔭 | @@ -51,6 +51,7 @@ T_JZsdkReturnCode Megaphone_SetVolume(int value, int mode);//霈曄蔭 | ||
| 51 | 51 | ||
| 52 | static int g_TTS_Max_volume = 0; //用于存储tts最大音量限制 | 52 | static int g_TTS_Max_volume = 0; //用于存储tts最大音量限制 |
| 53 | static int g_Max_volume = 0; //用于存储最大音量限制 | 53 | static int g_Max_volume = 0; //用于存储最大音量限制 |
| 54 | +static double PowerSimulation = 0; //用于模拟喊话器功率状态 | ||
| 54 | 55 | ||
| 55 | /********************** | 56 | /********************** |
| 56 | * | 57 | * |
| @@ -162,7 +163,7 @@ static T_JZsdkReturnCode Megaphone_Play(struct MegaphoneInfo *IndexInfo, enum Me | @@ -162,7 +163,7 @@ static T_JZsdkReturnCode Megaphone_Play(struct MegaphoneInfo *IndexInfo, enum Me | ||
| 162 | JZSDK_LOG_ERROR("无法进行播放操作,目前正在进行实时语音播放"); | 163 | JZSDK_LOG_ERROR("无法进行播放操作,目前正在进行实时语音播放"); |
| 163 | return JZ_ERRORCODE_REALTIMEVOICE_HAS_BEEN_ON; | 164 | return JZ_ERRORCODE_REALTIMEVOICE_HAS_BEEN_ON; |
| 164 | } | 165 | } |
| 165 | - | 166 | + |
| 166 | //把暂停音乐的标志关了 | 167 | //把暂停音乐的标志关了 |
| 167 | AudioDeal_PauseAndContinuePlay(JZ_FLAGCODE_OFF); | 168 | AudioDeal_PauseAndContinuePlay(JZ_FLAGCODE_OFF); |
| 168 | 169 | ||
| @@ -919,6 +920,62 @@ static T_JZsdkReturnCode Megaphone_MaxVolume_Init() | @@ -919,6 +920,62 @@ static T_JZsdkReturnCode Megaphone_MaxVolume_Init() | ||
| 919 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 920 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 920 | } | 921 | } |
| 921 | 922 | ||
| 923 | + | ||
| 924 | +static void *JZsdk_PowerSimulationThread(void *args) | ||
| 925 | +{ | ||
| 926 | + T_JZsdkOsalHandler *OsalHandle = JZsdk_Platform_GetOsalHandler(); | ||
| 927 | + | ||
| 928 | + while(1) | ||
| 929 | + { | ||
| 930 | + //获取当前播放状态 | ||
| 931 | + int play_status = Megaphone_GetMegaphoneStatus(); | ||
| 932 | + | ||
| 933 | + //生产一个随机数 | ||
| 934 | + U16_t randomNum; | ||
| 935 | + OsalHandle->GetRandomNum(&randomNum); // 获取 0~65535 的随机数 | ||
| 936 | + | ||
| 937 | + // 转换为 [0.5, 1.2) 范围 | ||
| 938 | + double normalized = 0.5 + ((double)randomNum / 65535.0) * 0.7; | ||
| 939 | + | ||
| 940 | + //获取音量百分比 | ||
| 941 | + int volume = g_Megaphone_Volume; | ||
| 942 | + double _volume = (double)volume / 100; | ||
| 943 | + if (_volume < 0.1) | ||
| 944 | + { | ||
| 945 | + _volume = 0.1; | ||
| 946 | + } | ||
| 947 | + | ||
| 948 | + if (play_status == AUDIO_PLAY_STATUS_IDLE) | ||
| 949 | + { | ||
| 950 | + PowerSimulation = 25 * 0.1 * normalized; | ||
| 951 | + } | ||
| 952 | + else | ||
| 953 | + { | ||
| 954 | + PowerSimulation = 25* _volume * normalized; | ||
| 955 | + } | ||
| 956 | + | ||
| 957 | + //printf("PowerSimulation:%0.1f\n",PowerSimulation); | ||
| 958 | + | ||
| 959 | + OsalHandle->TaskSleepMs(1000); | ||
| 960 | + } | ||
| 961 | +} | ||
| 962 | + | ||
| 963 | +//获取模拟功率 | ||
| 964 | +double JZsdk_GetMagaphonePowerSimulation() | ||
| 965 | +{ | ||
| 966 | + return PowerSimulation; | ||
| 967 | +} | ||
| 968 | + | ||
| 969 | +static T_JZsdkReturnCode PowerSimulation_Init() | ||
| 970 | +{ | ||
| 971 | + T_JZsdkOsalHandler *OsalHandle = JZsdk_Platform_GetOsalHandler(); | ||
| 972 | + | ||
| 973 | + T_JZTaskHandle single_task = NULL; | ||
| 974 | + OsalHandle->TaskCreate("PowerSimulation", JZsdk_PowerSimulationThread, 8192, NULL , &single_task); | ||
| 975 | + | ||
| 976 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 977 | +} | ||
| 978 | + | ||
| 922 | /********* | 979 | /********* |
| 923 | * | 980 | * |
| 924 | * 喊话器初始化 | 981 | * 喊话器初始化 |
| @@ -964,7 +1021,10 @@ T_JZsdkReturnCode Megaphone_Init() | @@ -964,7 +1021,10 @@ T_JZsdkReturnCode Megaphone_Init() | ||
| 964 | int language = 0x11; | 1021 | int language = 0x11; |
| 965 | Megaphone_TTS_param(JZ_FLAGCODE_SET, MEGAPHONE_TTS_TONE, &language); | 1022 | Megaphone_TTS_param(JZ_FLAGCODE_SET, MEGAPHONE_TTS_TONE, &language); |
| 966 | } | 1023 | } |
| 967 | - | 1024 | + |
| 1025 | + //设置一个模拟功率函数 | ||
| 1026 | + //PowerSimulation_Init(); | ||
| 1027 | + | ||
| 968 | MegaphoneStatusFlag = JZ_FLAGCODE_ON; | 1028 | MegaphoneStatusFlag = JZ_FLAGCODE_ON; |
| 969 | } | 1029 | } |
| 970 | 1030 | ||
| @@ -1515,17 +1575,17 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag) | @@ -1515,17 +1575,17 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag) | ||
| 1515 | //如果4G模块有启动 | 1575 | //如果4G模块有启动 |
| 1516 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON)) | 1576 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON)) |
| 1517 | { | 1577 | { |
| 1518 | - HalSend_type1Send_Reply_Volume(UART_4G, g_Megaphone_Volume); | 1578 | + HalSend_type1Send_Reply_Volume(UART_4G, 0, g_Megaphone_Volume); |
| 1519 | } | 1579 | } |
| 1520 | //如果设备1有启动 | 1580 | //如果设备1有启动 |
| 1521 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) ) | 1581 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) ) |
| 1522 | { | 1582 | { |
| 1523 | - HalSend_type1Send_Reply_Volume(UART_DEV_1, g_Megaphone_Volume); | 1583 | + HalSend_type1Send_Reply_Volume(UART_DEV_1, 0, g_Megaphone_Volume); |
| 1524 | } | 1584 | } |
| 1525 | //如果设备2有启动 | 1585 | //如果设备2有启动 |
| 1526 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) ) | 1586 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) ) |
| 1527 | { | 1587 | { |
| 1528 | - HalSend_type1Send_Reply_Volume(UART_DEV_2, g_Megaphone_Volume); | 1588 | + HalSend_type1Send_Reply_Volume(UART_DEV_2, 0, g_Megaphone_Volume); |
| 1529 | } | 1589 | } |
| 1530 | //如果psdk接口已经使用 | 1590 | //如果psdk接口已经使用 |
| 1531 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON)) | 1591 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON)) |
| @@ -146,7 +146,7 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag); | @@ -146,7 +146,7 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag); | ||
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | T_JZsdkReturnCode Megaphone_PresetTask(); | 148 | T_JZsdkReturnCode Megaphone_PresetTask(); |
| 149 | - | 149 | +double JZsdk_GetMagaphonePowerSimulation(); |
| 150 | #ifdef __cplusplus | 150 | #ifdef __cplusplus |
| 151 | } | 151 | } |
| 152 | #endif | 152 | #endif |
| @@ -123,7 +123,7 @@ static T_JZsdkReturnCode TTS_Synthesis(const char* src_text, const char* params) | @@ -123,7 +123,7 @@ static T_JZsdkReturnCode TTS_Synthesis(const char* src_text, const char* params) | ||
| 123 | * 获取音源 | 123 | * 获取音源 |
| 124 | * | 124 | * |
| 125 | * ********/ | 125 | * ********/ |
| 126 | -static T_JZsdkReturnCode TTS_GetSoundSource(int tone,unsigned char *name_tts, unsigned char *name_path) | 126 | +static T_JZsdkReturnCode TTS_GetSoundSource(int tone,unsigned char *name_tts, unsigned char *name_path, unsigned char *rule_path) |
| 127 | { | 127 | { |
| 128 | 128 | ||
| 129 | /* | 129 | /* |
| @@ -182,6 +182,25 @@ static T_JZsdkReturnCode TTS_GetSoundSource(int tone,unsigned char *name_tts, un | @@ -182,6 +182,25 @@ static T_JZsdkReturnCode TTS_GetSoundSource(int tone,unsigned char *name_tts, un | ||
| 182 | snprintf(name_path,64, "fo|/root/tts/xiaoyan.jet"); | 182 | snprintf(name_path,64, "fo|/root/tts/xiaoyan.jet"); |
| 183 | break; | 183 | break; |
| 184 | } | 184 | } |
| 185 | + | ||
| 186 | + //写入发音规则 | ||
| 187 | + memset(rule_path,0,128); | ||
| 188 | + snprintf(rule_path,128,"/root/tts/common.jet"); | ||
| 189 | + | ||
| 190 | + //不是英文就直接返回 | ||
| 191 | + if ( tone != 0x11 && tone != 0x12) | ||
| 192 | + { | ||
| 193 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + //由于有讯飞更新,让英文有了新的发音规则,所以要检测本地是否有新的发音规则 | ||
| 197 | + if(JZsdk_check_file_exists("/root/tts/common_en.jet") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 198 | + { | ||
| 199 | + memset(rule_path,0,128); | ||
| 200 | + snprintf(rule_path,128,"/root/tts/common_en.jet"); | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 185 | } | 204 | } |
| 186 | 205 | ||
| 187 | static T_JZsdkReturnCode TTS_FILE_GenerateAndPlay(struct t_Megaphone_tts_param *Megaphone_tts_param) | 206 | static T_JZsdkReturnCode TTS_FILE_GenerateAndPlay(struct t_Megaphone_tts_param *Megaphone_tts_param) |
| @@ -196,15 +215,18 @@ static T_JZsdkReturnCode TTS_FILE_GenerateAndPlay(struct t_Megaphone_tts_param * | @@ -196,15 +215,18 @@ static T_JZsdkReturnCode TTS_FILE_GenerateAndPlay(struct t_Megaphone_tts_param * | ||
| 196 | int ret = MSP_SUCCESS; | 215 | int ret = MSP_SUCCESS; |
| 197 | char name_tts[16]; | 216 | char name_tts[16]; |
| 198 | char name_path[64]; | 217 | char name_path[64]; |
| 218 | + | ||
| 199 | char session_begin_params[512]; | 219 | char session_begin_params[512]; |
| 200 | char tts_add_params[512]; | 220 | char tts_add_params[512]; |
| 221 | + char rule[128]; | ||
| 201 | 222 | ||
| 202 | - //获取音源 | ||
| 203 | - TTS_GetSoundSource(tone, name_tts, name_path); | 223 | + //获取音源,以及规则 |
| 224 | + TTS_GetSoundSource(tone, name_tts, name_path, rule); | ||
| 204 | 225 | ||
| 226 | + //配置合成参数 | ||
| 205 | snprintf(session_begin_params,512, | 227 | snprintf(session_begin_params,512, |
| 206 | - "engine_type = local,voice_name=%s, text_encoding = UTF8, tts_res_path = %s;fo|/root/tts/common.jet, sample_rate = 16000, speed = %d, volume = %d, pitch = 50, rdn = 2" | ||
| 207 | - ,name_tts,name_path,speed,volume); | 228 | + "engine_type = local,voice_name=%s, text_encoding = UTF8, tts_res_path = %s;fo|%s, sample_rate = 16000, speed = %d, volume = %d, pitch = 50, rdn = 2" |
| 229 | + ,name_tts , name_path, rule, speed, volume); | ||
| 208 | 230 | ||
| 209 | printf("session_begin_params=%s\n",session_begin_params); | 231 | printf("session_begin_params=%s\n",session_begin_params); |
| 210 | printf("argv=%s\n",argv); | 232 | printf("argv=%s\n",argv); |
| @@ -11,29 +11,34 @@ | @@ -11,29 +11,34 @@ | ||
| 11 | static T_JZsdkReturnCode SideLaser_RealCotrol(int LaserNum, int status); | 11 | static T_JZsdkReturnCode SideLaser_RealCotrol(int LaserNum, int status); |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -static unsigned char g_LaserMode = SIDE_LASER_OFF; | ||
| 15 | 14 | ||
| 16 | -static T_SideLaserMode g_SideLaser_Control = SIDE_LASER_OFF; | 15 | +static T_SideLaserMode g_SideLaser_RealMode = SIDE_LASER_OFF; //实际控制灯光的值 |
| 16 | + | ||
| 17 | +static int g_SideLaserMode = 0; //realmode -1 | ||
| 18 | +static int g_SideLaserControl = JZ_FLAGCODE_OFF; | ||
| 19 | + | ||
| 17 | static int SideLaser_Frequency = 50; //1~100 | 20 | static int SideLaser_Frequency = 50; //1~100 |
| 18 | 21 | ||
| 22 | + | ||
| 19 | static void *SideLaserControl_task(void *arg) | 23 | static void *SideLaserControl_task(void *arg) |
| 20 | { | 24 | { |
| 21 | int status = JZ_FLAGCODE_OFF; | 25 | int status = JZ_FLAGCODE_OFF; |
| 22 | static T_SideLaserMode Last_LaserMode = SIDE_LASER_OFF; | 26 | static T_SideLaserMode Last_LaserMode = SIDE_LASER_OFF; |
| 27 | + | ||
| 23 | while (1) | 28 | while (1) |
| 24 | { | 29 | { |
| 25 | - switch (g_SideLaser_Control) | 30 | + switch (g_SideLaser_RealMode) |
| 26 | { | 31 | { |
| 27 | case SIDE_LASER_OFF: | 32 | case SIDE_LASER_OFF: |
| 28 | { | 33 | { |
| 29 | - if (Last_LaserMode == g_SideLaser_Control) | 34 | + if (Last_LaserMode == g_SideLaser_RealMode) |
| 30 | { | 35 | { |
| 31 | delayMs(10); | 36 | delayMs(10); |
| 32 | continue; | 37 | continue; |
| 33 | } | 38 | } |
| 34 | else | 39 | else |
| 35 | { | 40 | { |
| 36 | - Last_LaserMode = g_SideLaser_Control; | 41 | + Last_LaserMode = g_SideLaser_RealMode; |
| 37 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); | 42 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); |
| 38 | continue; | 43 | continue; |
| 39 | } | 44 | } |
| @@ -42,14 +47,14 @@ static void *SideLaserControl_task(void *arg) | @@ -42,14 +47,14 @@ static void *SideLaserControl_task(void *arg) | ||
| 42 | 47 | ||
| 43 | case SIDE_LASER_GREEN_AWALYS_ON: | 48 | case SIDE_LASER_GREEN_AWALYS_ON: |
| 44 | { | 49 | { |
| 45 | - if (Last_LaserMode == g_SideLaser_Control) | 50 | + if (Last_LaserMode == g_SideLaser_RealMode) |
| 46 | { | 51 | { |
| 47 | delayMs(10); | 52 | delayMs(10); |
| 48 | continue; | 53 | continue; |
| 49 | } | 54 | } |
| 50 | else | 55 | else |
| 51 | { | 56 | { |
| 52 | - Last_LaserMode = g_SideLaser_Control; | 57 | + Last_LaserMode = g_SideLaser_RealMode; |
| 53 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); | 58 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); |
| 54 | SideLaser_RealCotrol(0, JZ_FLAGCODE_ON); | 59 | SideLaser_RealCotrol(0, JZ_FLAGCODE_ON); |
| 55 | continue; | 60 | continue; |
| @@ -59,14 +64,14 @@ static void *SideLaserControl_task(void *arg) | @@ -59,14 +64,14 @@ static void *SideLaserControl_task(void *arg) | ||
| 59 | 64 | ||
| 60 | case SIDE_LASER_RED_AWALYS_ON: | 65 | case SIDE_LASER_RED_AWALYS_ON: |
| 61 | { | 66 | { |
| 62 | - if (Last_LaserMode == g_SideLaser_Control) | 67 | + if (Last_LaserMode == g_SideLaser_RealMode) |
| 63 | { | 68 | { |
| 64 | delayMs(10); | 69 | delayMs(10); |
| 65 | continue; | 70 | continue; |
| 66 | } | 71 | } |
| 67 | else | 72 | else |
| 68 | { | 73 | { |
| 69 | - Last_LaserMode = g_SideLaser_Control; | 74 | + Last_LaserMode = g_SideLaser_RealMode; |
| 70 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); | 75 | SideLaser_RealCotrol(255, JZ_FLAGCODE_OFF); |
| 71 | SideLaser_RealCotrol(1, JZ_FLAGCODE_ON); | 76 | SideLaser_RealCotrol(1, JZ_FLAGCODE_ON); |
| 72 | continue; | 77 | continue; |
| @@ -77,14 +82,14 @@ static void *SideLaserControl_task(void *arg) | @@ -77,14 +82,14 @@ static void *SideLaserControl_task(void *arg) | ||
| 77 | 82 | ||
| 78 | case SIDE_LASER_GREEN_AND_RED_AWALYS_ON: | 83 | case SIDE_LASER_GREEN_AND_RED_AWALYS_ON: |
| 79 | { | 84 | { |
| 80 | - if (Last_LaserMode == g_SideLaser_Control) | 85 | + if (Last_LaserMode == g_SideLaser_RealMode) |
| 81 | { | 86 | { |
| 82 | delayMs(10); | 87 | delayMs(10); |
| 83 | continue; | 88 | continue; |
| 84 | } | 89 | } |
| 85 | else | 90 | else |
| 86 | { | 91 | { |
| 87 | - Last_LaserMode = g_SideLaser_Control; | 92 | + Last_LaserMode = g_SideLaser_RealMode; |
| 88 | SideLaser_RealCotrol(255, JZ_FLAGCODE_ON); | 93 | SideLaser_RealCotrol(255, JZ_FLAGCODE_ON); |
| 89 | continue; | 94 | continue; |
| 90 | } | 95 | } |
| @@ -93,9 +98,9 @@ static void *SideLaserControl_task(void *arg) | @@ -93,9 +98,9 @@ static void *SideLaserControl_task(void *arg) | ||
| 93 | 98 | ||
| 94 | case SIDE_LASER_GREEN_ADD_RED_TOGETHER_FLICKER: | 99 | case SIDE_LASER_GREEN_ADD_RED_TOGETHER_FLICKER: |
| 95 | { | 100 | { |
| 96 | - if (Last_LaserMode != g_SideLaser_Control) | 101 | + if (Last_LaserMode != g_SideLaser_RealMode) |
| 97 | { | 102 | { |
| 98 | - Last_LaserMode = g_SideLaser_Control; | 103 | + Last_LaserMode = g_SideLaser_RealMode; |
| 99 | } | 104 | } |
| 100 | 105 | ||
| 101 | if (status == JZ_FLAGCODE_OFF) | 106 | if (status == JZ_FLAGCODE_OFF) |
| @@ -116,9 +121,9 @@ static void *SideLaserControl_task(void *arg) | @@ -116,9 +121,9 @@ static void *SideLaserControl_task(void *arg) | ||
| 116 | 121 | ||
| 117 | case SIDE_LASER_GREEN_ADD_RED_ALTERNATION_FLICKER: | 122 | case SIDE_LASER_GREEN_ADD_RED_ALTERNATION_FLICKER: |
| 118 | { | 123 | { |
| 119 | - if (Last_LaserMode != g_SideLaser_Control) | 124 | + if (Last_LaserMode != g_SideLaser_RealMode) |
| 120 | { | 125 | { |
| 121 | - Last_LaserMode = g_SideLaser_Control; | 126 | + Last_LaserMode = g_SideLaser_RealMode; |
| 122 | } | 127 | } |
| 123 | 128 | ||
| 124 | if (status == JZ_FLAGCODE_OFF) | 129 | if (status == JZ_FLAGCODE_OFF) |
| @@ -217,12 +222,23 @@ T_JZsdkReturnCode SideLaser_param(int flagcode, enum SideLaserParam paramflag, i | @@ -217,12 +222,23 @@ T_JZsdkReturnCode SideLaser_param(int flagcode, enum SideLaserParam paramflag, i | ||
| 217 | { | 222 | { |
| 218 | switch (paramflag) | 223 | switch (paramflag) |
| 219 | { | 224 | { |
| 225 | + case SIDELASER_REALMODE: | ||
| 226 | + { | ||
| 227 | + *value = g_SideLaser_RealMode; | ||
| 228 | + } | ||
| 229 | + break; | ||
| 230 | + | ||
| 220 | case SIDELASER_CONTROL: | 231 | case SIDELASER_CONTROL: |
| 221 | { | 232 | { |
| 222 | - *value = g_SideLaser_Control; | 233 | + *value = g_SideLaserControl; |
| 223 | } | 234 | } |
| 224 | break; | 235 | break; |
| 225 | 236 | ||
| 237 | + case SIDELASER_MODE: | ||
| 238 | + { | ||
| 239 | + *value = g_SideLaserMode; | ||
| 240 | + } | ||
| 241 | + | ||
| 226 | default: | 242 | default: |
| 227 | { | 243 | { |
| 228 | *value = JZ_FLAGCODE_OFF; | 244 | *value = JZ_FLAGCODE_OFF; |
| @@ -238,8 +254,32 @@ T_JZsdkReturnCode SideLaser_param(int flagcode, enum SideLaserParam paramflag, i | @@ -238,8 +254,32 @@ T_JZsdkReturnCode SideLaser_param(int flagcode, enum SideLaserParam paramflag, i | ||
| 238 | { | 254 | { |
| 239 | case SIDELASER_CONTROL: | 255 | case SIDELASER_CONTROL: |
| 240 | { | 256 | { |
| 241 | - g_SideLaser_Control = *value; | ||
| 242 | - JZSDK_LOG_INFO("设置激光模式:%d",g_SideLaser_Control); | 257 | + g_SideLaserControl = *value; |
| 258 | + JZSDK_LOG_INFO("设置激光控制值:%d",g_SideLaserControl); | ||
| 259 | + //从灯光的模式和控制计算得到实际控制值 | ||
| 260 | + if (g_SideLaserControl == JZ_FLAGCODE_OFF) | ||
| 261 | + { | ||
| 262 | + g_SideLaser_RealMode = SIDE_LASER_OFF; | ||
| 263 | + } | ||
| 264 | + else | ||
| 265 | + { | ||
| 266 | + g_SideLaser_RealMode = g_SideLaserMode+1; | ||
| 267 | + } | ||
| 268 | + } | ||
| 269 | + break; | ||
| 270 | + | ||
| 271 | + case SIDELASER_MODE: | ||
| 272 | + { | ||
| 273 | + g_SideLaserMode = *value; | ||
| 274 | + JZSDK_LOG_INFO("设置激光模式值:%d",g_SideLaserMode); | ||
| 275 | + if (g_SideLaserControl == JZ_FLAGCODE_OFF) | ||
| 276 | + { | ||
| 277 | + g_SideLaser_RealMode = SIDE_LASER_OFF; | ||
| 278 | + } | ||
| 279 | + else | ||
| 280 | + { | ||
| 281 | + g_SideLaser_RealMode = g_SideLaserMode+1; | ||
| 282 | + } | ||
| 243 | } | 283 | } |
| 244 | break; | 284 | break; |
| 245 | 285 |
| @@ -43,7 +43,9 @@ typedef enum T_SideLaserMode | @@ -43,7 +43,9 @@ typedef enum T_SideLaserMode | ||
| 43 | * **********/ | 43 | * **********/ |
| 44 | typedef enum SideLaserParam | 44 | typedef enum SideLaserParam |
| 45 | { | 45 | { |
| 46 | + SIDELASER_REALMODE = 0x000000, | ||
| 46 | SIDELASER_CONTROL = 0x000001, | 47 | SIDELASER_CONTROL = 0x000001, |
| 48 | + SIDELASER_MODE = 0x000002, | ||
| 47 | }SideLaserParam; | 49 | }SideLaserParam; |
| 48 | 50 | ||
| 49 | /* Exported types ------------------------------------------------------------*/ | 51 | /* Exported types ------------------------------------------------------------*/ |
| @@ -1585,7 +1585,15 @@ T_JZsdkReturnCode JZsdk_Psdk_UI_io_SideLaserMode(int wheather_ChangeWidget, int | @@ -1585,7 +1585,15 @@ T_JZsdkReturnCode JZsdk_Psdk_UI_io_SideLaserMode(int wheather_ChangeWidget, int | ||
| 1585 | //如果进行控制 | 1585 | //如果进行控制 |
| 1586 | if (wheather_control == JZ_FLAGCODE_ON) | 1586 | if (wheather_control == JZ_FLAGCODE_ON) |
| 1587 | { | 1587 | { |
| 1588 | - UIcontrol_SideLaser_Mode(DEVICE_PSDK, value); | 1588 | + if (value == 0) |
| 1589 | + { | ||
| 1590 | + UIcontrol_SideLaser_SetControl(DEVICE_PSDK, JZ_FLAGCODE_OFF); | ||
| 1591 | + } | ||
| 1592 | + else | ||
| 1593 | + { | ||
| 1594 | + UIcontrol_SideLaser_SetMode(DEVICE_PSDK, value); | ||
| 1595 | + UIcontrol_SideLaser_SetControl(DEVICE_PSDK, JZ_FLAGCODE_ON); | ||
| 1596 | + } | ||
| 1589 | } | 1597 | } |
| 1590 | 1598 | ||
| 1591 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 1599 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| @@ -117,17 +117,17 @@ T_JZsdkReturnCode UIcontrol_SetVolume(int DeviceName,int value) | @@ -117,17 +117,17 @@ T_JZsdkReturnCode UIcontrol_SetVolume(int DeviceName,int value) | ||
| 117 | //如果4G模块有启动 | 117 | //如果4G模块有启动 |
| 118 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 118 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 119 | { | 119 | { |
| 120 | - HalSend_type1Send_Reply_Volume(UART_4G, Volume); | 120 | + HalSend_type1Send_Reply_Volume(UART_4G, 0, Volume); |
| 121 | } | 121 | } |
| 122 | //如果设备1有启动 | 122 | //如果设备1有启动 |
| 123 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 123 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 124 | { | 124 | { |
| 125 | - HalSend_type1Send_Reply_Volume(UART_DEV_1, Volume); | 125 | + HalSend_type1Send_Reply_Volume(UART_DEV_1, 0, Volume); |
| 126 | } | 126 | } |
| 127 | //如果设备2有启动 | 127 | //如果设备2有启动 |
| 128 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 128 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 129 | { | 129 | { |
| 130 | - HalSend_type1Send_Reply_Volume(UART_DEV_2, Volume); | 130 | + HalSend_type1Send_Reply_Volume(UART_DEV_2, 0, Volume); |
| 131 | } | 131 | } |
| 132 | //如果psdk接口已经使用 | 132 | //如果psdk接口已经使用 |
| 133 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 133 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -161,17 +161,17 @@ T_JZsdkReturnCode UIcontrol_Set_AudioPlayLoop(int DeviceName,int value) | @@ -161,17 +161,17 @@ T_JZsdkReturnCode UIcontrol_Set_AudioPlayLoop(int DeviceName,int value) | ||
| 161 | //如果4G模块有启动 | 161 | //如果4G模块有启动 |
| 162 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 162 | if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 163 | { | 163 | { |
| 164 | - HalSend_type1Send_Reply_LoopPlayStatus(UART_4G, PlayLoopStatus); | 164 | + HalSend_type1Send_Reply_LoopPlayStatus(UART_4G, 0, PlayLoopStatus); |
| 165 | } | 165 | } |
| 166 | //如果设备1有启动 | 166 | //如果设备1有启动 |
| 167 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 167 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 168 | { | 168 | { |
| 169 | - HalSend_type1Send_Reply_LoopPlayStatus(UART_DEV_1, PlayLoopStatus); | 169 | + HalSend_type1Send_Reply_LoopPlayStatus(UART_DEV_1, 0, PlayLoopStatus); |
| 170 | } | 170 | } |
| 171 | //如果设备2有启动 | 171 | //如果设备2有启动 |
| 172 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 172 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 173 | { | 173 | { |
| 174 | - HalSend_type1Send_Reply_LoopPlayStatus(UART_DEV_2, PlayLoopStatus); | 174 | + HalSend_type1Send_Reply_LoopPlayStatus(UART_DEV_2, 0, PlayLoopStatus); |
| 175 | } | 175 | } |
| 176 | //如果psdk接口已经使用 | 176 | //如果psdk接口已经使用 |
| 177 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 177 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -254,17 +254,17 @@ T_JZsdkReturnCode UIcontrol_OpusRealTimeVoice_Start(int DeviceName, int BitRate) | @@ -254,17 +254,17 @@ T_JZsdkReturnCode UIcontrol_OpusRealTimeVoice_Start(int DeviceName, int BitRate) | ||
| 254 | //如果4G模块有启动 | 254 | //如果4G模块有启动 |
| 255 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 255 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 256 | { | 256 | { |
| 257 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 257 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 258 | } | 258 | } |
| 259 | //如果设备1有启动 | 259 | //如果设备1有启动 |
| 260 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 260 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 261 | { | 261 | { |
| 262 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 262 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 263 | } | 263 | } |
| 264 | //如果设备2有启动 | 264 | //如果设备2有启动 |
| 265 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 265 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 266 | { | 266 | { |
| 267 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 267 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 268 | } | 268 | } |
| 269 | //如果psdk接口已经使用 | 269 | //如果psdk接口已经使用 |
| 270 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 270 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -315,17 +315,17 @@ T_JZsdkReturnCode UIcontrol_OpusRealTimeVoice_Close(int DeviceName) | @@ -315,17 +315,17 @@ T_JZsdkReturnCode UIcontrol_OpusRealTimeVoice_Close(int DeviceName) | ||
| 315 | //如果4G模块有启动 | 315 | //如果4G模块有启动 |
| 316 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 316 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 317 | { | 317 | { |
| 318 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 318 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 319 | } | 319 | } |
| 320 | //如果设备1有启动 | 320 | //如果设备1有启动 |
| 321 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 321 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 322 | { | 322 | { |
| 323 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 323 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 324 | } | 324 | } |
| 325 | //如果设备2有启动 | 325 | //如果设备2有启动 |
| 326 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 326 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 327 | { | 327 | { |
| 328 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 328 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 329 | } | 329 | } |
| 330 | //如果psdk接口已经使用 | 330 | //如果psdk接口已经使用 |
| 331 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 331 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -364,17 +364,17 @@ T_JZsdkReturnCode UIcontrol_PlayAudioFile(int DeviceName, char *MusicName, int M | @@ -364,17 +364,17 @@ T_JZsdkReturnCode UIcontrol_PlayAudioFile(int DeviceName, char *MusicName, int M | ||
| 364 | //如果4G模块有启动 | 364 | //如果4G模块有启动 |
| 365 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 365 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 366 | { | 366 | { |
| 367 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 367 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 368 | } | 368 | } |
| 369 | //如果设备1有启动 | 369 | //如果设备1有启动 |
| 370 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 370 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 371 | { | 371 | { |
| 372 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 372 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 373 | } | 373 | } |
| 374 | //如果设备2有启动 | 374 | //如果设备2有启动 |
| 375 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 375 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 376 | { | 376 | { |
| 377 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 377 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 378 | } | 378 | } |
| 379 | //如果psdk接口已经使用 | 379 | //如果psdk接口已经使用 |
| 380 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 380 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -408,17 +408,17 @@ T_JZsdkReturnCode UIcontrol_StopPlayAudio(int DeviceName) | @@ -408,17 +408,17 @@ T_JZsdkReturnCode UIcontrol_StopPlayAudio(int DeviceName) | ||
| 408 | //如果4G模块有启动 | 408 | //如果4G模块有启动 |
| 409 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 409 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 410 | { | 410 | { |
| 411 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 411 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 412 | } | 412 | } |
| 413 | //如果设备1有启动 | 413 | //如果设备1有启动 |
| 414 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 414 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 415 | { | 415 | { |
| 416 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 416 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 417 | } | 417 | } |
| 418 | //如果设备2有启动 | 418 | //如果设备2有启动 |
| 419 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 419 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 420 | { | 420 | { |
| 421 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 421 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 422 | } | 422 | } |
| 423 | //如果psdk接口已经使用 | 423 | //如果psdk接口已经使用 |
| 424 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 424 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -452,17 +452,17 @@ T_JZsdkReturnCode UIcontrol_PausePlayAudio(int DeviceName) | @@ -452,17 +452,17 @@ T_JZsdkReturnCode UIcontrol_PausePlayAudio(int DeviceName) | ||
| 452 | //如果4G模块有启动 | 452 | //如果4G模块有启动 |
| 453 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 453 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 454 | { | 454 | { |
| 455 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 455 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 456 | } | 456 | } |
| 457 | //如果设备1有启动 | 457 | //如果设备1有启动 |
| 458 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 458 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 459 | { | 459 | { |
| 460 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 460 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 461 | } | 461 | } |
| 462 | //如果设备2有启动 | 462 | //如果设备2有启动 |
| 463 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 463 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 464 | { | 464 | { |
| 465 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 465 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 466 | } | 466 | } |
| 467 | //如果psdk接口已经使用 | 467 | //如果psdk接口已经使用 |
| 468 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 468 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -497,17 +497,17 @@ T_JZsdkReturnCode UIcontrol_ContinuePlayAudio(int DeviceName) | @@ -497,17 +497,17 @@ T_JZsdkReturnCode UIcontrol_ContinuePlayAudio(int DeviceName) | ||
| 497 | //如果4G模块有启动 | 497 | //如果4G模块有启动 |
| 498 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 498 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 499 | { | 499 | { |
| 500 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 500 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 501 | } | 501 | } |
| 502 | //如果设备1有启动 | 502 | //如果设备1有启动 |
| 503 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 503 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 504 | { | 504 | { |
| 505 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 505 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 506 | } | 506 | } |
| 507 | //如果设备2有启动 | 507 | //如果设备2有启动 |
| 508 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 508 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 509 | { | 509 | { |
| 510 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 510 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 511 | } | 511 | } |
| 512 | //如果psdk接口已经使用 | 512 | //如果psdk接口已经使用 |
| 513 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 513 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -542,17 +542,17 @@ T_JZsdkReturnCode UIcontrol_LastSong(int DeviceName) | @@ -542,17 +542,17 @@ T_JZsdkReturnCode UIcontrol_LastSong(int DeviceName) | ||
| 542 | //如果4G模块有启动 | 542 | //如果4G模块有启动 |
| 543 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 543 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 544 | { | 544 | { |
| 545 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 545 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 546 | } | 546 | } |
| 547 | //如果设备1有启动 | 547 | //如果设备1有启动 |
| 548 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 548 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 549 | { | 549 | { |
| 550 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 550 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 551 | } | 551 | } |
| 552 | //如果设备2有启动 | 552 | //如果设备2有启动 |
| 553 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 553 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 554 | { | 554 | { |
| 555 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 555 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 556 | } | 556 | } |
| 557 | //如果psdk接口已经使用 | 557 | //如果psdk接口已经使用 |
| 558 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 558 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -586,17 +586,17 @@ T_JZsdkReturnCode UIcontrol_NextSong(int DeviceName) | @@ -586,17 +586,17 @@ T_JZsdkReturnCode UIcontrol_NextSong(int DeviceName) | ||
| 586 | //如果4G模块有启动 | 586 | //如果4G模块有启动 |
| 587 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 587 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 588 | { | 588 | { |
| 589 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 589 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 590 | } | 590 | } |
| 591 | //如果设备1有启动 | 591 | //如果设备1有启动 |
| 592 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 592 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 593 | { | 593 | { |
| 594 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 594 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 595 | } | 595 | } |
| 596 | //如果设备2有启动 | 596 | //如果设备2有启动 |
| 597 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 597 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 598 | { | 598 | { |
| 599 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 599 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 600 | } | 600 | } |
| 601 | //如果psdk接口已经使用 | 601 | //如果psdk接口已经使用 |
| 602 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 602 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -638,17 +638,17 @@ T_JZsdkReturnCode UIcontrol_Opus_PlayFixedFile(int DeviceName) | @@ -638,17 +638,17 @@ T_JZsdkReturnCode UIcontrol_Opus_PlayFixedFile(int DeviceName) | ||
| 638 | //如果4G模块有启动 | 638 | //如果4G模块有启动 |
| 639 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 639 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 640 | { | 640 | { |
| 641 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 641 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 642 | } | 642 | } |
| 643 | //如果设备1有启动 | 643 | //如果设备1有启动 |
| 644 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 644 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 645 | { | 645 | { |
| 646 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 646 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 647 | } | 647 | } |
| 648 | //如果设备2有启动 | 648 | //如果设备2有启动 |
| 649 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 649 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 650 | { | 650 | { |
| 651 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 651 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 652 | } | 652 | } |
| 653 | //如果psdk接口已经使用 | 653 | //如果psdk接口已经使用 |
| 654 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 654 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -685,17 +685,17 @@ T_JZsdkReturnCode UIcontrol_Pcm_PlayListFile(int DeviceName, unsigned char *File | @@ -685,17 +685,17 @@ T_JZsdkReturnCode UIcontrol_Pcm_PlayListFile(int DeviceName, unsigned char *File | ||
| 685 | //如果4G模块有启动 | 685 | //如果4G模块有启动 |
| 686 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 686 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 687 | { | 687 | { |
| 688 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 688 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 689 | } | 689 | } |
| 690 | //如果设备1有启动 | 690 | //如果设备1有启动 |
| 691 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 691 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 692 | { | 692 | { |
| 693 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 693 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 694 | } | 694 | } |
| 695 | //如果设备2有启动 | 695 | //如果设备2有启动 |
| 696 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 696 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 697 | { | 697 | { |
| 698 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 698 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 699 | } | 699 | } |
| 700 | //如果psdk接口已经使用 | 700 | //如果psdk接口已经使用 |
| 701 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 701 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -734,17 +734,17 @@ T_JZsdkReturnCode UIcontrol_TTS_Play(int DeviceName, char *data, int len) | @@ -734,17 +734,17 @@ T_JZsdkReturnCode UIcontrol_TTS_Play(int DeviceName, char *data, int len) | ||
| 734 | //如果4G模块有启动 | 734 | //如果4G模块有启动 |
| 735 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 735 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 736 | { | 736 | { |
| 737 | - HalSend_type1Send_Send_PlayStatus(UART_4G, PlayStatus); | 737 | + HalSend_type1Send_Send_PlayStatus(UART_4G, 0, PlayStatus); |
| 738 | } | 738 | } |
| 739 | //如果设备1有启动 | 739 | //如果设备1有启动 |
| 740 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 740 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 741 | { | 741 | { |
| 742 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_1, PlayStatus); | 742 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_1, 0, PlayStatus); |
| 743 | } | 743 | } |
| 744 | //如果设备2有启动 | 744 | //如果设备2有启动 |
| 745 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 745 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 746 | { | 746 | { |
| 747 | - HalSend_type1Send_Send_PlayStatus(UART_DEV_2, PlayStatus); | 747 | + HalSend_type1Send_Send_PlayStatus(UART_DEV_2, 0, PlayStatus); |
| 748 | } | 748 | } |
| 749 | //如果psdk接口已经使用 | 749 | //如果psdk接口已经使用 |
| 750 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 750 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -778,17 +778,17 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_tone(int DeviceName,int value) | @@ -778,17 +778,17 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_tone(int DeviceName,int value) | ||
| 778 | //如果4G模块有启动 | 778 | //如果4G模块有启动 |
| 779 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 779 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 780 | { | 780 | { |
| 781 | - HalSend_type1Send_Reply_TTS_tone(UART_4G, TTS_tone); | 781 | + HalSend_type1Send_Reply_TTS_tone(UART_4G, 0, TTS_tone); |
| 782 | } | 782 | } |
| 783 | //如果设备1有启动 | 783 | //如果设备1有启动 |
| 784 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 784 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 785 | { | 785 | { |
| 786 | - HalSend_type1Send_Reply_TTS_tone(UART_DEV_1, TTS_tone); | 786 | + HalSend_type1Send_Reply_TTS_tone(UART_DEV_1, 0, TTS_tone); |
| 787 | } | 787 | } |
| 788 | //如果设备2有启动 | 788 | //如果设备2有启动 |
| 789 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 789 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 790 | { | 790 | { |
| 791 | - HalSend_type1Send_Reply_TTS_tone(UART_DEV_2, TTS_tone); | 791 | + HalSend_type1Send_Reply_TTS_tone(UART_DEV_2, 0, TTS_tone); |
| 792 | } | 792 | } |
| 793 | //如果psdk接口已经使用 | 793 | //如果psdk接口已经使用 |
| 794 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 794 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -822,17 +822,17 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_speed(int DeviceName,int value) | @@ -822,17 +822,17 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_speed(int DeviceName,int value) | ||
| 822 | //如果4G模块有启动 | 822 | //如果4G模块有启动 |
| 823 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 823 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 824 | { | 824 | { |
| 825 | - HalSend_type1Send_Reply_TTS_speed(UART_4G, TTS_speed); | 825 | + HalSend_type1Send_Reply_TTS_speed(UART_4G, 0, TTS_speed); |
| 826 | } | 826 | } |
| 827 | //如果设备1有启动 | 827 | //如果设备1有启动 |
| 828 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 828 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 829 | { | 829 | { |
| 830 | - HalSend_type1Send_Reply_TTS_speed(UART_DEV_1, TTS_speed); | 830 | + HalSend_type1Send_Reply_TTS_speed(UART_DEV_1, 0, TTS_speed); |
| 831 | } | 831 | } |
| 832 | //如果设备2有启动 | 832 | //如果设备2有启动 |
| 833 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 833 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 834 | { | 834 | { |
| 835 | - HalSend_type1Send_Reply_TTS_speed(UART_DEV_2, TTS_speed); | 835 | + HalSend_type1Send_Reply_TTS_speed(UART_DEV_2, 0, TTS_speed); |
| 836 | } | 836 | } |
| 837 | //如果psdk接口已经使用 | 837 | //如果psdk接口已经使用 |
| 838 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 838 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -910,17 +910,17 @@ T_JZsdkReturnCode UIcontrol_Set_GimbalPitchAngle(int DeviceName,int value) | @@ -910,17 +910,17 @@ T_JZsdkReturnCode UIcontrol_Set_GimbalPitchAngle(int DeviceName,int value) | ||
| 910 | //如果4G模块有启动 | 910 | //如果4G模块有启动 |
| 911 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 911 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 912 | { | 912 | { |
| 913 | - HalSend_type1Send_Reply_GimbalPitchAngle(UART_4G, GimbalPitchAngle); | 913 | + HalSend_type1Send_Reply_GimbalPitchAngle(UART_4G, 0, GimbalPitchAngle); |
| 914 | } | 914 | } |
| 915 | //如果设备1有启动 | 915 | //如果设备1有启动 |
| 916 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 916 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 917 | { | 917 | { |
| 918 | - HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_1, GimbalPitchAngle); | 918 | + HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_1, 0, GimbalPitchAngle); |
| 919 | } | 919 | } |
| 920 | //如果设备2有启动 | 920 | //如果设备2有启动 |
| 921 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 921 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 922 | { | 922 | { |
| 923 | - //HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_2, GimbalPitchAngle); | 923 | + //HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_2, 0, GimbalPitchAngle); |
| 924 | } | 924 | } |
| 925 | //如果psdk接口已经使用 | 925 | //如果psdk接口已经使用 |
| 926 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 926 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -1805,17 +1805,17 @@ T_JZsdkReturnCode UIcontrol_ObtainGimbal_Pitch(int DeviceName, int GimbalPitchAn | @@ -1805,17 +1805,17 @@ T_JZsdkReturnCode UIcontrol_ObtainGimbal_Pitch(int DeviceName, int GimbalPitchAn | ||
| 1805 | //如果4G模块有启动 | 1805 | //如果4G模块有启动 |
| 1806 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | 1806 | if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) |
| 1807 | { | 1807 | { |
| 1808 | - HalSend_type1Send_Reply_GimbalPitchAngle(UART_4G, GimbalPitchAngle); | 1808 | + HalSend_type1Send_Reply_GimbalPitchAngle(UART_4G, 0, GimbalPitchAngle); |
| 1809 | } | 1809 | } |
| 1810 | //如果设备1有启动 | 1810 | //如果设备1有启动 |
| 1811 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | 1811 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) |
| 1812 | { | 1812 | { |
| 1813 | - HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_1, GimbalPitchAngle); | 1813 | + HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_1, 0, GimbalPitchAngle); |
| 1814 | } | 1814 | } |
| 1815 | //如果设备2有启动 | 1815 | //如果设备2有启动 |
| 1816 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | 1816 | if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) |
| 1817 | { | 1817 | { |
| 1818 | - HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_2, GimbalPitchAngle); | 1818 | + HalSend_type1Send_Reply_GimbalPitchAngle(UART_DEV_2, 0, GimbalPitchAngle); |
| 1819 | } | 1819 | } |
| 1820 | //如果psdk接口已经使用 | 1820 | //如果psdk接口已经使用 |
| 1821 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 1821 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| @@ -2481,7 +2481,7 @@ T_JZsdkReturnCode UIcontrol_DeviceMessage_SetMessageMode(int value) | @@ -2481,7 +2481,7 @@ T_JZsdkReturnCode UIcontrol_DeviceMessage_SetMessageMode(int value) | ||
| 2481 | * | 2481 | * |
| 2482 | * | 2482 | * |
| 2483 | **************************************************************************************************************************************************************/ | 2483 | **************************************************************************************************************************************************************/ |
| 2484 | -T_JZsdkReturnCode UIcontrol_SideLaser_Mode(int DeviceName, int value) | 2484 | +T_JZsdkReturnCode UIcontrol_SideLaser_SetControl(int DeviceName, int value) |
| 2485 | { | 2485 | { |
| 2486 | T_JZsdkReturnCode ret; | 2486 | T_JZsdkReturnCode ret; |
| 2487 | #ifdef SIDE_LASER_STATUS_ON | 2487 | #ifdef SIDE_LASER_STATUS_ON |
| @@ -2507,7 +2507,48 @@ T_JZsdkReturnCode UIcontrol_SideLaser_Mode(int DeviceName, int value) | @@ -2507,7 +2507,48 @@ T_JZsdkReturnCode UIcontrol_SideLaser_Mode(int DeviceName, int value) | ||
| 2507 | //如果psdk接口已经使用 | 2507 | //如果psdk接口已经使用 |
| 2508 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | 2508 | if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) |
| 2509 | { | 2509 | { |
| 2510 | - JZsdk_Psdk_UI_io_SideLaserMode(JZ_FLAGCODE_ON, JZ_FLAGCODE_OFF, value); | 2510 | + int RealMode; |
| 2511 | + //psdk的ui是开关和模式一起的,所以需要另外获取 | ||
| 2512 | + SideLaser_param(JZ_FLAGCODE_GET, SIDELASER_REALMODE, &RealMode); | ||
| 2513 | + JZsdk_Psdk_UI_io_SideLaserMode(JZ_FLAGCODE_ON, JZ_FLAGCODE_OFF, RealMode); | ||
| 2514 | + } | ||
| 2515 | + | ||
| 2516 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 2517 | +#else | ||
| 2518 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 2519 | +#endif | ||
| 2520 | +} | ||
| 2521 | + | ||
| 2522 | +T_JZsdkReturnCode UIcontrol_SideLaser_SetMode(int DeviceName, int value) | ||
| 2523 | +{ | ||
| 2524 | + T_JZsdkReturnCode ret; | ||
| 2525 | +#ifdef SIDE_LASER_STATUS_ON | ||
| 2526 | + //设置参数 | ||
| 2527 | + ret = SideLaser_param(JZ_FLAGCODE_SET, SIDELASER_MODE, &value); | ||
| 2528 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 2529 | + { | ||
| 2530 | + return ret; | ||
| 2531 | + } | ||
| 2532 | + | ||
| 2533 | + //2、通知其他设备变化 | ||
| 2534 | + if ((JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) && (DeviceName != UART_4G) ) | ||
| 2535 | + { | ||
| 2536 | + } | ||
| 2537 | + //如果设备1有启动 | ||
| 2538 | + if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_1) ) | ||
| 2539 | + { | ||
| 2540 | + } | ||
| 2541 | + //如果设备2有启动 | ||
| 2542 | + if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) | ||
| 2543 | + { | ||
| 2544 | + } | ||
| 2545 | + //如果psdk接口已经使用 | ||
| 2546 | + if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) | ||
| 2547 | + { | ||
| 2548 | + int RealMode; | ||
| 2549 | + //psdk的ui是开关和模式一起的,所以需要另外获取 | ||
| 2550 | + SideLaser_param(JZ_FLAGCODE_GET, SIDELASER_REALMODE, &RealMode); | ||
| 2551 | + JZsdk_Psdk_UI_io_SideLaserMode(JZ_FLAGCODE_ON, JZ_FLAGCODE_OFF, RealMode); | ||
| 2511 | } | 2552 | } |
| 2512 | 2553 | ||
| 2513 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 2554 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| @@ -141,7 +141,8 @@ T_JZsdkReturnCode UIcontrol_Broadcast_PlayStatus_end(); | @@ -141,7 +141,8 @@ T_JZsdkReturnCode UIcontrol_Broadcast_PlayStatus_end(); | ||
| 141 | T_JZsdkReturnCode UIcontrol_Broadcast_SecondaryDeviceName(int name); | 141 | T_JZsdkReturnCode UIcontrol_Broadcast_SecondaryDeviceName(int name); |
| 142 | 142 | ||
| 143 | //激光 | 143 | //激光 |
| 144 | -T_JZsdkReturnCode UIcontrol_SideLaser_Mode(int DeviceName, int value); | 144 | +T_JZsdkReturnCode UIcontrol_SideLaser_SetControl(int DeviceName, int value); |
| 145 | +T_JZsdkReturnCode UIcontrol_SideLaser_SetMode(int DeviceName, int value); | ||
| 145 | 146 | ||
| 146 | 147 | ||
| 147 | 148 |
| @@ -28,18 +28,18 @@ The CXX compiler identification is GNU, found in "/mnt/hgfs/share/JZSDK_Linux/pr | @@ -28,18 +28,18 @@ The CXX compiler identification is GNU, found in "/mnt/hgfs/share/JZSDK_Linux/pr | ||
| 28 | Detecting C compiler ABI info compiled with the following output: | 28 | Detecting C compiler ABI info compiled with the following output: |
| 29 | Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp | 29 | Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp |
| 30 | 30 | ||
| 31 | -Run Build Command(s):/usr/bin/make -f Makefile cmTC_75746/fast && /usr/bin/make -f CMakeFiles/cmTC_75746.dir/build.make CMakeFiles/cmTC_75746.dir/build | 31 | +Run Build Command(s):/usr/bin/make -f Makefile cmTC_05aaf/fast && /usr/bin/make -f CMakeFiles/cmTC_05aaf.dir/build.make CMakeFiles/cmTC_05aaf.dir/build |
| 32 | make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' | 32 | make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' |
| 33 | -Building C object CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o | ||
| 34 | -/usr/bin/cc -v -o CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c | 33 | +Building C object CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o |
| 34 | +/usr/bin/cc -v -o CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c | ||
| 35 | Using built-in specs. | 35 | Using built-in specs. |
| 36 | COLLECT_GCC=/usr/bin/cc | 36 | COLLECT_GCC=/usr/bin/cc |
| 37 | Target: x86_64-linux-gnu | 37 | Target: x86_64-linux-gnu |
| 38 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu | 38 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu |
| 39 | Thread model: posix | 39 | Thread model: posix |
| 40 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) | 40 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) |
| 41 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' | ||
| 42 | - /usr/lib/gcc/x86_64-linux-gnu/5/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccLoxYGB.s | 41 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' |
| 42 | + /usr/lib/gcc/x86_64-linux-gnu/5/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccgfaTwH.s | ||
| 43 | GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu) | 43 | GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu) |
| 44 | compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 | 44 | compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 |
| 45 | warning: GMP header version 6.1.0 differs from library version 6.1.2. | 45 | warning: GMP header version 6.1.0 differs from library version 6.1.2. |
| @@ -59,15 +59,15 @@ GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gn | @@ -59,15 +59,15 @@ GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gn | ||
| 59 | warning: GMP header version 6.1.0 differs from library version 6.1.2. | 59 | warning: GMP header version 6.1.0 differs from library version 6.1.2. |
| 60 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 | 60 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 |
| 61 | Compiler executable checksum: 8087146d2ee737d238113fb57fabb1f2 | 61 | Compiler executable checksum: 8087146d2ee737d238113fb57fabb1f2 |
| 62 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' | ||
| 63 | - as -v --64 -o CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o /tmp/ccLoxYGB.s | 62 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' |
| 63 | + as -v --64 -o CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o /tmp/ccgfaTwH.s | ||
| 64 | GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 | 64 | GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 |
| 65 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ | 65 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ |
| 66 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ | 66 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ |
| 67 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' | ||
| 68 | -Linking C executable cmTC_75746 | ||
| 69 | -/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_75746.dir/link.txt --verbose=1 | ||
| 70 | -/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -o cmTC_75746 | 67 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64' |
| 68 | +Linking C executable cmTC_05aaf | ||
| 69 | +/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05aaf.dir/link.txt --verbose=1 | ||
| 70 | +/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -o cmTC_05aaf | ||
| 71 | Using built-in specs. | 71 | Using built-in specs. |
| 72 | COLLECT_GCC=/usr/bin/cc | 72 | COLLECT_GCC=/usr/bin/cc |
| 73 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper | 73 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper |
| @@ -77,8 +77,8 @@ Thread model: posix | @@ -77,8 +77,8 @@ Thread model: posix | ||
| 77 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) | 77 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) |
| 78 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ | 78 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ |
| 79 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ | 79 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ |
| 80 | -COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_75746' '-mtune=generic' '-march=x86-64' | ||
| 81 | - /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccEQv1JE.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_75746 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o | 80 | +COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_05aaf' '-mtune=generic' '-march=x86-64' |
| 81 | + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpvjJbK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_05aaf /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o | ||
| 82 | make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' | 82 | make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' |
| 83 | 83 | ||
| 84 | 84 | ||
| @@ -104,18 +104,18 @@ Parsed C implicit link information from above output: | @@ -104,18 +104,18 @@ Parsed C implicit link information from above output: | ||
| 104 | link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] | 104 | link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] |
| 105 | ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] | 105 | ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] |
| 106 | ignore line: [] | 106 | ignore line: [] |
| 107 | - ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_75746/fast && /usr/bin/make -f CMakeFiles/cmTC_75746.dir/build.make CMakeFiles/cmTC_75746.dir/build] | 107 | + ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_05aaf/fast && /usr/bin/make -f CMakeFiles/cmTC_05aaf.dir/build.make CMakeFiles/cmTC_05aaf.dir/build] |
| 108 | ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] | 108 | ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] |
| 109 | - ignore line: [Building C object CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o] | ||
| 110 | - ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c] | 109 | + ignore line: [Building C object CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o] |
| 110 | + ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c] | ||
| 111 | ignore line: [Using built-in specs.] | 111 | ignore line: [Using built-in specs.] |
| 112 | ignore line: [COLLECT_GCC=/usr/bin/cc] | 112 | ignore line: [COLLECT_GCC=/usr/bin/cc] |
| 113 | ignore line: [Target: x86_64-linux-gnu] | 113 | ignore line: [Target: x86_64-linux-gnu] |
| 114 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c ada c++ java go d fortran objc obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] | 114 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c ada c++ java go d fortran objc obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] |
| 115 | ignore line: [Thread model: posix] | 115 | ignore line: [Thread model: posix] |
| 116 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] | 116 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] |
| 117 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] | ||
| 118 | - ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/5/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccLoxYGB.s] | 117 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] |
| 118 | + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/5/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/local/share/cmake-3.24/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccgfaTwH.s] | ||
| 119 | ignore line: [GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)] | 119 | ignore line: [GNU C11 (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)] |
| 120 | ignore line: [ compiled by GNU C version 5.4.0 20160609 GMP version 6.1.0 MPFR version 3.1.4 MPC version 1.0.3] | 120 | ignore line: [ compiled by GNU C version 5.4.0 20160609 GMP version 6.1.0 MPFR version 3.1.4 MPC version 1.0.3] |
| 121 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] | 121 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] |
| @@ -135,15 +135,15 @@ Parsed C implicit link information from above output: | @@ -135,15 +135,15 @@ Parsed C implicit link information from above output: | ||
| 135 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] | 135 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] |
| 136 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] | 136 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] |
| 137 | ignore line: [Compiler executable checksum: 8087146d2ee737d238113fb57fabb1f2] | 137 | ignore line: [Compiler executable checksum: 8087146d2ee737d238113fb57fabb1f2] |
| 138 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] | ||
| 139 | - ignore line: [ as -v --64 -o CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o /tmp/ccLoxYGB.s] | 138 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] |
| 139 | + ignore line: [ as -v --64 -o CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o /tmp/ccgfaTwH.s] | ||
| 140 | ignore line: [GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1] | 140 | ignore line: [GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1] |
| 141 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] | 141 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] |
| 142 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] | 142 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] |
| 143 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] | ||
| 144 | - ignore line: [Linking C executable cmTC_75746] | ||
| 145 | - ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_75746.dir/link.txt --verbose=1] | ||
| 146 | - ignore line: [/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -o cmTC_75746 ] | 143 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'] |
| 144 | + ignore line: [Linking C executable cmTC_05aaf] | ||
| 145 | + ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05aaf.dir/link.txt --verbose=1] | ||
| 146 | + ignore line: [/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -o cmTC_05aaf ] | ||
| 147 | ignore line: [Using built-in specs.] | 147 | ignore line: [Using built-in specs.] |
| 148 | ignore line: [COLLECT_GCC=/usr/bin/cc] | 148 | ignore line: [COLLECT_GCC=/usr/bin/cc] |
| 149 | ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] | 149 | ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] |
| @@ -153,13 +153,13 @@ Parsed C implicit link information from above output: | @@ -153,13 +153,13 @@ Parsed C implicit link information from above output: | ||
| 153 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] | 153 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] |
| 154 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] | 154 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] |
| 155 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] | 155 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] |
| 156 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_75746' '-mtune=generic' '-march=x86-64'] | ||
| 157 | - link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccEQv1JE.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_75746 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] | 156 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_05aaf' '-mtune=generic' '-march=x86-64'] |
| 157 | + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpvjJbK.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_05aaf /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] | ||
| 158 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore | 158 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore |
| 159 | arg [-plugin] ==> ignore | 159 | arg [-plugin] ==> ignore |
| 160 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore | 160 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore |
| 161 | arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore | 161 | arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore |
| 162 | - arg [-plugin-opt=-fresolution=/tmp/ccEQv1JE.res] ==> ignore | 162 | + arg [-plugin-opt=-fresolution=/tmp/ccpvjJbK.res] ==> ignore |
| 163 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore | 163 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore |
| 164 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore | 164 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore |
| 165 | arg [-plugin-opt=-pass-through=-lc] ==> ignore | 165 | arg [-plugin-opt=-pass-through=-lc] ==> ignore |
| @@ -177,7 +177,7 @@ Parsed C implicit link information from above output: | @@ -177,7 +177,7 @@ Parsed C implicit link information from above output: | ||
| 177 | arg [/lib64/ld-linux-x86-64.so.2] ==> ignore | 177 | arg [/lib64/ld-linux-x86-64.so.2] ==> ignore |
| 178 | arg [-zrelro] ==> ignore | 178 | arg [-zrelro] ==> ignore |
| 179 | arg [-o] ==> ignore | 179 | arg [-o] ==> ignore |
| 180 | - arg [cmTC_75746] ==> ignore | 180 | + arg [cmTC_05aaf] ==> ignore |
| 181 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] | 181 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] |
| 182 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] | 182 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] |
| 183 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] | 183 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] |
| @@ -189,7 +189,7 @@ Parsed C implicit link information from above output: | @@ -189,7 +189,7 @@ Parsed C implicit link information from above output: | ||
| 189 | arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] | 189 | arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] |
| 190 | arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] | 190 | arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] |
| 191 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] | 191 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] |
| 192 | - arg [CMakeFiles/cmTC_75746.dir/CMakeCCompilerABI.c.o] ==> ignore | 192 | + arg [CMakeFiles/cmTC_05aaf.dir/CMakeCCompilerABI.c.o] ==> ignore |
| 193 | arg [-lgcc] ==> lib [gcc] | 193 | arg [-lgcc] ==> lib [gcc] |
| 194 | arg [--as-needed] ==> ignore | 194 | arg [--as-needed] ==> ignore |
| 195 | arg [-lgcc_s] ==> lib [gcc_s] | 195 | arg [-lgcc_s] ==> lib [gcc_s] |
| @@ -221,18 +221,18 @@ Parsed C implicit link information from above output: | @@ -221,18 +221,18 @@ Parsed C implicit link information from above output: | ||
| 221 | Detecting CXX compiler ABI info compiled with the following output: | 221 | Detecting CXX compiler ABI info compiled with the following output: |
| 222 | Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp | 222 | Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp |
| 223 | 223 | ||
| 224 | -Run Build Command(s):/usr/bin/make -f Makefile cmTC_5e372/fast && /usr/bin/make -f CMakeFiles/cmTC_5e372.dir/build.make CMakeFiles/cmTC_5e372.dir/build | 224 | +Run Build Command(s):/usr/bin/make -f Makefile cmTC_05631/fast && /usr/bin/make -f CMakeFiles/cmTC_05631.dir/build.make CMakeFiles/cmTC_05631.dir/build |
| 225 | make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' | 225 | make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' |
| 226 | -Building CXX object CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o | ||
| 227 | -/usr/bin/c++ -v -o CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp | 226 | +Building CXX object CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o |
| 227 | +/usr/bin/c++ -v -o CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp | ||
| 228 | Using built-in specs. | 228 | Using built-in specs. |
| 229 | COLLECT_GCC=/usr/bin/c++ | 229 | COLLECT_GCC=/usr/bin/c++ |
| 230 | Target: x86_64-linux-gnu | 230 | Target: x86_64-linux-gnu |
| 231 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu | 231 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu |
| 232 | Thread model: posix | 232 | Thread model: posix |
| 233 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) | 233 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) |
| 234 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' | ||
| 235 | - /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccZjFFIQ.s | 234 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' |
| 235 | + /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccweF26V.s | ||
| 236 | GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu) | 236 | GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu) |
| 237 | compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 | 237 | compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 |
| 238 | warning: GMP header version 6.1.0 differs from library version 6.1.2. | 238 | warning: GMP header version 6.1.0 differs from library version 6.1.2. |
| @@ -256,15 +256,15 @@ GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gn | @@ -256,15 +256,15 @@ GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gn | ||
| 256 | warning: GMP header version 6.1.0 differs from library version 6.1.2. | 256 | warning: GMP header version 6.1.0 differs from library version 6.1.2. |
| 257 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 | 257 | GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 |
| 258 | Compiler executable checksum: 85af4995304287cdd19cfa43cf5d6cf1 | 258 | Compiler executable checksum: 85af4995304287cdd19cfa43cf5d6cf1 |
| 259 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' | ||
| 260 | - as -v --64 -o CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccZjFFIQ.s | 259 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' |
| 260 | + as -v --64 -o CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccweF26V.s | ||
| 261 | GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 | 261 | GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 |
| 262 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ | 262 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ |
| 263 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ | 263 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ |
| 264 | -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' | ||
| 265 | -Linking CXX executable cmTC_5e372 | ||
| 266 | -/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5e372.dir/link.txt --verbose=1 | ||
| 267 | -/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_5e372 | 264 | +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' |
| 265 | +Linking CXX executable cmTC_05631 | ||
| 266 | +/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05631.dir/link.txt --verbose=1 | ||
| 267 | +/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_05631 | ||
| 268 | Using built-in specs. | 268 | Using built-in specs. |
| 269 | COLLECT_GCC=/usr/bin/c++ | 269 | COLLECT_GCC=/usr/bin/c++ |
| 270 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper | 270 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper |
| @@ -274,8 +274,8 @@ Thread model: posix | @@ -274,8 +274,8 @@ Thread model: posix | ||
| 274 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) | 274 | gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) |
| 275 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ | 275 | COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ |
| 276 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ | 276 | LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ |
| 277 | -COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_5e372' '-shared-libgcc' '-mtune=generic' '-march=x86-64' | ||
| 278 | - /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc91ymQT.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_5e372 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o | 277 | +COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_05631' '-shared-libgcc' '-mtune=generic' '-march=x86-64' |
| 278 | + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccraUBRY.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_05631 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o | ||
| 279 | make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' | 279 | make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' |
| 280 | 280 | ||
| 281 | 281 | ||
| @@ -307,18 +307,18 @@ Parsed CXX implicit link information from above output: | @@ -307,18 +307,18 @@ Parsed CXX implicit link information from above output: | ||
| 307 | link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] | 307 | link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] |
| 308 | ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] | 308 | ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] |
| 309 | ignore line: [] | 309 | ignore line: [] |
| 310 | - ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_5e372/fast && /usr/bin/make -f CMakeFiles/cmTC_5e372.dir/build.make CMakeFiles/cmTC_5e372.dir/build] | 310 | + ignore line: [Run Build Command(s):/usr/bin/make -f Makefile cmTC_05631/fast && /usr/bin/make -f CMakeFiles/cmTC_05631.dir/build.make CMakeFiles/cmTC_05631.dir/build] |
| 311 | ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] | 311 | ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] |
| 312 | - ignore line: [Building CXX object CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o] | ||
| 313 | - ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp] | 312 | + ignore line: [Building CXX object CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o] |
| 313 | + ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp] | ||
| 314 | ignore line: [Using built-in specs.] | 314 | ignore line: [Using built-in specs.] |
| 315 | ignore line: [COLLECT_GCC=/usr/bin/c++] | 315 | ignore line: [COLLECT_GCC=/usr/bin/c++] |
| 316 | ignore line: [Target: x86_64-linux-gnu] | 316 | ignore line: [Target: x86_64-linux-gnu] |
| 317 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c ada c++ java go d fortran objc obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] | 317 | ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c ada c++ java go d fortran objc obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] |
| 318 | ignore line: [Thread model: posix] | 318 | ignore line: [Thread model: posix] |
| 319 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] | 319 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] |
| 320 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] | ||
| 321 | - ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccZjFFIQ.s] | 320 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] |
| 321 | + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/local/share/cmake-3.24/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccweF26V.s] | ||
| 322 | ignore line: [GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)] | 322 | ignore line: [GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) version 5.4.0 20160609 (x86_64-linux-gnu)] |
| 323 | ignore line: [ compiled by GNU C version 5.4.0 20160609 GMP version 6.1.0 MPFR version 3.1.4 MPC version 1.0.3] | 323 | ignore line: [ compiled by GNU C version 5.4.0 20160609 GMP version 6.1.0 MPFR version 3.1.4 MPC version 1.0.3] |
| 324 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] | 324 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] |
| @@ -342,15 +342,15 @@ Parsed CXX implicit link information from above output: | @@ -342,15 +342,15 @@ Parsed CXX implicit link information from above output: | ||
| 342 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] | 342 | ignore line: [warning: GMP header version 6.1.0 differs from library version 6.1.2.] |
| 343 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] | 343 | ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] |
| 344 | ignore line: [Compiler executable checksum: 85af4995304287cdd19cfa43cf5d6cf1] | 344 | ignore line: [Compiler executable checksum: 85af4995304287cdd19cfa43cf5d6cf1] |
| 345 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] | ||
| 346 | - ignore line: [ as -v --64 -o CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccZjFFIQ.s] | 345 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] |
| 346 | + ignore line: [ as -v --64 -o CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccweF26V.s] | ||
| 347 | ignore line: [GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1] | 347 | ignore line: [GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1] |
| 348 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] | 348 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] |
| 349 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] | 349 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] |
| 350 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] | ||
| 351 | - ignore line: [Linking CXX executable cmTC_5e372] | ||
| 352 | - ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5e372.dir/link.txt --verbose=1] | ||
| 353 | - ignore line: [/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_5e372 ] | 350 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] |
| 351 | + ignore line: [Linking CXX executable cmTC_05631] | ||
| 352 | + ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_05631.dir/link.txt --verbose=1] | ||
| 353 | + ignore line: [/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_05631 ] | ||
| 354 | ignore line: [Using built-in specs.] | 354 | ignore line: [Using built-in specs.] |
| 355 | ignore line: [COLLECT_GCC=/usr/bin/c++] | 355 | ignore line: [COLLECT_GCC=/usr/bin/c++] |
| 356 | ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] | 356 | ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] |
| @@ -360,13 +360,13 @@ Parsed CXX implicit link information from above output: | @@ -360,13 +360,13 @@ Parsed CXX implicit link information from above output: | ||
| 360 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] | 360 | ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] |
| 361 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] | 361 | ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] |
| 362 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] | 362 | ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] |
| 363 | - ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_5e372' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] | ||
| 364 | - link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc91ymQT.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_5e372 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] | 363 | + ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_05631' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] |
| 364 | + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccraUBRY.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_05631 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] | ||
| 365 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore | 365 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore |
| 366 | arg [-plugin] ==> ignore | 366 | arg [-plugin] ==> ignore |
| 367 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore | 367 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore |
| 368 | arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore | 368 | arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore |
| 369 | - arg [-plugin-opt=-fresolution=/tmp/cc91ymQT.res] ==> ignore | 369 | + arg [-plugin-opt=-fresolution=/tmp/ccraUBRY.res] ==> ignore |
| 370 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore | 370 | arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore |
| 371 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore | 371 | arg [-plugin-opt=-pass-through=-lgcc] ==> ignore |
| 372 | arg [-plugin-opt=-pass-through=-lc] ==> ignore | 372 | arg [-plugin-opt=-pass-through=-lc] ==> ignore |
| @@ -384,7 +384,7 @@ Parsed CXX implicit link information from above output: | @@ -384,7 +384,7 @@ Parsed CXX implicit link information from above output: | ||
| 384 | arg [/lib64/ld-linux-x86-64.so.2] ==> ignore | 384 | arg [/lib64/ld-linux-x86-64.so.2] ==> ignore |
| 385 | arg [-zrelro] ==> ignore | 385 | arg [-zrelro] ==> ignore |
| 386 | arg [-o] ==> ignore | 386 | arg [-o] ==> ignore |
| 387 | - arg [cmTC_5e372] ==> ignore | 387 | + arg [cmTC_05631] ==> ignore |
| 388 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] | 388 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] |
| 389 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] | 389 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] |
| 390 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] | 390 | arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] |
| @@ -396,7 +396,7 @@ Parsed CXX implicit link information from above output: | @@ -396,7 +396,7 @@ Parsed CXX implicit link information from above output: | ||
| 396 | arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] | 396 | arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] |
| 397 | arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] | 397 | arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] |
| 398 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] | 398 | arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] |
| 399 | - arg [CMakeFiles/cmTC_5e372.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore | 399 | + arg [CMakeFiles/cmTC_05631.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore |
| 400 | arg [-lstdc++] ==> lib [stdc++] | 400 | arg [-lstdc++] ==> lib [stdc++] |
| 401 | arg [-lm] ==> lib [m] | 401 | arg [-lm] ==> lib [m] |
| 402 | arg [-lgcc_s] ==> lib [gcc_s] | 402 | arg [-lgcc_s] ==> lib [gcc_s] |
| @@ -76,6 +76,8 @@ static const T_DjiTestCameraTypeStr s_cameraTypeStrList[] = { | @@ -76,6 +76,8 @@ static const T_DjiTestCameraTypeStr s_cameraTypeStrList[] = { | ||
| 76 | {DJI_CAMERA_TYPE_H30T, "H30T Camera"}, | 76 | {DJI_CAMERA_TYPE_H30T, "H30T Camera"}, |
| 77 | {DJI_CAMERA_TYPE_M4T, "M4T Camera"}, | 77 | {DJI_CAMERA_TYPE_M4T, "M4T Camera"}, |
| 78 | {DJI_CAMERA_TYPE_M4E, "M4E Camera"}, | 78 | {DJI_CAMERA_TYPE_M4E, "M4E Camera"}, |
| 79 | + {DJI_CAMERA_TYPE_M4TD, "M4TD Camera"}, | ||
| 80 | + {DJI_CAMERA_TYPE_M4D, "M4D Camera"}, | ||
| 79 | }; | 81 | }; |
| 80 | 82 | ||
| 81 | static FILE *s_downloadMediaFile = NULL; | 83 | static FILE *s_downloadMediaFile = NULL; |
| @@ -855,6 +857,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | @@ -855,6 +857,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 855 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType | 857 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType |
| 856 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType | 858 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType |
| 857 | || DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType | 859 | || DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType |
| 860 | + || DJI_CAMERA_TYPE_M4TD == cameraType || DJI_CAMERA_TYPE_M4D == cameraType | ||
| 858 | ) { | 861 | ) { |
| 859 | USER_LOG_INFO("Set mounted position %d camera's exposure mode to manual mode.", | 862 | USER_LOG_INFO("Set mounted position %d camera's exposure mode to manual mode.", |
| 860 | mountPosition); | 863 | mountPosition); |
| @@ -898,6 +901,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | @@ -898,6 +901,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 898 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType | 901 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType |
| 899 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType | 902 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType |
| 900 | || DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType | 903 | || DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType |
| 904 | + || DJI_CAMERA_TYPE_M4TD == cameraType || DJI_CAMERA_TYPE_M4D == cameraType | ||
| 901 | ) { | 905 | ) { |
| 902 | USER_LOG_INFO("Set mounted position %d camera's exposure mode to manual mode.", | 906 | USER_LOG_INFO("Set mounted position %d camera's exposure mode to manual mode.", |
| 903 | mountPosition); | 907 | mountPosition); |
| @@ -1198,6 +1202,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | @@ -1198,6 +1202,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 1198 | || DJI_CAMERA_TYPE_M3E == cameraType || DJI_CAMERA_TYPE_M3T == cameraType | 1202 | || DJI_CAMERA_TYPE_M3E == cameraType || DJI_CAMERA_TYPE_M3T == cameraType |
| 1199 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType | 1203 | || DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType |
| 1200 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType | 1204 | || DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType |
| 1205 | + || DJI_CAMERA_TYPE_M4TD == cameraType || DJI_CAMERA_TYPE_M4D == cameraType | ||
| 1201 | ) { | 1206 | ) { |
| 1202 | USER_LOG_INFO("Camera type %s does not support night scene mode!", | 1207 | USER_LOG_INFO("Camera type %s does not support night scene mode!", |
| 1203 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); | 1208 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); |
| @@ -1933,7 +1938,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | @@ -1933,7 +1938,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 1933 | cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 || | 1938 | cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 || |
| 1934 | cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D || | 1939 | cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D || |
| 1935 | cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 || | 1940 | cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 || |
| 1936 | - cameraType == DJI_CAMERA_TYPE_M4T) { | 1941 | + cameraType == DJI_CAMERA_TYPE_M4T || cameraType == DJI_CAMERA_TYPE_M4TD) { |
| 1937 | USER_LOG_WARN("Camera type %s don't support FFC function.", | 1942 | USER_LOG_WARN("Camera type %s don't support FFC function.", |
| 1938 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); | 1943 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); |
| 1939 | goto exitCameraModule; | 1944 | goto exitCameraModule; |
| @@ -1980,7 +1985,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | @@ -1980,7 +1985,7 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 1980 | cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 || | 1985 | cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 || |
| 1981 | cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D || | 1986 | cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D || |
| 1982 | cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 || | 1987 | cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 || |
| 1983 | - cameraType == DJI_CAMERA_TYPE_M4T) { | 1988 | + cameraType == DJI_CAMERA_TYPE_M4T || cameraType == DJI_CAMERA_TYPE_M4TD) { |
| 1984 | USER_LOG_WARN("Camera type %s don't support infrared function.", | 1989 | USER_LOG_WARN("Camera type %s don't support infrared function.", |
| 1985 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); | 1990 | s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr); |
| 1986 | goto exitCameraModule; | 1991 | goto exitCameraModule; |
| @@ -59,8 +59,11 @@ static T_DjiReturnCode ReceiveDataFromMobile(const uint8_t *data, uint16_t len); | @@ -59,8 +59,11 @@ static T_DjiReturnCode ReceiveDataFromMobile(const uint8_t *data, uint16_t len); | ||
| 59 | static T_DjiReturnCode ReceiveDataFromCloud(const uint8_t *data, uint16_t len); | 59 | static T_DjiReturnCode ReceiveDataFromCloud(const uint8_t *data, uint16_t len); |
| 60 | static T_DjiReturnCode ReceiveDataFromExtensionPort(const uint8_t *data, uint16_t len); | 60 | static T_DjiReturnCode ReceiveDataFromExtensionPort(const uint8_t *data, uint16_t len); |
| 61 | static T_DjiReturnCode ReceiveDataFromPayload(const uint8_t *data, uint16_t len); | 61 | static T_DjiReturnCode ReceiveDataFromPayload(const uint8_t *data, uint16_t len); |
| 62 | +static T_DjiReturnCode ReceiveDataFromPayload1(const uint8_t *data, uint16_t len); | ||
| 63 | +static T_DjiReturnCode ReceiveDataFromPayload2(const uint8_t *data, uint16_t len); | ||
| 64 | +static T_DjiReturnCode ReceiveDataFromPayload3(const uint8_t *data, uint16_t len); | ||
| 62 | void music_data(const uint8_t *data, uint16_t len,int get_equipment); | 65 | void music_data(const uint8_t *data, uint16_t len,int get_equipment); |
| 63 | - static uint16_t crc16bitbybit(uint8_t *ptr, uint16_t len); | 66 | + |
| 64 | /* Private variables ---------------------------------------------------------*/ | 67 | /* Private variables ---------------------------------------------------------*/ |
| 65 | static T_DjiTaskHandle s_userDataTransmissionThread; | 68 | static T_DjiTaskHandle s_userDataTransmissionThread; |
| 66 | static T_DjiAircraftInfoBaseInfo s_aircraftInfoBaseInfo; | 69 | static T_DjiAircraftInfoBaseInfo s_aircraftInfoBaseInfo; |
| @@ -98,7 +101,9 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void) | @@ -98,7 +101,9 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void) | ||
| 98 | if (s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | 101 | if (s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || |
| 99 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | 102 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || |
| 100 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D || | 103 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D || |
| 101 | - s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD) { | 104 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD || |
| 105 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4D || | ||
| 106 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4TD) { | ||
| 102 | channelAddress = DJI_CHANNEL_ADDRESS_CLOUD_API; | 107 | channelAddress = DJI_CHANNEL_ADDRESS_CLOUD_API; |
| 103 | djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromCloud); | 108 | djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromCloud); |
| 104 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | 109 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { |
| @@ -135,14 +140,34 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void) | @@ -135,14 +140,34 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void) | ||
| 135 | } | 140 | } |
| 136 | 141 | ||
| 137 | } else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT | 142 | } else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT |
| 138 | - || DJI_MOUNT_POSITION_EXTENSION_LITE_PORT == s_aircraftInfoBaseInfo.mountPosition) { | 143 | + || DJI_MOUNT_POSITION_EXTENSION_LITE_PORT == s_aircraftInfoBaseInfo.mountPosition) |
| 144 | + { | ||
| 139 | channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1; | 145 | channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1; |
| 140 | djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload); | 146 | djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload); |
| 141 | - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 142 | - USER_LOG_ERROR("register receive data from payload NO1 error."); | ||
| 143 | - return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 144 | - } | ||
| 145 | - } else { | 147 | + |
| 148 | + //djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload1); | ||
| 149 | + //if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 150 | + // USER_LOG_ERROR("register receive data from payload NO1 error."); | ||
| 151 | + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 152 | + //} | ||
| 153 | + | ||
| 154 | + //channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO2; | ||
| 155 | + //djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload2); | ||
| 156 | + //if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 157 | + // USER_LOG_ERROR("register receive data from payload NO1 error."); | ||
| 158 | + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 159 | + //} | ||
| 160 | + | ||
| 161 | + //channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO3; | ||
| 162 | + //djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromPayload3); | ||
| 163 | + //if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 164 | + // USER_LOG_ERROR("register receive data from payload NO1 error."); | ||
| 165 | + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 166 | + //} | ||
| 167 | + | ||
| 168 | + } | ||
| 169 | + else | ||
| 170 | + { | ||
| 146 | return DJI_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT; | 171 | return DJI_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT; |
| 147 | } | 172 | } |
| 148 | 173 | ||
| @@ -213,7 +238,9 @@ static void *UserDataTransmission_Task(void *arg) | @@ -213,7 +238,9 @@ static void *UserDataTransmission_Task(void *arg) | ||
| 213 | if (s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | 238 | if (s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || |
| 214 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | 239 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || |
| 215 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D || | 240 | s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D || |
| 216 | - s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD) { | 241 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD || |
| 242 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4D || | ||
| 243 | + s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4TD ) { | ||
| 217 | channelAddress = DJI_CHANNEL_ADDRESS_CLOUD_API; | 244 | channelAddress = DJI_CHANNEL_ADDRESS_CLOUD_API; |
| 218 | djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent)); | 245 | djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent)); |
| 219 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 246 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -262,8 +289,7 @@ static void *UserDataTransmission_Task(void *arg) | @@ -262,8 +289,7 @@ static void *UserDataTransmission_Task(void *arg) | ||
| 262 | USER_LOG_ERROR("get data stream state error."); | 289 | USER_LOG_ERROR("get data stream state error."); |
| 263 | } | 290 | } |
| 264 | } | 291 | } |
| 265 | - } else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT | ||
| 266 | - || DJI_MOUNT_POSITION_EXTENSION_LITE_PORT == s_aircraftInfoBaseInfo.mountPosition) { | 292 | + } else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_EXTENSION_PORT) { |
| 267 | channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1; | 293 | channelAddress = DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1; |
| 268 | djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent)); | 294 | djiStat = DjiLowSpeedDataChannel_SendData(channelAddress, dataToBeSent, sizeof(dataToBeSent)); |
| 269 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 295 | if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -394,6 +420,24 @@ static T_DjiReturnCode ReceiveDataFromPayload(const uint8_t *data, uint16_t len) | @@ -394,6 +420,24 @@ static T_DjiReturnCode ReceiveDataFromPayload(const uint8_t *data, uint16_t len) | ||
| 394 | return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 420 | return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 395 | } | 421 | } |
| 396 | 422 | ||
| 423 | +static T_DjiReturnCode ReceiveDataFromPayload1(const uint8_t *data, uint16_t len) | ||
| 424 | +{ | ||
| 425 | + USER_LOG_INFO("Receive from payload on port 1"); | ||
| 426 | + return ReceiveDataFromPayload(data, len); | ||
| 427 | +} | ||
| 428 | + | ||
| 429 | +static T_DjiReturnCode ReceiveDataFromPayload2(const uint8_t *data, uint16_t len) | ||
| 430 | +{ | ||
| 431 | + USER_LOG_INFO("Receive from payload on port 2"); | ||
| 432 | + return ReceiveDataFromPayload(data, len); | ||
| 433 | +} | ||
| 434 | + | ||
| 435 | +static T_DjiReturnCode ReceiveDataFromPayload3(const uint8_t *data, uint16_t len) | ||
| 436 | +{ | ||
| 437 | + USER_LOG_INFO("Receive from payload on port 3"); | ||
| 438 | + return ReceiveDataFromPayload(data, len); | ||
| 439 | +} | ||
| 440 | + | ||
| 397 | static int DebugModeCheck(unsigned char *data, unsigned int len) | 441 | static int DebugModeCheck(unsigned char *data, unsigned int len) |
| 398 | { | 442 | { |
| 399 | if (len == sizeof("#debugmode#") - 1) // 减去终止符 '\0' | 443 | if (len == sizeof("#debugmode#") - 1) // 减去终止符 '\0' |
| @@ -424,6 +468,7 @@ static int DebugModeCheck(unsigned char *data, unsigned int len) | @@ -424,6 +468,7 @@ static int DebugModeCheck(unsigned char *data, unsigned int len) | ||
| 424 | } | 468 | } |
| 425 | 469 | ||
| 426 | 470 | ||
| 471 | + | ||
| 427 | //根据不同的通道再加上判断各个功能标志位来做事 1是通道5 2是通道4 | 472 | //根据不同的通道再加上判断各个功能标志位来做事 1是通道5 2是通道4 |
| 428 | void music_data(const uint8_t *data, uint16_t len,int get_equipment) | 473 | void music_data(const uint8_t *data, uint16_t len,int get_equipment) |
| 429 | { | 474 | { |
| @@ -468,31 +513,4 @@ void music_data(const uint8_t *data, uint16_t len,int get_equipment) | @@ -468,31 +513,4 @@ void music_data(const uint8_t *data, uint16_t len,int get_equipment) | ||
| 468 | 513 | ||
| 469 | } | 514 | } |
| 470 | 515 | ||
| 471 | - static uint16_t crc16bitbybit(uint8_t *ptr, uint16_t len) | ||
| 472 | -{ | ||
| 473 | - uint8_t i; | ||
| 474 | - uint16_t crc = 0xffff; | ||
| 475 | - uint16_t polynom = 0xA001;//CRC校验 | ||
| 476 | - if (len == 0) | ||
| 477 | - { | ||
| 478 | - len = 1; | ||
| 479 | - } | ||
| 480 | - while (len--) | ||
| 481 | - { | ||
| 482 | - crc ^= *ptr; | ||
| 483 | - for (int i = 0; i<8; i++) | ||
| 484 | - { | ||
| 485 | - if (crc & 1) | ||
| 486 | - { | ||
| 487 | - crc >>= 1; | ||
| 488 | - crc ^= polynom; | ||
| 489 | - } | ||
| 490 | - else | ||
| 491 | - { | ||
| 492 | - crc >>= 1; | ||
| 493 | - } | ||
| 494 | - } | ||
| 495 | - ptr++; | ||
| 496 | - } | ||
| 497 | - return crc; | ||
| 498 | -} | ||
| 516 | +/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/ |
| @@ -548,10 +548,8 @@ static T_DjiReturnCode DjiTest_FcSubscriptionReceiveQuaternionCallback(const uin | @@ -548,10 +548,8 @@ static T_DjiReturnCode DjiTest_FcSubscriptionReceiveQuaternionCallback(const uin | ||
| 548 | roll = (dji_f64_t) atan2f(2 * quaternion->q2 * quaternion->q3 + 2 * quaternion->q0 * quaternion->q1, | 548 | roll = (dji_f64_t) atan2f(2 * quaternion->q2 * quaternion->q3 + 2 * quaternion->q0 * quaternion->q1, |
| 549 | -2 * quaternion->q1 * quaternion->q1 - 2 * quaternion->q2 * quaternion->q2 + 1) * 57.3; | 549 | -2 * quaternion->q1 * quaternion->q1 - 2 * quaternion->q2 * quaternion->q2 + 1) * 57.3; |
| 550 | yaw = (dji_f64_t) atan2f(2 * quaternion->q1 * quaternion->q2 + 2 * quaternion->q0 * quaternion->q3, | 550 | yaw = (dji_f64_t) atan2f(2 * quaternion->q1 * quaternion->q2 + 2 * quaternion->q0 * quaternion->q3, |
| 551 | - -2 * quaternion->q2 * quaternion->q2 - 2 * quaternion->q3 * quaternion->q3 + 1) *57.3; | ||
| 552 | - | ||
| 553 | - | ||
| 554 | - //printf("回调:pitch%d\n",(int)pitch); | 551 | + -2 * quaternion->q2 * quaternion->q2 - 2 * quaternion->q3 * quaternion->q3 + 1) * |
| 552 | + 57.3; | ||
| 555 | 553 | ||
| 556 | //飞机自身角度 | 554 | //飞机自身角度 |
| 557 | JZsdk_Psdk_Ui_io_Gimbal_PitchSelfangleMode( ( (int)pitch * 10)); | 555 | JZsdk_Psdk_Ui_io_Gimbal_PitchSelfangleMode( ( (int)pitch * 10)); |
project_build/DJI_大疆PSDK/samples/sample_c/module_sample/fc_subscription/test_fc_subscription.c.bak
0 → 100644
| 1 | +/** | ||
| 2 | + ******************************************************************** | ||
| 3 | + * @file test_fc_subscription.c | ||
| 4 | + * @brief | ||
| 5 | + * | ||
| 6 | + * @copyright (c) 2021 DJI. All rights reserved. | ||
| 7 | + * | ||
| 8 | + * All information contained herein is, and remains, the property of DJI. | ||
| 9 | + * The intellectual and technical concepts contained herein are proprietary | ||
| 10 | + * to DJI and may be covered by U.S. and foreign patents, patents in process, | ||
| 11 | + * and protected by trade secret or copyright law. Dissemination of this | ||
| 12 | + * information, including but not limited to data and other proprietary | ||
| 13 | + * material(s) incorporated within the information, in any form, is strictly | ||
| 14 | + * prohibited without the express written consent of DJI. | ||
| 15 | + * | ||
| 16 | + * If you receive this source code without DJI’s authorization, you may not | ||
| 17 | + * further disseminate the information, and you must immediately remove the | ||
| 18 | + * source code and notify DJI of its removal. DJI reserves the right to pursue | ||
| 19 | + * legal actions against you for any loss(es) or damage(s) caused by your | ||
| 20 | + * failure to do so. | ||
| 21 | + * | ||
| 22 | + ********************************************************************* | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +/* | ||
| 26 | + 1.消息订阅初始化 | ||
| 27 | + 2.构造回调函数,通过构造回调函数接收飞行器推送的信息。 | ||
| 28 | +*/ | ||
| 29 | + | ||
| 30 | +/* Includes ------------------------------------------------------------------*/ | ||
| 31 | +#include <utils/util_misc.h> | ||
| 32 | +#include <math.h> | ||
| 33 | +#include "test_fc_subscription.h" | ||
| 34 | +#include "dji_logger.h" | ||
| 35 | +#include "dji_platform.h" | ||
| 36 | +#include "widget_interaction_test/test_widget_interaction.h" | ||
| 37 | +#include "../widget/test_widget.h" | ||
| 38 | +#include "dji_aircraft_info.h" | ||
| 39 | + | ||
| 40 | +#include "version_choose.h" | ||
| 41 | +#include "Psdk_UI_io.h" | ||
| 42 | +#include "gimbal_emu/test_payload_gimbal_emu.h" | ||
| 43 | +#include "JZsdkLib.h" | ||
| 44 | + | ||
| 45 | +#include "DeviceInfo/Attribute/Attribute.h" | ||
| 46 | + | ||
| 47 | +/* Private constants ---------------------------------------------------------*/ | ||
| 48 | +#define FC_SUBSCRIPTION_TASK_FREQ (1) | ||
| 49 | +#define FC_SUBSCRIPTION_TASK_STACK_SIZE (1024) | ||
| 50 | + | ||
| 51 | + | ||
| 52 | +/* Private types -------------------------------------------------------------*/ | ||
| 53 | + | ||
| 54 | +/* Private functions declaration ---------------------------------------------*/ | ||
| 55 | +static void *Subscription_GPS_DealTask(void *arg); | ||
| 56 | +static void *Subscription_Velocity_ReplyTask(void *arg); | ||
| 57 | +// static void *Subscription_GimbalSub_Task(void *arg); | ||
| 58 | +static T_DjiReturnCode DjiTest_FcSubscriptionReceiveQuaternionCallback(const uint8_t *data, uint16_t dataSize, | ||
| 59 | + const T_DjiDataTimestamp *timestamp); | ||
| 60 | +static void *Subscription_GimbalAngels_task(void *arg); | ||
| 61 | +static void* Subscription_Height_Fusion_task(void* arg); | ||
| 62 | +/* Private variables ---------------------------------------------------------*/ | ||
| 63 | +static T_DjiTaskHandle s_userFcSubscriptionThread; | ||
| 64 | +static bool s_userFcSubscriptionDataShow = false;//标志位 | ||
| 65 | +static uint8_t s_totalSatelliteNumberUsed = 0; | ||
| 66 | + | ||
| 67 | +static T_DjiFcSubscriptionGpsTime gpsTime = {0}; | ||
| 68 | +static T_DjiFcSubscriptionGpsDate gpsDate = {0}; | ||
| 69 | +static T_DjiFcSubscriptionGpsPosition gpsPosition = {0}; | ||
| 70 | + | ||
| 71 | +//获取时间结构体 | ||
| 72 | +struct TimeGetSub | ||
| 73 | +{ | ||
| 74 | + int GetTime; | ||
| 75 | + int GetDate; | ||
| 76 | +}; | ||
| 77 | + | ||
| 78 | +float g_height_value = 0; | ||
| 79 | +int height_Volume_lock = 0; //高度音量锁 | ||
| 80 | +static int g_WhetherInChina = 0; | ||
| 81 | + | ||
| 82 | +/* Exported functions definition ---------------------------------------------*/ | ||
| 83 | +/* | ||
| 84 | + DjiTest_FcSubscriptionStartService----------------------------------------------------------------------------------------------START | ||
| 85 | + 1. 初始化消息订阅模块 | ||
| 86 | + 2. 指定TOPIC发起数据订阅 订阅的消息有 姿态四元数 速度 GPS 位置 GPS 信息 | ||
| 87 | + 3. 运行user_subscription_task样例任务 | ||
| 88 | +*/ | ||
| 89 | +T_DjiReturnCode DjiTest_FcSubscriptionStartService(void) | ||
| 90 | +{ | ||
| 91 | + T_DjiReturnCode djiStat; | ||
| 92 | + T_DjiOsalHandler *osalHandler = NULL; | ||
| 93 | + T_DjiReturnCode returnCode; | ||
| 94 | + T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo; | ||
| 95 | + | ||
| 96 | + osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 97 | + | ||
| 98 | + //消息订阅功能模块初始化 | ||
| 99 | + djiStat = DjiFcSubscription_Init(); | ||
| 100 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 101 | + USER_LOG_ERROR("init data subscription module error."); | ||
| 102 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + // 获得飞机信息 | ||
| 106 | + returnCode = DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo); | ||
| 107 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 108 | + USER_LOG_ERROR("get aircraft base info error"); | ||
| 109 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + //订阅gps时间的主题 | ||
| 113 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_TIME, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, | ||
| 114 | + NULL); | ||
| 115 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 116 | + USER_LOG_ERROR("Subscribe topic gps position error."); | ||
| 117 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + //订阅gps日期 主题 | ||
| 121 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_DATE, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, | ||
| 122 | + NULL); | ||
| 123 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 124 | + USER_LOG_ERROR("Subscribe topic gps position error."); | ||
| 125 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + //订阅gps地址 | ||
| 129 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_POSITION, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, | ||
| 130 | + NULL); | ||
| 131 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 132 | + USER_LOG_ERROR("Subscribe topic gps position error."); | ||
| 133 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + //订阅 飞机 飞行状态 | ||
| 137 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, | ||
| 138 | + NULL); | ||
| 139 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 140 | + USER_LOG_ERROR("Subscribe topic velocity error."); | ||
| 141 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 142 | + } else { | ||
| 143 | + USER_LOG_DEBUG("Subscribe topic velocity success."); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + //订阅相机角度 | ||
| 147 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ,NULL);//订阅角度 | ||
| 148 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 149 | + { | ||
| 150 | + USER_LOG_ERROR("Subscribe topic quaternion error."); | ||
| 151 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + | ||
| 155 | + //飞机自身角度 | ||
| 156 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_QUATERNION, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, | ||
| 157 | + DjiTest_FcSubscriptionReceiveQuaternionCallback); | ||
| 158 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 159 | + USER_LOG_ERROR("Subscribe topic quaternion error."); | ||
| 160 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 161 | + } else { | ||
| 162 | + USER_LOG_DEBUG("Subscribe topic quaternion success."); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + | ||
| 166 | + | ||
| 167 | + // //m30和m30t有高度锁 | ||
| 168 | + // if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T) | ||
| 169 | + // { | ||
| 170 | + // if (osalHandler->TaskCreate("Subscription_Height_Fusion_task", Subscription_Height_Fusion_task, | ||
| 171 | + // FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) != | ||
| 172 | + // DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 173 | + // USER_LOG_ERROR("Height Fusion task create error."); | ||
| 174 | + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 175 | + // } | ||
| 176 | + // else { | ||
| 177 | + // USER_LOG_INFO("开启相对高度音量限制功能"); | ||
| 178 | + // } | ||
| 179 | + // } | ||
| 180 | + | ||
| 181 | + | ||
| 182 | + | ||
| 183 | + | ||
| 184 | +/********************** | ||
| 185 | + * | ||
| 186 | + * | ||
| 187 | + * 处理线程 | ||
| 188 | + * | ||
| 189 | + * *******************************************/ | ||
| 190 | + //gps处理线程 | ||
| 191 | + if (osalHandler->TaskCreate("user_GPSDeal_task",Subscription_GPS_DealTask, | ||
| 192 | + FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) != | ||
| 193 | + DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 194 | + USER_LOG_ERROR("user data subscription task create error."); | ||
| 195 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + | ||
| 199 | + //飞机飞行状态回复线程 | ||
| 200 | + if (osalHandler->TaskCreate("user_subscription_task", Subscription_Velocity_ReplyTask, | ||
| 201 | + FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) != | ||
| 202 | + DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 203 | + USER_LOG_ERROR("user data subscription task create error."); | ||
| 204 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + // //云台参数回复线程 | ||
| 208 | + // if (osalHandler->TaskCreate("Subscription_GimbalSub_Task", Subscription_GimbalSub_Task, | ||
| 209 | + // FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) != | ||
| 210 | + // DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 211 | + // { | ||
| 212 | + // USER_LOG_ERROR("user data subscription task create error."); | ||
| 213 | + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 214 | + // } | ||
| 215 | + | ||
| 216 | + //如果飞机为需要飞机自带的相机进行云台联动的型号 | ||
| 217 | + // if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 | ||
| 218 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T | ||
| 219 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3E | ||
| 220 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3T | ||
| 221 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D | ||
| 222 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD | ||
| 223 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK | ||
| 224 | + // || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK | ||
| 225 | + // ) | ||
| 226 | + // { | ||
| 227 | + if (osalHandler->TaskCreate("Subscription_GimbalAngels_task", Subscription_GimbalAngels_task, | ||
| 228 | + FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) != | ||
| 229 | + DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 230 | + USER_LOG_ERROR("user data Subscription_GimbalAngels_task create error."); | ||
| 231 | + return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 232 | + } | ||
| 233 | + //} | ||
| 234 | + | ||
| 235 | + | ||
| 236 | + | ||
| 237 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 238 | +} | ||
| 239 | + | ||
| 240 | +//取反标志位,是和阻塞函数里用到-------------------------------------------------------- | ||
| 241 | +T_DjiReturnCode DjiTest_FcSubscriptionDataShowTrigger(void) | ||
| 242 | +{ | ||
| 243 | + //标志位取反 | ||
| 244 | + s_userFcSubscriptionDataShow = !s_userFcSubscriptionDataShow; | ||
| 245 | + | ||
| 246 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 247 | +} | ||
| 248 | + | ||
| 249 | +//获取标志位到number------------------------------------------------------------------------ | ||
| 250 | +T_DjiReturnCode DjiTest_FcSubscriptionGetTotalSatelliteNumber(uint8_t *number) | ||
| 251 | +{ | ||
| 252 | + *number = s_totalSatelliteNumberUsed; | ||
| 253 | + | ||
| 254 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 255 | +} | ||
| 256 | + | ||
| 257 | +/* Private functions definition-----------------------------------------------*/ | ||
| 258 | +#ifndef __CC_ARM | ||
| 259 | +#pragma GCC diagnostic push | ||
| 260 | +#pragma GCC diagnostic ignored "-Wmissing-noreturn" | ||
| 261 | +#pragma GCC diagnostic ignored "-Wreturn-type" | ||
| 262 | +#endif | ||
| 263 | + | ||
| 264 | +/** | ||
| 265 | +* | ||
| 266 | +功能:判断经纬度是否在指定范围 | ||
| 267 | +参数:x 经度 y 纬度 | ||
| 268 | +返回值:1(中国) 0(国外) | ||
| 269 | + | ||
| 270 | +*/ | ||
| 271 | +static int check_GPS() | ||
| 272 | +{ | ||
| 273 | + //经度 | ||
| 274 | + int x = 0; | ||
| 275 | + | ||
| 276 | + //纬度 | ||
| 277 | + int y = 0; | ||
| 278 | + | ||
| 279 | + x = (int)gpsPosition.x; | ||
| 280 | + y = (int)gpsPosition.y; | ||
| 281 | + | ||
| 282 | + //USER_LOG_INFO("x:%f y:%f",x,y); | ||
| 283 | + | ||
| 284 | + x= x/10000000; | ||
| 285 | + y= y/10000000; | ||
| 286 | + | ||
| 287 | + //USER_LOG_INFO("x:%d y:%d",x,y); | ||
| 288 | + /** | ||
| 289 | + 中国经纬度粗划分,精度为 1 ,中国区域占比偏大 | ||
| 290 | + */ | ||
| 291 | + int gps_map[67][2]={ | ||
| 292 | + {0 ,0 },{ 0, 0},{ 0, 0},{0,0},{37,38},{36,41},{35,42},{35,42},{31,42},{30,45},//70-79 | ||
| 293 | + {29,45},{30,46},{29,47},{29,48},{28,48},{27,49},{27,50},{27,50},{27,49},{27,48},//80-89 | ||
| 294 | + {28,48},{27,46},{26,46},{27,45},{27,45},{27,45},{28,44},{23,43},{23,43},{21,43},//90-99 | ||
| 295 | + {21,43},{21,43},{22,42},{22,42},{22,42},{22,43},{22,43},{21,43},{21,43},{3,43},//100-109 | ||
| 296 | + {3,43},{3,45},{3,46},{4,45},{5,46},{6,49},{9,50},{10,50},{13,49},{25,51},//110-119 | ||
| 297 | + {19,53},{20,54},{22,54},{24,54},{25,54},{40,54},{41,53},{41,51},{41,50},{41,50},//120-129 | ||
| 298 | + {42,49},{42,48},{45,48},{45,49},{47,48},{48,49},{48,49}//130-136 | ||
| 299 | + }; | ||
| 300 | + | ||
| 301 | + if(x<73||x>136) //经度超范围 | ||
| 302 | + { | ||
| 303 | + g_WhetherInChina = 0;; | ||
| 304 | + } | ||
| 305 | + else | ||
| 306 | + { | ||
| 307 | + int getx=x-70; | ||
| 308 | + int gety=y; | ||
| 309 | + | ||
| 310 | + if(y>=gps_map[getx][0]&&y<=gps_map[getx][1]) //根据经纬度判断是否处于中国区域 | ||
| 311 | + g_WhetherInChina = 1; | ||
| 312 | + else | ||
| 313 | + g_WhetherInChina = 0; | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + | ||
| 317 | +} | ||
| 318 | +int Subscription_WhetherInChina() | ||
| 319 | +{ | ||
| 320 | + //USER_LOG_INFO("g_WhetherInChina:%d",g_WhetherInChina); | ||
| 321 | + //不在返回0 在返回1 | ||
| 322 | + return g_WhetherInChina; | ||
| 323 | +} | ||
| 324 | + | ||
| 325 | +//GPS订阅线程 | ||
| 326 | +static void *Subscription_GPS_DealTask(void *arg) | ||
| 327 | +{ | ||
| 328 | + //权柄 | ||
| 329 | + T_DjiReturnCode djiStat; | ||
| 330 | + T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 331 | + | ||
| 332 | + //回调参数 | ||
| 333 | + T_DjiDataTimestamp timestamp = {0}; | ||
| 334 | + | ||
| 335 | + | ||
| 336 | + USER_UTIL_UNUSED(arg); | ||
| 337 | + | ||
| 338 | + while (1) | ||
| 339 | + { | ||
| 340 | + //时间 | ||
| 341 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_TIME, | ||
| 342 | + (uint8_t *) &gpsTime, | ||
| 343 | + sizeof(T_DjiFcSubscriptionGpsTime), | ||
| 344 | + ×tamp); | ||
| 345 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 346 | + USER_LOG_ERROR("get value of topic gps position error."); | ||
| 347 | + } else { | ||
| 348 | + //USER_LOG_INFO("gpsTime = %d", gpsTime); | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + //日期 | ||
| 352 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_DATE, | ||
| 353 | + (uint8_t *) &gpsDate, | ||
| 354 | + sizeof(T_DjiFcSubscriptionGpsDate), | ||
| 355 | + ×tamp); | ||
| 356 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 357 | + USER_LOG_ERROR("get value of topic gps position error."); | ||
| 358 | + } else { | ||
| 359 | + //USER_LOG_INFO("gpsDate = %d", gpsDate); | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + //地址 | ||
| 363 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_GPS_POSITION, | ||
| 364 | + (uint8_t *) &gpsPosition, | ||
| 365 | + sizeof(T_DjiFcSubscriptionGpsPosition), | ||
| 366 | + ×tamp); | ||
| 367 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 368 | + USER_LOG_ERROR("get value of topic gps position error."); | ||
| 369 | + } else { | ||
| 370 | + //USER_LOG_INFO("gpsDate = %d", gpsDate); | ||
| 371 | + } | ||
| 372 | + | ||
| 373 | + //如果为海外版 | ||
| 374 | + if (FIRMWARE_ORIGIN == OVERSEAS_VERSION) | ||
| 375 | + { | ||
| 376 | + check_GPS(); | ||
| 377 | + //USER_LOG_INFO("海外"); | ||
| 378 | + } | ||
| 379 | + | ||
| 380 | + //USER_LOG_INFO("gps订阅"); | ||
| 381 | + //1s一次 | ||
| 382 | + | ||
| 383 | + T_JZsdkAttributeGpsPosition temp_GpsPosition; | ||
| 384 | + temp_GpsPosition.x = gpsPosition.x; | ||
| 385 | + temp_GpsPosition.y = gpsPosition.y; | ||
| 386 | + temp_GpsPosition.z = gpsPosition.z; | ||
| 387 | + Attribute_SetGpsPosition(temp_GpsPosition); | ||
| 388 | + | ||
| 389 | + T_JZsdkAttributeGpsTime temp_GpsTime; | ||
| 390 | + temp_GpsTime = gpsTime; | ||
| 391 | + Attribute_SetGpsTime(temp_GpsTime); | ||
| 392 | + | ||
| 393 | + T_JZsdkAttributeGpsDate temp_GpsDate; | ||
| 394 | + temp_GpsDate = gpsDate; | ||
| 395 | + Attribute_SetGpsDate(temp_GpsDate); | ||
| 396 | + | ||
| 397 | + osalHandler->TaskSleepMs(1000 / FC_SUBSCRIPTION_TASK_FREQ); | ||
| 398 | + | ||
| 399 | + } | ||
| 400 | + | ||
| 401 | + //5、结束订阅函数 | ||
| 402 | + djiStat = DjiFcSubscription_DeInit(); | ||
| 403 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 404 | + USER_LOG_ERROR("Deinit fc subscription error."); | ||
| 405 | + } | ||
| 406 | +} | ||
| 407 | + | ||
| 408 | +static void *Subscription_Velocity_ReplyTask(void *arg) | ||
| 409 | +{ | ||
| 410 | + T_DjiReturnCode djiStat; | ||
| 411 | + T_DjiFcSubscriptionVelocity velocity = {0}; | ||
| 412 | + T_DjiDataTimestamp timestamp = {0}; | ||
| 413 | + T_DjiFcSubscriptionGpsPosition gpsPosition = {0}; | ||
| 414 | + T_DjiFcSubscriptionGpsDetails gpsDetails = {0}; | ||
| 415 | + T_DjiOsalHandler *osalHandler = NULL; | ||
| 416 | + | ||
| 417 | + USER_UTIL_UNUSED(arg); | ||
| 418 | + osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 419 | + | ||
| 420 | +//飞机的运行情况打印 | ||
| 421 | + while (1) { | ||
| 422 | + //等待一秒 | ||
| 423 | + osalHandler->TaskSleepMs(1000 / FC_SUBSCRIPTION_TASK_FREQ); | ||
| 424 | + //主动获取数据 获取指定TOPIC的最新发布数据。 获取速度------------------------------------------------ | ||
| 425 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY, | ||
| 426 | + (uint8_t *) &velocity, | ||
| 427 | + sizeof(T_DjiFcSubscriptionVelocity), | ||
| 428 | + ×tamp); | ||
| 429 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 430 | + USER_LOG_ERROR("get value of topic velocity error."); | ||
| 431 | + } | ||
| 432 | + //如果是阻塞标志位开启,就将速度打印出来 | ||
| 433 | + if (s_userFcSubscriptionDataShow == true) { | ||
| 434 | + USER_LOG_INFO("velocity: x %f y %f z %f, healthFlag %d.", velocity.data.x, velocity.data.y, | ||
| 435 | + velocity.data.z, velocity.health); | ||
| 436 | + } | ||
| 437 | + } | ||
| 438 | +} | ||
| 439 | + | ||
| 440 | +static void *Subscription_GimbalAngels_task(void *arg) | ||
| 441 | +{ | ||
| 442 | + T_DjiReturnCode djiStat; | ||
| 443 | + T_DjiVector3f gimbalangle = {0};//云台角度 | ||
| 444 | + T_DjiOsalHandler *osalHandler = NULL; | ||
| 445 | + T_DjiDataTimestamp timestamp = {0}; | ||
| 446 | + | ||
| 447 | + osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 448 | + | ||
| 449 | + int LastGimbalPitch; | ||
| 450 | + int NowGimbalPitch; | ||
| 451 | + | ||
| 452 | + USER_LOG_INFO("相机云台联动线程已经启用"); | ||
| 453 | + | ||
| 454 | + while (1) {//一直在循环里面 | ||
| 455 | + //osalHandler->TaskSleepMs(1000 / FC_SUBSCRIPTION_TASK_FREQ); | ||
| 456 | + osalHandler->TaskSleepMs(1000 / 20); | ||
| 457 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, | ||
| 458 | + (uint8_t *) &gimbalangle, | ||
| 459 | + sizeof(T_DjiVector3f), | ||
| 460 | + ×tamp); | ||
| 461 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 462 | + USER_LOG_ERROR("get gimbal angle error."); | ||
| 463 | + } | ||
| 464 | + else | ||
| 465 | + { | ||
| 466 | + NowGimbalPitch = (int)gimbalangle.x * 10; | ||
| 467 | + //USER_LOG_INFO("NowGimbalPitch%d",NowGimbalPitch); | ||
| 468 | + | ||
| 469 | + //如果云台联动已经打开 | ||
| 470 | + if( (Get_Gimbal_linkage()== JZ_FLAGCODE_ON ) && (NowGimbalPitch != LastGimbalPitch) ) | ||
| 471 | + { | ||
| 472 | + //printf("消息订阅联动\n"); | ||
| 473 | + JZsdk_Psdk_Ui_io_Gimbal_PitchAngleControlMode(NowGimbalPitch); | ||
| 474 | + LastGimbalPitch = NowGimbalPitch; | ||
| 475 | + } | ||
| 476 | + | ||
| 477 | + } | ||
| 478 | + } | ||
| 479 | +} | ||
| 480 | + | ||
| 481 | + | ||
| 482 | +//获取相对高度音量限制线程 | ||
| 483 | +static void* Subscription_Height_Fusion_task(void* arg) | ||
| 484 | +{ | ||
| 485 | + T_DjiReturnCode djiStat; | ||
| 486 | + T_DjiFcSubscriptionHeightFusion height_fusion_value = {0};//融合相对高度 | ||
| 487 | + T_DjiOsalHandler* osalHandler = NULL; | ||
| 488 | + T_DjiDataTimestamp timestamp = { 0 }; | ||
| 489 | + | ||
| 490 | + osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 491 | + | ||
| 492 | + //订阅相对融合高度 | ||
| 493 | + djiStat = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ,NULL); | ||
| 494 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 495 | + JZSDK_LOG_ERROR("融合高度订阅失败"); | ||
| 496 | + } | ||
| 497 | + else | ||
| 498 | + { | ||
| 499 | + JZSDK_LOG_INFO("融合高度订阅成功"); | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + while (1) {//一直在循环里面 | ||
| 503 | + osalHandler->TaskSleepMs(100); | ||
| 504 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, | ||
| 505 | + (uint8_t*)&height_fusion_value, | ||
| 506 | + sizeof(T_DjiFcSubscriptionHeightFusion), | ||
| 507 | + ×tamp); | ||
| 508 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 509 | + USER_LOG_ERROR("get height relativevalue error."); | ||
| 510 | + } | ||
| 511 | + | ||
| 512 | + else | ||
| 513 | + { | ||
| 514 | + //USER_LOG_INFO("融合相对高度为 = %f",height_fusion_value); | ||
| 515 | + g_height_value = height_fusion_value; | ||
| 516 | + | ||
| 517 | + //如果高度音量限制已打开,音量超过60,设置为60% | ||
| 518 | + if ( height_fusion_value <= 10) // && DeviceActivation_GetDebugMode() == 0) | ||
| 519 | + { | ||
| 520 | + height_Volume_lock = 1;//高度锁生效 | ||
| 521 | + if(JZsdk_Psdk_UI_io_GetWidgetVolume() >60 ) //高度音量锁e > 60 | ||
| 522 | + { | ||
| 523 | + JZsdk_Psdk_UI_io_SetVolume(1,60); | ||
| 524 | + } | ||
| 525 | + } | ||
| 526 | + else { | ||
| 527 | + height_Volume_lock = 0;//高度锁解锁 | ||
| 528 | + //高度音量锁 | ||
| 529 | + } | ||
| 530 | + } | ||
| 531 | + | ||
| 532 | + } | ||
| 533 | +} | ||
| 534 | + | ||
| 535 | +#ifndef __CC_ARM | ||
| 536 | +#pragma GCC diagnostic pop | ||
| 537 | +#endif | ||
| 538 | +//回调函数 | ||
| 539 | +static T_DjiReturnCode DjiTest_FcSubscriptionReceiveQuaternionCallback(const uint8_t *data, uint16_t dataSize, | ||
| 540 | + const T_DjiDataTimestamp *timestamp) | ||
| 541 | +{ | ||
| 542 | + T_DjiFcSubscriptionQuaternion *quaternion = (T_DjiFcSubscriptionQuaternion *) data; | ||
| 543 | + dji_f64_t pitch, yaw, roll; | ||
| 544 | + | ||
| 545 | + USER_UTIL_UNUSED(dataSize); | ||
| 546 | + //转换成 倾角 转角 | ||
| 547 | + pitch = (dji_f64_t) asinf(-2 * quaternion->q1 * quaternion->q3 + 2 * quaternion->q0 * quaternion->q2) * 57.3; | ||
| 548 | + roll = (dji_f64_t) atan2f(2 * quaternion->q2 * quaternion->q3 + 2 * quaternion->q0 * quaternion->q1, | ||
| 549 | + -2 * quaternion->q1 * quaternion->q1 - 2 * quaternion->q2 * quaternion->q2 + 1) * 57.3; | ||
| 550 | + yaw = (dji_f64_t) atan2f(2 * quaternion->q1 * quaternion->q2 + 2 * quaternion->q0 * quaternion->q3, | ||
| 551 | + -2 * quaternion->q2 * quaternion->q2 - 2 * quaternion->q3 * quaternion->q3 + 1) *57.3; | ||
| 552 | + | ||
| 553 | + | ||
| 554 | + //printf("回调:pitch%d\n",(int)pitch); | ||
| 555 | + | ||
| 556 | + //飞机自身角度 | ||
| 557 | + JZsdk_Psdk_Ui_io_Gimbal_PitchSelfangleMode( ( (int)pitch * 10)); | ||
| 558 | + | ||
| 559 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 560 | +} | ||
| 561 | + | ||
| 562 | +T_DjiReturnCode DjiTest_FcSubscriptionRunSample(void) | ||
| 563 | +{ | ||
| 564 | +} | ||
| 565 | + | ||
| 566 | +/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/ |
| @@ -1306,6 +1306,8 @@ bool DjiTest_FlightControlGoHomeAndConfirmLanding(void) | @@ -1306,6 +1306,8 @@ bool DjiTest_FlightControlGoHomeAndConfirmLanding(void) | ||
| 1306 | || DJI_AIRCRAFT_TYPE_M3D == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType | 1306 | || DJI_AIRCRAFT_TYPE_M3D == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType |
| 1307 | || DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType | 1307 | || DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType |
| 1308 | || DJI_AIRCRAFT_TYPE_M4E == aircraftInfoBaseInfo.aircraftType | 1308 | || DJI_AIRCRAFT_TYPE_M4E == aircraftInfoBaseInfo.aircraftType |
| 1309 | + || DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType | ||
| 1310 | + || DJI_AIRCRAFT_TYPE_M4D == aircraftInfoBaseInfo.aircraftType | ||
| 1309 | ) { | 1311 | ) { |
| 1310 | if ((dji_f64_t) 0.45 < heightFusion && heightFusion < (dji_f64_t) 0.55) { | 1312 | if ((dji_f64_t) 0.45 < heightFusion && heightFusion < (dji_f64_t) 0.55) { |
| 1311 | break; | 1313 | break; |
project_build/DJI_大疆PSDK/samples/sample_c/module_sample/flight_control/test_flight_control.c.bak
0 → 100644
| 1 | +/** | ||
| 2 | + ******************************************************************** | ||
| 3 | + * @file test_flight_control.c | ||
| 4 | + * @brief | ||
| 5 | + * | ||
| 6 | + * @copyright (c) 2021 DJI. All rights reserved. | ||
| 7 | + * | ||
| 8 | + * All information contained herein is, and remains, the property of DJI. | ||
| 9 | + * The intellectual and technical concepts contained herein are proprietary | ||
| 10 | + * to DJI and may be covered by U.S. and foreign patents, patents in process, | ||
| 11 | + * and protected by trade secret or copyright law. Dissemination of this | ||
| 12 | + * information, including but not limited to data and other proprietary | ||
| 13 | + * material(s) incorporated within the information, in any form, is strictly | ||
| 14 | + * prohibited without the express written consent of DJI. | ||
| 15 | + * | ||
| 16 | + * If you receive this source code without DJI’s authorization, you may not | ||
| 17 | + * further disseminate the information, and you must immediately remove the | ||
| 18 | + * source code and notify DJI of its removal. DJI reserves the right to pursue | ||
| 19 | + * legal actions against you for any loss(es) or damage(s) caused by your | ||
| 20 | + * failure to do so. | ||
| 21 | + * | ||
| 22 | + ********************************************************************* | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +/* Includes ------------------------------------------------------------------*/ | ||
| 26 | +#include "dji_flight_controller.h" | ||
| 27 | +#include "test_flight_control.h" | ||
| 28 | +#include "dji_fc_subscription.h" | ||
| 29 | +#include "dji_platform.h" | ||
| 30 | +#include "dji_logger.h" | ||
| 31 | +#include <math.h> | ||
| 32 | +#include <widget_interaction_test/test_widget_interaction.h> | ||
| 33 | +#include <dji_aircraft_info.h> | ||
| 34 | +/* Private constants ---------------------------------------------------------*/ | ||
| 35 | + | ||
| 36 | +/* Private types -------------------------------------------------------------*/ | ||
| 37 | +typedef struct { | ||
| 38 | + E_DjiFcSubscriptionDisplayMode displayMode; | ||
| 39 | + char *displayModeStr; | ||
| 40 | +} T_DjiTestFlightControlDisplayModeStr; | ||
| 41 | + | ||
| 42 | +/* Private values -------------------------------------------------------------*/ | ||
| 43 | +static T_DjiOsalHandler *s_osalHandler = NULL; | ||
| 44 | +static const double s_earthCenter = 6378137.0; | ||
| 45 | +static const double s_degToRad = 0.01745329252; | ||
| 46 | +static bool s_isFtsCallbackRegistered = false; | ||
| 47 | +static int32_t s_ftsTriggerCount = 0; | ||
| 48 | + | ||
| 49 | +static const T_DjiTestFlightControlDisplayModeStr s_flightControlDisplayModeStr[] = { | ||
| 50 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE, .displayModeStr = "attitude mode"}, | ||
| 51 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_P_GPS, .displayModeStr = "p_gps mode"}, | ||
| 52 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ASSISTED_TAKEOFF, .displayModeStr = "assisted takeoff mode"}, | ||
| 53 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_TAKEOFF, .displayModeStr = "auto takeoff mode"}, | ||
| 54 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING, .displayModeStr = "auto landing mode"}, | ||
| 55 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_GO_HOME, .displayModeStr = "go home mode"}, | ||
| 56 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_FORCE_AUTO_LANDING, .displayModeStr = "force landing mode"}, | ||
| 57 | + {.displayMode = DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ENGINE_START, .displayModeStr = "engine start mode"}, | ||
| 58 | + {.displayMode = 0xFF, .displayModeStr = "unknown mode"} | ||
| 59 | +}; | ||
| 60 | + | ||
| 61 | +/* Private functions declaration ---------------------------------------------*/ | ||
| 62 | +static uint8_t DjiTest_FlightControlGetDisplayModeIndex(E_DjiFcSubscriptionDisplayMode displayMode); | ||
| 63 | +static T_DjiFcSubscriptionFlightStatus DjiTest_FlightControlGetValueOfFlightStatus(void); | ||
| 64 | +static T_DjiFcSubscriptionDisplaymode DjiTest_FlightControlGetValueOfDisplayMode(void); | ||
| 65 | +static T_DjiFcSubscriptionHeightFusion DjiTest_FlightControlGetValueOfHeightFusion(void); | ||
| 66 | +static T_DjiFcSubscriptionQuaternion DjiTest_FlightControlGetValueOfQuaternion(void); | ||
| 67 | +static T_DjiFcSubscriptionPositionFused DjiTest_FlightControlGetValueOfPositionFused(void); | ||
| 68 | +static dji_f32_t DjiTest_FlightControlGetValueOfRelativeHeight(void); | ||
| 69 | +static bool DjiTest_FlightControlMotorStartedCheck(void); | ||
| 70 | +static bool DjiTest_FlightControlTakeOffInAirCheck(void); | ||
| 71 | +static bool DjiTest_FlightControlLandFinishedCheck(void); | ||
| 72 | +static bool DjiTest_FlightControlMonitoredTakeoff(void); | ||
| 73 | +static bool DjiTest_FlightControlCheckActionStarted(E_DjiFcSubscriptionDisplayMode mode); | ||
| 74 | +static bool DjiTest_FlightControlMonitoredLanding(void); | ||
| 75 | +static bool DjiTest_FlightControlGoHomeAndConfirmLanding(void); | ||
| 76 | +static T_DjiTestFlightControlVector3f DjiTest_FlightControlQuaternionToEulerAngle(T_DjiFcSubscriptionQuaternion quat); | ||
| 77 | +static T_DjiTestFlightControlVector3f | ||
| 78 | +DjiTest_FlightControlLocalOffsetFromGpsAndFusedHeightOffset(T_DjiFcSubscriptionPositionFused target, | ||
| 79 | + T_DjiFcSubscriptionPositionFused origin, | ||
| 80 | + dji_f32_t targetHeight, | ||
| 81 | + dji_f32_t originHeight); | ||
| 82 | +static T_DjiTestFlightControlVector3f | ||
| 83 | +DjiTest_FlightControlVector3FSub(T_DjiTestFlightControlVector3f vectorA, T_DjiTestFlightControlVector3f vectorB); | ||
| 84 | +static int DjiTest_FlightControlSignOfData(dji_f32_t data); | ||
| 85 | +static void DjiTest_FlightControlHorizCommandLimit(dji_f32_t speedFactor, dji_f32_t *commandX, dji_f32_t *commandY); | ||
| 86 | +static dji_f32_t DjiTest_FlightControlVectorNorm(T_DjiTestFlightControlVector3f v); | ||
| 87 | +static T_DjiReturnCode | ||
| 88 | +DjiTest_FlightControlJoystickCtrlAuthSwitchEventCallback(T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData); | ||
| 89 | +static bool DjiTest_FlightControlMoveByPositionOffset(T_DjiTestFlightControlVector3f offsetDesired, | ||
| 90 | + float yawDesiredInDeg, | ||
| 91 | + float posThresholdInM, | ||
| 92 | + float yawThresholdInDeg); | ||
| 93 | +static T_DjiReturnCode DjiTest_FlightControlInit(void); | ||
| 94 | +static T_DjiReturnCode DjiTest_FlightControlDeInit(void); | ||
| 95 | +static void DjiTest_FlightControlTakeOffLandingSample(void); | ||
| 96 | +static void DjiTest_FlightControlPositionControlSample(void); | ||
| 97 | +static void DjiTest_FlightControlGoHomeForceLandingSample(void); | ||
| 98 | +static void DjiTest_FlightControlVelocityControlSample(void); | ||
| 99 | +static void DjiTest_FlightControlArrestFlyingSample(void); | ||
| 100 | +static void DjiTest_FlightControlSetGetParamSample(void); | ||
| 101 | +static void DjiTest_FlightControlPassiveTriggerFtsSample(void); | ||
| 102 | +static T_DjiReturnCode DjiTest_TriggerFtsEventCallback(void); | ||
| 103 | +static void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect); | ||
| 104 | + | ||
| 105 | +/* Exported functions definition ---------------------------------------------*/ | ||
| 106 | +T_DjiReturnCode DjiTest_FlightControlRunSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect) | ||
| 107 | +{ | ||
| 108 | + T_DjiReturnCode returnCode; | ||
| 109 | + | ||
| 110 | + USER_LOG_DEBUG("Init flight Control Sample"); | ||
| 111 | + DjiTest_WidgetLogAppend("Init flight Control Sample"); | ||
| 112 | + | ||
| 113 | + returnCode = DjiTest_FlightControlInit(); | ||
| 114 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 115 | + USER_LOG_ERROR("Init flight Control sample failed,error code:0x%08llX", returnCode); | ||
| 116 | + return returnCode; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + DjiTest_FlightControlSample(flightCtrlSampleSelect); | ||
| 120 | + | ||
| 121 | + USER_LOG_DEBUG("Deinit Flight Control Sample"); | ||
| 122 | + DjiTest_WidgetLogAppend("Deinit Flight Control Sample"); | ||
| 123 | + returnCode = DjiTest_FlightControlDeInit(); | ||
| 124 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 125 | + USER_LOG_ERROR("Deinit Flight Control sample failed,error code:0x%08llX", returnCode); | ||
| 126 | + return returnCode; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + return returnCode; | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +/* Private functions definition-----------------------------------------------*/ | ||
| 133 | +T_DjiReturnCode DjiTest_FlightControlInit(void) | ||
| 134 | +{ | ||
| 135 | + T_DjiReturnCode returnCode; | ||
| 136 | + T_DjiFlightControllerRidInfo ridInfo = {0}; | ||
| 137 | + | ||
| 138 | + s_osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 139 | + if (!s_osalHandler) return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; | ||
| 140 | + | ||
| 141 | + ridInfo.latitude = 22.542812; | ||
| 142 | + ridInfo.longitude = 113.958902; | ||
| 143 | + ridInfo.altitude = 10; | ||
| 144 | + | ||
| 145 | + returnCode = DjiFlightController_Init(ridInfo); | ||
| 146 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 147 | + USER_LOG_ERROR("Init flight controller module failed, error code:0x%08llX", returnCode); | ||
| 148 | + return returnCode; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + returnCode = DjiFcSubscription_Init(); | ||
| 152 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 153 | + USER_LOG_ERROR("Init data subscription module failed, error code:0x%08llX", returnCode); | ||
| 154 | + return returnCode; | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + /*! subscribe fc data */ | ||
| 158 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_STATUS_FLIGHT, | ||
| 159 | + DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, | ||
| 160 | + NULL); | ||
| 161 | + | ||
| 162 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 163 | + USER_LOG_ERROR("Subscribe topic flight status failed, error code:0x%08llX", returnCode); | ||
| 164 | + return returnCode; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_STATUS_DISPLAYMODE, | ||
| 168 | + DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, | ||
| 169 | + NULL); | ||
| 170 | + | ||
| 171 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 172 | + USER_LOG_ERROR("Subscribe topic display mode failed, error code:0x%08llX", returnCode); | ||
| 173 | + return returnCode; | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, | ||
| 177 | + DJI_DATA_SUBSCRIPTION_TOPIC_10_HZ, | ||
| 178 | + NULL); | ||
| 179 | + | ||
| 180 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 181 | + USER_LOG_ERROR("Subscribe topic avoid data failed,error code:0x%08llX", returnCode); | ||
| 182 | + return returnCode; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_QUATERNION, | ||
| 186 | + DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, | ||
| 187 | + NULL); | ||
| 188 | + | ||
| 189 | + if (returnCode == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 190 | + } else if (returnCode == DJI_ERROR_SUBSCRIPTION_MODULE_CODE_TOPIC_DUPLICATE) { | ||
| 191 | + USER_LOG_WARN("Subscribe topic quaternion duplicate"); | ||
| 192 | + } else { | ||
| 193 | + USER_LOG_ERROR("Subscribe topic quaternion failed,error code:0x%08llX", returnCode); | ||
| 194 | + return returnCode; | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED, | ||
| 198 | + DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, | ||
| 199 | + NULL); | ||
| 200 | + | ||
| 201 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 202 | + USER_LOG_ERROR("Subscribe topic position fused failed,error code:0x%08llX", returnCode); | ||
| 203 | + return returnCode; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_ALTITUDE_FUSED, | ||
| 207 | + DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, | ||
| 208 | + NULL); | ||
| 209 | + | ||
| 210 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 211 | + USER_LOG_ERROR("Subscribe topic altitude fused failed,error code:0x%08llX", returnCode); | ||
| 212 | + return returnCode; | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_ALTITUDE_OF_HOMEPOINT, | ||
| 216 | + DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, | ||
| 217 | + NULL); | ||
| 218 | + | ||
| 219 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 220 | + USER_LOG_ERROR("Subscribe topic altitude of home point failed,error code:0x%08llX", returnCode); | ||
| 221 | + return returnCode; | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + returnCode = DjiFlightController_RegJoystickCtrlAuthorityEventCallback( | ||
| 225 | + DjiTest_FlightControlJoystickCtrlAuthSwitchEventCallback); | ||
| 226 | + | ||
| 227 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS && returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_NONSUPPORT) { | ||
| 228 | + USER_LOG_ERROR("Register joystick control authority event callback failed,error code:0x%08llX", returnCode); | ||
| 229 | + return returnCode; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 233 | +} | ||
| 234 | + | ||
| 235 | +T_DjiReturnCode DjiTest_FlightControlDeInit(void) | ||
| 236 | +{ | ||
| 237 | + T_DjiReturnCode returnCode; | ||
| 238 | + | ||
| 239 | + returnCode = DjiFlightController_DeInit(); | ||
| 240 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 241 | + USER_LOG_ERROR("Deinit flight controller module failed, error code:0x%08llX", | ||
| 242 | + returnCode); | ||
| 243 | + return returnCode; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + returnCode = DjiFcSubscription_DeInit(); | ||
| 247 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 248 | + USER_LOG_ERROR("Deinit data subscription module failed, error code:0x%08llX", | ||
| 249 | + returnCode); | ||
| 250 | + return returnCode; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 254 | +} | ||
| 255 | + | ||
| 256 | +void DjiTest_FlightControlTakeOffLandingSample() | ||
| 257 | +{ | ||
| 258 | + T_DjiReturnCode returnCode; | ||
| 259 | + | ||
| 260 | + USER_LOG_INFO("Flight control takeoff-landing sample start"); | ||
| 261 | + DjiTest_WidgetLogAppend("Flight control takeoff-landing sample start"); | ||
| 262 | + USER_LOG_INFO("--> Step 1: Obtain joystick control authority."); | ||
| 263 | + DjiTest_WidgetLogAppend("--> Step 1: Obtain joystick control authority."); | ||
| 264 | + returnCode = DjiFlightController_ObtainJoystickCtrlAuthority(); | ||
| 265 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 266 | + USER_LOG_ERROR("Obtain joystick authority failed, error code: 0x%08X", returnCode); | ||
| 267 | + goto out; | ||
| 268 | + } | ||
| 269 | + s_osalHandler->TaskSleepMs(1000); | ||
| 270 | + | ||
| 271 | + USER_LOG_INFO("--> Step 2: Take off\r\n"); | ||
| 272 | + DjiTest_WidgetLogAppend("--> Step 2: Take off\r\n"); | ||
| 273 | + if (!DjiTest_FlightControlMonitoredTakeoff()) { | ||
| 274 | + USER_LOG_ERROR("Take off failed"); | ||
| 275 | + goto out; | ||
| 276 | + } | ||
| 277 | + USER_LOG_INFO("Successful take off\r\n"); | ||
| 278 | + DjiTest_WidgetLogAppend("Successful take off\r\n"); | ||
| 279 | + s_osalHandler->TaskSleepMs(4000); | ||
| 280 | + | ||
| 281 | + USER_LOG_INFO("--> Step 3: Landing\r\n"); | ||
| 282 | + DjiTest_WidgetLogAppend("--> Step 3: Landing\r\n"); | ||
| 283 | + if (!DjiTest_FlightControlMonitoredLanding()) { | ||
| 284 | + USER_LOG_ERROR("Landing failed"); | ||
| 285 | + goto out; | ||
| 286 | + } | ||
| 287 | + USER_LOG_INFO("Successful landing\r\n"); | ||
| 288 | + DjiTest_WidgetLogAppend("Successful landing\r\n"); | ||
| 289 | + | ||
| 290 | + USER_LOG_INFO("--> Step 4: Release joystick authority"); | ||
| 291 | + DjiTest_WidgetLogAppend("--> Step 4: Release joystick authority"); | ||
| 292 | + returnCode = DjiFlightController_ReleaseJoystickCtrlAuthority(); | ||
| 293 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 294 | + USER_LOG_ERROR("Release joystick authority failed, error code: 0x%08X", returnCode); | ||
| 295 | + goto out; | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | +out: | ||
| 299 | + USER_LOG_INFO("Flight control takeoff-landing sample end"); | ||
| 300 | + DjiTest_WidgetLogAppend("Flight control takeoff-landing sample end"); | ||
| 301 | +} | ||
| 302 | + | ||
| 303 | +void DjiTest_FlightControlPositionControlSample() | ||
| 304 | +{ | ||
| 305 | + T_DjiReturnCode returnCode; | ||
| 306 | + | ||
| 307 | + USER_LOG_INFO("Flight control move-by-position sample start"); | ||
| 308 | + DjiTest_WidgetLogAppend("Flight control move-by-position sample start"); | ||
| 309 | + | ||
| 310 | + USER_LOG_INFO("--> Step 1: Obtain joystick control authority."); | ||
| 311 | + DjiTest_WidgetLogAppend("--> Step 1: Obtain joystick control authority."); | ||
| 312 | + returnCode = DjiFlightController_ObtainJoystickCtrlAuthority(); | ||
| 313 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 314 | + USER_LOG_ERROR("Obtain joystick authority failed, error code: 0x%08X", returnCode); | ||
| 315 | + goto out; | ||
| 316 | + } | ||
| 317 | + s_osalHandler->TaskSleepMs(1000); | ||
| 318 | + | ||
| 319 | + USER_LOG_INFO("--> Step 2: Take off\r\n"); | ||
| 320 | + DjiTest_WidgetLogAppend("--> Step 2: Take off\r\n"); | ||
| 321 | + if (!DjiTest_FlightControlMonitoredTakeoff()) { | ||
| 322 | + USER_LOG_ERROR("Take off failed"); | ||
| 323 | + goto out; | ||
| 324 | + } | ||
| 325 | + USER_LOG_INFO("Successful take off\r\n"); | ||
| 326 | + DjiTest_WidgetLogAppend("Successful take off\r\n"); | ||
| 327 | + | ||
| 328 | + USER_LOG_INFO("--> Step 3: Move to north:0(m), east:6(m), up:6(m) , yaw:30(degree) from current point"); | ||
| 329 | + DjiTest_WidgetLogAppend("--> Step 3: Move to north:0(m), east:6(m), up:6(m) , yaw:30(degree) from current point"); | ||
| 330 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {0, 6, 6}, 30, 0.8, 1)) { | ||
| 331 | + USER_LOG_ERROR("Move to north:0(m), east:6(m), up:6(m) , yaw:30(degree) from current point failed"); | ||
| 332 | + goto out; | ||
| 333 | + }; | ||
| 334 | + | ||
| 335 | + USER_LOG_INFO("--> Step 4: Move to north:6(m), east:0(m), up:-3(m) , yaw:-30(degree) from current point"); | ||
| 336 | + DjiTest_WidgetLogAppend( | ||
| 337 | + "--> Step 4: Move to north:6(m), east:0(m), up:-3(m) , yaw:-30(degree) from current point"); | ||
| 338 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {6, 0, -3}, -30, 0.8, 1)) { | ||
| 339 | + USER_LOG_ERROR("Move to north:6(m), east:0(m), up:-3(m) , yaw:-30(degree) from current point failed"); | ||
| 340 | + goto out; | ||
| 341 | + }; | ||
| 342 | + | ||
| 343 | + USER_LOG_INFO("--> Step 5: Move to north:-6(m), east:-6(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 344 | + DjiTest_WidgetLogAppend("--> Step 5: Move to north:-6(m), east:-6(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 345 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {-6, -6, 0}, 0, 0.8, 1)) { | ||
| 346 | + USER_LOG_ERROR("Move to north:-6(m), east:-6(m), up:0(m) , yaw:0(degree) from current point failed"); | ||
| 347 | + goto out; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + USER_LOG_INFO("--> Step 6: Landing\r\n"); | ||
| 351 | + DjiTest_WidgetLogAppend("--> Step 6: Landing\r\n"); | ||
| 352 | + if (!DjiTest_FlightControlMonitoredLanding()) { | ||
| 353 | + USER_LOG_ERROR("Landing failed"); | ||
| 354 | + goto out; | ||
| 355 | + } | ||
| 356 | + USER_LOG_INFO("Successful landing\r\n"); | ||
| 357 | + DjiTest_WidgetLogAppend("Successful landing\r\n"); | ||
| 358 | + | ||
| 359 | + USER_LOG_INFO("--> Step 7: Release joystick authority"); | ||
| 360 | + DjiTest_WidgetLogAppend("--> Step 7: Release joystick authority"); | ||
| 361 | + returnCode = DjiFlightController_ReleaseJoystickCtrlAuthority(); | ||
| 362 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 363 | + USER_LOG_ERROR("Release joystick authority failed, error code: 0x%08X", returnCode); | ||
| 364 | + goto out; | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | +out: | ||
| 368 | + USER_LOG_INFO("Flight control move-by-position sample end"); | ||
| 369 | + DjiTest_WidgetLogAppend("Flight control move-by-position sample end"); | ||
| 370 | +} | ||
| 371 | + | ||
| 372 | +void DjiTest_FlightControlGoHomeForceLandingSample() | ||
| 373 | +{ | ||
| 374 | + T_DjiReturnCode returnCode; | ||
| 375 | + | ||
| 376 | + USER_LOG_INFO("Flight control go-home-force-landing sample start"); | ||
| 377 | + DjiTest_WidgetLogAppend("Flight control go-home-force-landing sample start"); | ||
| 378 | + | ||
| 379 | + USER_LOG_INFO("--> Step 1: Obtain joystick control authority"); | ||
| 380 | + DjiTest_WidgetLogAppend("--> Step 1: Obtain joystick control authority"); | ||
| 381 | + returnCode = DjiFlightController_ObtainJoystickCtrlAuthority(); | ||
| 382 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 383 | + USER_LOG_ERROR("Obtain joystick authority failed, error code: 0x%08X", returnCode); | ||
| 384 | + goto out; | ||
| 385 | + } | ||
| 386 | + s_osalHandler->TaskSleepMs(1000); | ||
| 387 | + | ||
| 388 | + USER_LOG_INFO("--> Step 2: Take off\r\n"); | ||
| 389 | + DjiTest_WidgetLogAppend("--> Step 2: Take off\r\n"); | ||
| 390 | + if (!DjiTest_FlightControlMonitoredTakeoff()) { | ||
| 391 | + USER_LOG_ERROR("Take off failed"); | ||
| 392 | + goto out; | ||
| 393 | + } | ||
| 394 | + USER_LOG_INFO("Successful take off\r\n"); | ||
| 395 | + DjiTest_WidgetLogAppend("Successful take off\r\n"); | ||
| 396 | + | ||
| 397 | + USER_LOG_INFO("--> Step 3: Move to north:0(m), east:0(m), up:30(m) , yaw:0(degree) from current point"); | ||
| 398 | + DjiTest_WidgetLogAppend("--> Step 3: Move to north:0(m), east:0(m), up:30(m) , yaw:0(degree) from current point"); | ||
| 399 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {0, 0, 30}, 0, 0.8, 1)) { | ||
| 400 | + USER_LOG_ERROR("Move to north:0(m), east:0(m), up:30(m) , yaw:0(degree) from current point failed"); | ||
| 401 | + goto out; | ||
| 402 | + } | ||
| 403 | + | ||
| 404 | + USER_LOG_INFO("--> Step 4: Move to north:10(m), east:0(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 405 | + DjiTest_WidgetLogAppend("--> Step 4: Move to north:10(m), east:0(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 406 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {10, 0, 0}, 0, 0.8, 1)) { | ||
| 407 | + USER_LOG_ERROR("Move to north:10(m), east:0(m), up:0(m) , yaw:0(degree) from current point failed"); | ||
| 408 | + goto out; | ||
| 409 | + } | ||
| 410 | + | ||
| 411 | + USER_LOG_INFO("--> Step 5: Set aircraft current position as new home location!"); | ||
| 412 | + DjiTest_WidgetLogAppend("--> Step 5: Set aircraft current position as new home location!"); | ||
| 413 | + returnCode = DjiFlightController_SetHomeLocationUsingCurrentAircraftLocation(); | ||
| 414 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 415 | + USER_LOG_ERROR("Set aircraft current position as new home location failed, error code: 0x%08X", returnCode); | ||
| 416 | + goto out; | ||
| 417 | + } | ||
| 418 | + | ||
| 419 | + USER_LOG_INFO("--> Step 6: Set go home altitude to 50(m)\r\n"); | ||
| 420 | + DjiTest_WidgetLogAppend("--> Step 6: Set go home altitude to 50(m)\r\n"); | ||
| 421 | + returnCode = DjiFlightController_SetGoHomeAltitude(50); | ||
| 422 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 423 | + USER_LOG_ERROR("Set go home altitude to 50(m) failed, error code: 0x%08X", returnCode); | ||
| 424 | + goto out; | ||
| 425 | + } | ||
| 426 | + | ||
| 427 | + /*! get go home altitude */ | ||
| 428 | + E_DjiFlightControllerGoHomeAltitude goHomeAltitude; | ||
| 429 | + returnCode = DjiFlightController_GetGoHomeAltitude(&goHomeAltitude); | ||
| 430 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 431 | + USER_LOG_ERROR("Get go home altitude failed, error code: 0x%08X", returnCode); | ||
| 432 | + goto out; | ||
| 433 | + } | ||
| 434 | + USER_LOG_INFO("Current go home altitude is %d m\r\n", goHomeAltitude); | ||
| 435 | + DjiTest_WidgetLogAppend("Current go home altitude is %d m\r\n", goHomeAltitude); | ||
| 436 | + | ||
| 437 | + USER_LOG_INFO("--> Step 7: Move to north:20(m), east:0(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 438 | + DjiTest_WidgetLogAppend("--> Step 7: Move to north:20(m), east:0(m), up:0(m) , yaw:0(degree) from current point"); | ||
| 439 | + if (!DjiTest_FlightControlMoveByPositionOffset((T_DjiTestFlightControlVector3f) {20, 0, 0}, 0, 0.8, 1)) { | ||
| 440 | + USER_LOG_ERROR("Move to north:20(m), east:0(m), up:0(m) , yaw:0(degree) from current point failed"); | ||
| 441 | + goto out; | ||
| 442 | + } | ||
| 443 | + | ||
| 444 | + USER_LOG_INFO("--> Step 8: Go home and confirm force landing\r\n"); | ||
| 445 | + DjiTest_WidgetLogAppend("--> Step 8: Go home and confirm force landing\r\n"); | ||
| 446 | + if (!DjiTest_FlightControlGoHomeAndConfirmLanding()) { | ||
| 447 | + USER_LOG_ERROR("Go home and confirm force landing failed"); | ||
| 448 | + goto out; | ||
| 449 | + } | ||
| 450 | + USER_LOG_INFO("Successful go home and confirm force landing\r\n"); | ||
| 451 | + DjiTest_WidgetLogAppend("Successful go home and confirm force landing\r\n"); | ||
| 452 | + | ||
| 453 | + USER_LOG_INFO("-> Step 9: Release joystick authority"); | ||
| 454 | + DjiTest_WidgetLogAppend("-> Step 9: Release joystick authority"); | ||
| 455 | + returnCode = DjiFlightController_ReleaseJoystickCtrlAuthority(); | ||
| 456 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 457 | + USER_LOG_ERROR("Release joystick authority failed, error code: 0x%08X", returnCode); | ||
| 458 | + goto out; | ||
| 459 | + } | ||
| 460 | + | ||
| 461 | +out: | ||
| 462 | + USER_LOG_INFO("Flight control go-home-force-landing sample end"); | ||
| 463 | + DjiTest_WidgetLogAppend("Flight control go-home-force-landing sample end"); | ||
| 464 | +} | ||
| 465 | + | ||
| 466 | +void DjiTest_FlightControlVelocityControlSample() | ||
| 467 | +{ | ||
| 468 | + T_DjiReturnCode returnCode; | ||
| 469 | + | ||
| 470 | + USER_LOG_INFO("Flight control move-by-velocity sample start"); | ||
| 471 | + DjiTest_WidgetLogAppend("Flight control move-by-velocity sample start"); | ||
| 472 | + | ||
| 473 | + USER_LOG_INFO("--> Step 1: Obtain joystick control authority"); | ||
| 474 | + DjiTest_WidgetLogAppend("--> Step 1: Obtain joystick control authority"); | ||
| 475 | + returnCode = DjiFlightController_ObtainJoystickCtrlAuthority(); | ||
| 476 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 477 | + USER_LOG_ERROR("Obtain joystick authority failed, error code: 0x%08X", returnCode); | ||
| 478 | + goto out; | ||
| 479 | + } | ||
| 480 | + s_osalHandler->TaskSleepMs(1000); | ||
| 481 | + | ||
| 482 | + USER_LOG_INFO("--> Step 2: Take off\r\n"); | ||
| 483 | + DjiTest_WidgetLogAppend("--> Step 2: Take off\r\n"); | ||
| 484 | + if (!DjiTest_FlightControlMonitoredTakeoff()) { | ||
| 485 | + USER_LOG_ERROR("Take off failed"); | ||
| 486 | + goto out; | ||
| 487 | + } | ||
| 488 | + USER_LOG_INFO("Successful take off\r\n"); | ||
| 489 | + DjiTest_WidgetLogAppend("Successful take off\r\n"); | ||
| 490 | + | ||
| 491 | + USER_LOG_INFO( | ||
| 492 | + "--> Step 3: Move with north:0(m/s), east:0(m/s), up:5(m/s), yaw:0(deg/s) from current point for 2s!"); | ||
| 493 | + DjiTest_WidgetLogAppend( | ||
| 494 | + "--> Step 3: Move with north:0(m/s), east:0(m/s), up:5(m/s), yaw:0(deg/s) from current point for 2s!"); | ||
| 495 | + DjiTest_FlightControlVelocityAndYawRateCtrl((T_DjiTestFlightControlVector3f) {0, 0, 5.0}, 0, 2000); | ||
| 496 | + | ||
| 497 | + USER_LOG_INFO("--> Step 4: Emergency brake for 2s"); | ||
| 498 | + DjiTest_WidgetLogAppend("--> Step 4: Emergency brake for 2s"); | ||
| 499 | + returnCode = DjiFlightController_ExecuteEmergencyBrakeAction(); | ||
| 500 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 501 | + USER_LOG_ERROR("Emergency brake failed, error code: 0x%08X", returnCode); | ||
| 502 | + goto out; | ||
| 503 | + } | ||
| 504 | + s_osalHandler->TaskSleepMs(2000); | ||
| 505 | + returnCode = DjiFlightController_CancelEmergencyBrakeAction(); | ||
| 506 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 507 | + USER_LOG_ERROR("Cancel emergency brake action failed, error code: 0x%08X", returnCode); | ||
| 508 | + goto out; | ||
| 509 | + } | ||
| 510 | + | ||
| 511 | + USER_LOG_INFO( | ||
| 512 | + "--> Step 5: Move with north:-1.5(m/s), east:2(m/s), up:0(m/s), yaw:20(deg/s) from current point for 2s!"); | ||
| 513 | + DjiTest_WidgetLogAppend( | ||
| 514 | + "--> Step 5: Move with north:-1.5(m/s), east:2(m/s), up:0(m/s), yaw:20(deg/s) from current point for 2s!"); | ||
| 515 | + DjiTest_FlightControlVelocityAndYawRateCtrl((T_DjiTestFlightControlVector3f) {-1.5, 2, 0}, 20, 2000); | ||
| 516 | + | ||
| 517 | + USER_LOG_INFO("--> Step 6: Emergency brake for 2s"); | ||
| 518 | + DjiTest_WidgetLogAppend("--> Step 6: Emergency brake for 2s"); | ||
| 519 | + returnCode = DjiFlightController_ExecuteEmergencyBrakeAction(); | ||
| 520 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 521 | + USER_LOG_ERROR("Emergency brake failed, error code: 0x%08X", returnCode); | ||
| 522 | + goto out; | ||
| 523 | + } | ||
| 524 | + s_osalHandler->TaskSleepMs(2000); | ||
| 525 | + returnCode = DjiFlightController_CancelEmergencyBrakeAction(); | ||
| 526 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 527 | + USER_LOG_ERROR("Cancel emergency brake action failed, error code: 0x%08X", returnCode); | ||
| 528 | + goto out; | ||
| 529 | + } | ||
| 530 | + | ||
| 531 | + USER_LOG_INFO( | ||
| 532 | + "--> Step 7: Move with north:3(m/s), east:0(m/s), up:0(m/s), yaw:0(deg/s) from current point for 2.5s!"); | ||
| 533 | + DjiTest_WidgetLogAppend( | ||
| 534 | + "--> Step 7: Move with north:3(m/s), east:0(m/s), up:0(m/s), yaw:0(deg/s) from current point for 2.5s!"); | ||
| 535 | + DjiTest_FlightControlVelocityAndYawRateCtrl((T_DjiTestFlightControlVector3f) {3, 0, 0}, 0, 2500); | ||
| 536 | + | ||
| 537 | + USER_LOG_INFO("--> Step 8: Emergency brake for 2s"); | ||
| 538 | + DjiTest_WidgetLogAppend("--> Step 8: Emergency brake for 2s"); | ||
| 539 | + returnCode = DjiFlightController_ExecuteEmergencyBrakeAction(); | ||
| 540 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 541 | + USER_LOG_ERROR("Emergency brake failed, error code: 0x%08X", returnCode); | ||
| 542 | + goto out; | ||
| 543 | + } | ||
| 544 | + s_osalHandler->TaskSleepMs(2000); | ||
| 545 | + returnCode = DjiFlightController_CancelEmergencyBrakeAction(); | ||
| 546 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 547 | + USER_LOG_ERROR("Cancel emergency brake action failed, error code: 0x%08X", returnCode); | ||
| 548 | + goto out; | ||
| 549 | + } | ||
| 550 | + | ||
| 551 | + USER_LOG_INFO( | ||
| 552 | + "--> Step 9: Move with north:-1.6(m/s), east:-2(m/s), up:0(m/s), yaw:0(deg/s) from current point for 2.2s!"); | ||
| 553 | + DjiTest_WidgetLogAppend( | ||
| 554 | + "--> Step 9: Move with north:-1.6(m/s), east:-2(m/s), up:0(m/s), yaw:0(deg/s) from current point for 2.2s!"); | ||
| 555 | + DjiTest_FlightControlVelocityAndYawRateCtrl((T_DjiTestFlightControlVector3f) {-1.6, -2, 0}, 0, 2200); | ||
| 556 | + | ||
| 557 | + USER_LOG_INFO("--> Step 10: Emergency brake for 2s"); | ||
| 558 | + DjiTest_WidgetLogAppend("--> Step 10: Emergency brake for 2s"); | ||
| 559 | + returnCode = DjiFlightController_ExecuteEmergencyBrakeAction(); | ||
| 560 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 561 | + USER_LOG_ERROR("Emergency brake failed, error code: 0x%08X", returnCode); | ||
| 562 | + goto out; | ||
| 563 | + } | ||
| 564 | + s_osalHandler->TaskSleepMs(2000); | ||
| 565 | + returnCode = DjiFlightController_CancelEmergencyBrakeAction(); | ||
| 566 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 567 | + USER_LOG_ERROR("Cancel emergency brake action failed, error code: 0x%08X", returnCode); | ||
| 568 | + goto out; | ||
| 569 | + } | ||
| 570 | + | ||
| 571 | + USER_LOG_INFO("--> Step 11: Landing\r\n"); | ||
| 572 | + DjiTest_WidgetLogAppend("--> Step 11: Landing\r\n"); | ||
| 573 | + if (!DjiTest_FlightControlMonitoredLanding()) { | ||
| 574 | + USER_LOG_ERROR("Landing failed"); | ||
| 575 | + goto out; | ||
| 576 | + } | ||
| 577 | + USER_LOG_INFO("Successful landing\r\n"); | ||
| 578 | + DjiTest_WidgetLogAppend("Successful landing\r\n"); | ||
| 579 | + | ||
| 580 | + USER_LOG_INFO("--> Step 12: Release joystick authority"); | ||
| 581 | + DjiTest_WidgetLogAppend("--> Step 12: Release joystick authority"); | ||
| 582 | + returnCode = DjiFlightController_ReleaseJoystickCtrlAuthority(); | ||
| 583 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 584 | + USER_LOG_ERROR("Release joystick authority failed, error code: 0x%08X", returnCode); | ||
| 585 | + goto out; | ||
| 586 | + } | ||
| 587 | + | ||
| 588 | +out: | ||
| 589 | + USER_LOG_INFO("Flight control move-by-velocity sample end"); | ||
| 590 | + DjiTest_WidgetLogAppend("Flight control move-by-velocity sample end"); | ||
| 591 | +} | ||
| 592 | + | ||
| 593 | +void DjiTest_FlightControlArrestFlyingSample() | ||
| 594 | +{ | ||
| 595 | + T_DjiReturnCode returnCode; | ||
| 596 | + | ||
| 597 | + USER_LOG_INFO("Flight control arrest-flying sample start"); | ||
| 598 | + DjiTest_WidgetLogAppend("Flight control arrest-flying sample start"); | ||
| 599 | + | ||
| 600 | + USER_LOG_INFO("--> Step 1: Enable arrest-flying"); | ||
| 601 | + DjiTest_WidgetLogAppend("--> Step 1: Enable arrest-flying"); | ||
| 602 | + returnCode = DjiFlightController_ArrestFlying(); | ||
| 603 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 604 | + USER_LOG_ERROR("Enable arrest-flying failed, error code: 0x%08X", returnCode); | ||
| 605 | + goto out; | ||
| 606 | + } | ||
| 607 | + s_osalHandler->TaskSleepMs(2000); | ||
| 608 | + | ||
| 609 | + //you can replace with takeoff to test in air. | ||
| 610 | + USER_LOG_INFO("--> Step 2: Turn on motors\r\n"); | ||
| 611 | + DjiTest_WidgetLogAppend("--> Step 2: Turn on motors\r\n"); | ||
| 612 | + returnCode = DjiFlightController_TurnOnMotors(); | ||
| 613 | + if (returnCode == DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 614 | + USER_LOG_ERROR("Turn on motors successfully, but arrest-flying failed"); | ||
| 615 | + s_osalHandler->TaskSleepMs(4000); | ||
| 616 | + USER_LOG_INFO("--> Step 3: Turn off motors\r\n"); | ||
| 617 | + DjiTest_WidgetLogAppend("--> Step 3: Turn off motors\r\n"); | ||
| 618 | + returnCode = DjiFlightController_TurnOffMotors(); | ||
| 619 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 620 | + USER_LOG_ERROR("Turn off motors failed, error code: 0x%08X", returnCode); | ||
| 621 | + } | ||
| 622 | + goto out; | ||
| 623 | + } | ||
| 624 | + | ||
| 625 | + USER_LOG_INFO("Turn on motors failed.Arrest-flying successfully\r\n"); | ||
| 626 | + DjiTest_WidgetLogAppend("Turn on motors failed.Arrest-flying successfully\r\n"); | ||
| 627 | + s_osalHandler->TaskSleepMs(2000); | ||
| 628 | + | ||
| 629 | + USER_LOG_INFO("--> Step 3: Disable arrest-flying"); | ||
| 630 | + DjiTest_WidgetLogAppend("--> Step 3: Disable arrest-flying"); | ||
| 631 | + returnCode = DjiFlightController_CancelArrestFlying(); | ||
| 632 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 633 | + USER_LOG_ERROR("Disable arrest-flying failed, error code: 0x%08X", returnCode); | ||
| 634 | + goto out; | ||
| 635 | + } | ||
| 636 | + s_osalHandler->TaskSleepMs(2000); | ||
| 637 | + | ||
| 638 | + USER_LOG_INFO("--> Step 4: Turn on motors\r\n"); | ||
| 639 | + DjiTest_WidgetLogAppend("--> Step 4: Turn on motors\r\n"); | ||
| 640 | + returnCode = DjiFlightController_TurnOnMotors(); | ||
| 641 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 642 | + USER_LOG_ERROR("Turn on motors failed and disable arrest-flying failed, error code: 0x%08X", returnCode); | ||
| 643 | + goto out; | ||
| 644 | + } else { | ||
| 645 | + USER_LOG_INFO("Turn on motors successfully and disable arrest-flying successfully\r\n"); | ||
| 646 | + s_osalHandler->TaskSleepMs(4000); | ||
| 647 | + USER_LOG_INFO("--> Step 5: Turn off motors"); | ||
| 648 | + DjiTest_WidgetLogAppend("--> Step 5: Turn off motors"); | ||
| 649 | + returnCode = DjiFlightController_TurnOffMotors(); | ||
| 650 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 651 | + USER_LOG_ERROR("Turn off motors failed, error code: 0x%08X", returnCode); | ||
| 652 | + } | ||
| 653 | + } | ||
| 654 | + | ||
| 655 | +out: | ||
| 656 | + USER_LOG_INFO("Flight control arrest-flying sample end"); | ||
| 657 | + DjiTest_WidgetLogAppend("Flight control arrest-flying sample end"); | ||
| 658 | +} | ||
| 659 | + | ||
| 660 | +void DjiTest_FlightControlSetGetParamSample() | ||
| 661 | +{ | ||
| 662 | + T_DjiReturnCode returnCode; | ||
| 663 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalVisualObstacleAvoidanceStatus; | ||
| 664 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus horizontalRadarObstacleAvoidanceStatus; | ||
| 665 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsVisualObstacleAvoidanceStatus; | ||
| 666 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus upwardsRadarObstacleAvoidanceStatus; | ||
| 667 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus downloadsVisualObstacleAvoidanceStatus; | ||
| 668 | + E_DjiFlightControllerGoHomeAltitude goHomeAltitude; | ||
| 669 | + E_DjiFlightControllerRtkPositionEnableStatus rtkEnableStatus; | ||
| 670 | + E_DjiFlightControllerRCLostAction rcLostAction; | ||
| 671 | + T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo; | ||
| 672 | + uint16_t countryCode; | ||
| 673 | + | ||
| 674 | + returnCode = DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo); | ||
| 675 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 676 | + USER_LOG_ERROR("get aircraft base info error"); | ||
| 677 | + } | ||
| 678 | + | ||
| 679 | + USER_LOG_INFO("Flight control set-get-param sample start"); | ||
| 680 | + DjiTest_WidgetLogAppend("Flight control set-get-param sample start"); | ||
| 681 | + | ||
| 682 | + returnCode = DjiFlightController_GetCountryCode(&countryCode); | ||
| 683 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 684 | + USER_LOG_ERROR("Get aircraft country code error."); | ||
| 685 | + } | ||
| 686 | + USER_LOG_INFO("country code: %hd", countryCode); | ||
| 687 | + | ||
| 688 | + /*! Turn on horizontal vision avoid enable */ | ||
| 689 | + USER_LOG_INFO("--> Step 1: Turn on horizontal visual obstacle avoidance"); | ||
| 690 | + DjiTest_WidgetLogAppend("--> Step 1: Turn on horizontal visual obstacle avoidance"); | ||
| 691 | + returnCode = DjiFlightController_SetHorizontalVisualObstacleAvoidanceEnableStatus( | ||
| 692 | + DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); | ||
| 693 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 694 | + USER_LOG_ERROR("Turn on horizontal visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 695 | + goto out; | ||
| 696 | + }; | ||
| 697 | + s_osalHandler->TaskSleepMs(1000); | ||
| 698 | + | ||
| 699 | + USER_LOG_INFO("--> Step 2: Get horizontal horizontal visual obstacle status\r\n"); | ||
| 700 | + DjiTest_WidgetLogAppend("--> Step 2: Get horizontal horizontal visual obstacle status\r\n"); | ||
| 701 | + returnCode = DjiFlightController_GetHorizontalVisualObstacleAvoidanceEnableStatus( | ||
| 702 | + &horizontalVisualObstacleAvoidanceStatus); | ||
| 703 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 704 | + USER_LOG_ERROR("Get horizontal visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 705 | + goto out; | ||
| 706 | + } | ||
| 707 | + USER_LOG_INFO("Current horizontal visual obstacle avoidance status is %d\r\n", | ||
| 708 | + horizontalVisualObstacleAvoidanceStatus); | ||
| 709 | + s_osalHandler->TaskSleepMs(1000); | ||
| 710 | + | ||
| 711 | + /*! Turn on horizontal radar avoid enable */ | ||
| 712 | + USER_LOG_INFO("--> Step 3: Turn on horizontal radar obstacle avoidance"); | ||
| 713 | + DjiTest_WidgetLogAppend("--> Step 3: Turn on horizontal radar obstacle avoidance"); | ||
| 714 | + if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK || | ||
| 715 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | ||
| 716 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | ||
| 717 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK) { | ||
| 718 | + returnCode = DjiFlightController_SetHorizontalRadarObstacleAvoidanceEnableStatus( | ||
| 719 | + DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); | ||
| 720 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 721 | + USER_LOG_ERROR("Turn on horizontal radar obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 722 | + goto out; | ||
| 723 | + }; | ||
| 724 | + } | ||
| 725 | + s_osalHandler->TaskSleepMs(1000); | ||
| 726 | + | ||
| 727 | + USER_LOG_INFO("--> Step 4: Get horizontal radar obstacle avoidance status\r\n"); | ||
| 728 | + DjiTest_WidgetLogAppend("--> Step 4: Get horizontal radar obstacle avoidance status\r\n"); | ||
| 729 | + if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK || | ||
| 730 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | ||
| 731 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | ||
| 732 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK) { | ||
| 733 | + returnCode = DjiFlightController_GetHorizontalRadarObstacleAvoidanceEnableStatus( | ||
| 734 | + &horizontalRadarObstacleAvoidanceStatus); | ||
| 735 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 736 | + USER_LOG_ERROR("Get horizontal radar obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 737 | + goto out; | ||
| 738 | + } | ||
| 739 | + USER_LOG_INFO("Current horizontal radar obstacle avoidance status is %d\r\n", | ||
| 740 | + horizontalRadarObstacleAvoidanceStatus); | ||
| 741 | + } | ||
| 742 | + s_osalHandler->TaskSleepMs(1000); | ||
| 743 | + | ||
| 744 | + /*! Turn on upwards vision avoid enable */ | ||
| 745 | + USER_LOG_INFO("--> Step 5: Turn on upwards visual obstacle avoidance."); | ||
| 746 | + DjiTest_WidgetLogAppend("--> Step 5: Turn on upwards visual obstacle avoidance."); | ||
| 747 | + returnCode = DjiFlightController_SetUpwardsVisualObstacleAvoidanceEnableStatus( | ||
| 748 | + DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); | ||
| 749 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 750 | + USER_LOG_ERROR("Turn on upwards visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 751 | + goto out; | ||
| 752 | + }; | ||
| 753 | + s_osalHandler->TaskSleepMs(1000); | ||
| 754 | + | ||
| 755 | + USER_LOG_INFO("--> Step 6: Get upwards visual obstacle avoidance status\r\n"); | ||
| 756 | + DjiTest_WidgetLogAppend("--> Step 6: Get upwards visual obstacle avoidance status\r\n"); | ||
| 757 | + returnCode = DjiFlightController_GetUpwardsVisualObstacleAvoidanceEnableStatus( | ||
| 758 | + &upwardsVisualObstacleAvoidanceStatus); | ||
| 759 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 760 | + USER_LOG_ERROR("Get upwards visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 761 | + goto out; | ||
| 762 | + } | ||
| 763 | + USER_LOG_INFO("Current upwards visual obstacle avoidance status is %d\r\n", upwardsVisualObstacleAvoidanceStatus); | ||
| 764 | + s_osalHandler->TaskSleepMs(1000); | ||
| 765 | + | ||
| 766 | + /*! Turn on upwards radar avoid enable */ | ||
| 767 | + USER_LOG_INFO("--> Step 7: Turn on upwards radar obstacle avoidance."); | ||
| 768 | + DjiTest_WidgetLogAppend("--> Step 7: Turn on upwards radar obstacle avoidance."); | ||
| 769 | + if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK || | ||
| 770 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | ||
| 771 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | ||
| 772 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK) { | ||
| 773 | + returnCode = DjiFlightController_SetUpwardsRadarObstacleAvoidanceEnableStatus( | ||
| 774 | + DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); | ||
| 775 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 776 | + USER_LOG_ERROR("Turn on upwards radar obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 777 | + goto out; | ||
| 778 | + } | ||
| 779 | + } | ||
| 780 | + s_osalHandler->TaskSleepMs(1000); | ||
| 781 | + | ||
| 782 | + USER_LOG_INFO("--> Step 8: Get upwards radar obstacle avoidance status\r\n"); | ||
| 783 | + DjiTest_WidgetLogAppend("--> Step 8: Get upwards radar obstacle avoidance status\r\n"); | ||
| 784 | + if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK || | ||
| 785 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || | ||
| 786 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T || | ||
| 787 | + aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK) { | ||
| 788 | + returnCode = DjiFlightController_GetUpwardsRadarObstacleAvoidanceEnableStatus( | ||
| 789 | + &upwardsRadarObstacleAvoidanceStatus); | ||
| 790 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 791 | + USER_LOG_ERROR("Get upwards radar obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 792 | + goto out; | ||
| 793 | + } | ||
| 794 | + USER_LOG_INFO("Current upwards radar obstacle avoidance status is %d\r\n", upwardsRadarObstacleAvoidanceStatus); | ||
| 795 | + s_osalHandler->TaskSleepMs(1000); | ||
| 796 | + } | ||
| 797 | + | ||
| 798 | + /*! Turn on downwards vision avoid enable */ | ||
| 799 | + USER_LOG_INFO("--> Step 9: Turn on downwards visual obstacle avoidance."); | ||
| 800 | + DjiTest_WidgetLogAppend("--> Step 9: Turn on downwards visual obstacle avoidance."); | ||
| 801 | + returnCode = DjiFlightController_SetDownwardsVisualObstacleAvoidanceEnableStatus( | ||
| 802 | + DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE); | ||
| 803 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 804 | + USER_LOG_ERROR("Turn on downwards visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 805 | + goto out; | ||
| 806 | + } | ||
| 807 | + s_osalHandler->TaskSleepMs(1000); | ||
| 808 | + | ||
| 809 | + USER_LOG_INFO("--> Step 10: Get downwards visual obstacle avoidance status\r\n"); | ||
| 810 | + DjiTest_WidgetLogAppend("--> Step 10: Get downwards visual obstacle avoidance status\r\n"); | ||
| 811 | + returnCode = DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus( | ||
| 812 | + &downloadsVisualObstacleAvoidanceStatus); | ||
| 813 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 814 | + USER_LOG_ERROR("Get downwards visual obstacle avoidance failed, error code: 0x%08X", returnCode); | ||
| 815 | + goto out; | ||
| 816 | + } | ||
| 817 | + USER_LOG_INFO("Current downwards visual obstacle avoidance status is %d\r\n", | ||
| 818 | + downloadsVisualObstacleAvoidanceStatus); | ||
| 819 | + s_osalHandler->TaskSleepMs(1000); | ||
| 820 | + | ||
| 821 | + /*! Set new go home altitude */ | ||
| 822 | + USER_LOG_INFO("--> Step 11: Set go home altitude to 50(m)"); | ||
| 823 | + DjiTest_WidgetLogAppend("--> Step 11: Set go home altitude to 50(m)"); | ||
| 824 | + returnCode = DjiFlightController_SetGoHomeAltitude(50); | ||
| 825 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 826 | + USER_LOG_ERROR("Set go home altitude to 50(m) failed, error code: 0x%08X", returnCode); | ||
| 827 | + goto out; | ||
| 828 | + } | ||
| 829 | + s_osalHandler->TaskSleepMs(1000); | ||
| 830 | + | ||
| 831 | + /*! get go home altitude */ | ||
| 832 | + USER_LOG_INFO("--> Step 12: Get go home altitude\r\n"); | ||
| 833 | + DjiTest_WidgetLogAppend("--> Step 12: Get go home altitude\r\n"); | ||
| 834 | + returnCode = DjiFlightController_GetGoHomeAltitude(&goHomeAltitude); | ||
| 835 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 836 | + USER_LOG_ERROR("Get go home altitude failed, error code: 0x%08X", returnCode); | ||
| 837 | + goto out; | ||
| 838 | + } | ||
| 839 | + USER_LOG_INFO("Current go home altitude is %d m\r\n", goHomeAltitude); | ||
| 840 | + s_osalHandler->TaskSleepMs(2000); | ||
| 841 | + | ||
| 842 | + /*! Set rtk enable */ | ||
| 843 | + USER_LOG_INFO("--> Step 13: Set rtk enable status"); | ||
| 844 | + DjiTest_WidgetLogAppend("--> Step 13: Set rtk enable status"); | ||
| 845 | + returnCode = DjiFlightController_SetRtkPositionEnableStatus(DJI_FLIGHT_CONTROLLER_ENABLE_RTK_POSITION); | ||
| 846 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 847 | + USER_LOG_ERROR("Set rtk enable failed, error code: 0x%08X", returnCode); | ||
| 848 | + goto out; | ||
| 849 | + } | ||
| 850 | + s_osalHandler->TaskSleepMs(1000); | ||
| 851 | + | ||
| 852 | + USER_LOG_INFO("--> Step 14: Get rtk enable status\r\n"); | ||
| 853 | + DjiTest_WidgetLogAppend("--> Step 14: Get rtk enable status\r\n"); | ||
| 854 | + returnCode = DjiFlightController_GetRtkPositionEnableStatus(&rtkEnableStatus); | ||
| 855 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 856 | + USER_LOG_ERROR("Get rtk enable failed, error code: 0x%08X", returnCode); | ||
| 857 | + goto out; | ||
| 858 | + } | ||
| 859 | + USER_LOG_INFO("Current rtk enable status is %d\r\n", rtkEnableStatus); | ||
| 860 | + s_osalHandler->TaskSleepMs(1000); | ||
| 861 | + | ||
| 862 | + /*! Set rc lost action */ | ||
| 863 | + if (aircraftInfoBaseInfo.aircraftType != DJI_AIRCRAFT_TYPE_M300_RTK && | ||
| 864 | + aircraftInfoBaseInfo.aircraftType != DJI_AIRCRAFT_TYPE_M350_RTK) { | ||
| 865 | + USER_LOG_INFO("--> Step 15: Set rc lost action"); | ||
| 866 | + DjiTest_WidgetLogAppend("--> Step 15: Set rc lost action"); | ||
| 867 | + returnCode = DjiFlightController_SetRCLostAction(DJI_FLIGHT_CONTROLLER_RC_LOST_ACTION_GOHOME); | ||
| 868 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 869 | + USER_LOG_ERROR("Set rc lost action failed, error code: 0x%08X", returnCode); | ||
| 870 | + goto out; | ||
| 871 | + } | ||
| 872 | + s_osalHandler->TaskSleepMs(1000); | ||
| 873 | + | ||
| 874 | + USER_LOG_INFO("--> Step 16: Get rc lost action\r\n"); | ||
| 875 | + DjiTest_WidgetLogAppend("--> Step 16: Get rc lost action\r\n"); | ||
| 876 | + returnCode = DjiFlightController_GetRCLostAction(&rcLostAction); | ||
| 877 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 878 | + USER_LOG_ERROR("Get rc lost action failed, error code: 0x%08X", returnCode); | ||
| 879 | + goto out; | ||
| 880 | + } | ||
| 881 | + USER_LOG_INFO("Current rc lost action is %d\r\n", rcLostAction); | ||
| 882 | + DjiTest_WidgetLogAppend("Current rc lost action is %d\r\n", rcLostAction); | ||
| 883 | + s_osalHandler->TaskSleepMs(1000); | ||
| 884 | + } | ||
| 885 | + | ||
| 886 | +out: | ||
| 887 | + USER_LOG_INFO("Flight control set-get-param sample end"); | ||
| 888 | + DjiTest_WidgetLogAppend("Flight control set-get-param sample end"); | ||
| 889 | +} | ||
| 890 | + | ||
| 891 | +T_DjiReturnCode DjiTest_TriggerFtsEventCallback(void) | ||
| 892 | +{ | ||
| 893 | + USER_LOG_INFO("Received FTS Trigger event, count = %d.", s_ftsTriggerCount); | ||
| 894 | + if (s_ftsTriggerCount == 0) { | ||
| 895 | + USER_LOG_WARN("Note: Simulate a trigger failure scenario and return an error value, this function will be invoked again."); | ||
| 896 | + s_ftsTriggerCount++; | ||
| 897 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR; | ||
| 898 | + } else { | ||
| 899 | + USER_LOG_WARN("Note: This is an empty implementation, and the FTS signal needs to be triggered by the PWM signal."); | ||
| 900 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 901 | + } | ||
| 902 | +} | ||
| 903 | + | ||
| 904 | +void DjiTest_FlightControlPassiveTriggerFtsSample(void) | ||
| 905 | +{ | ||
| 906 | + T_DjiReturnCode returnCode; | ||
| 907 | + | ||
| 908 | + USER_LOG_INFO("Flight control passive trigger FTS sample start."); | ||
| 909 | + | ||
| 910 | + if (s_isFtsCallbackRegistered == false) { | ||
| 911 | + returnCode = DjiFlightController_RegTriggerFtsEventCallback(DjiTest_TriggerFtsEventCallback); | ||
| 912 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 913 | + USER_LOG_ERROR("Register trigger FTS event callback failed."); | ||
| 914 | + return; | ||
| 915 | + } else { | ||
| 916 | + s_isFtsCallbackRegistered = true; | ||
| 917 | + USER_LOG_INFO("Register trigger FTS event callback successfully." | ||
| 918 | + "Please wait for the aircraft to trigger the payload to execute FTS action."); | ||
| 919 | + } | ||
| 920 | + } else { | ||
| 921 | + USER_LOG_WARN("FTS trigger event callback has been registered, no need to register again."); | ||
| 922 | + } | ||
| 923 | +} | ||
| 924 | + | ||
| 925 | +void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect) | ||
| 926 | +{ | ||
| 927 | + switch (flightCtrlSampleSelect) { | ||
| 928 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_LANDING: { | ||
| 929 | + DjiTest_FlightControlTakeOffLandingSample(); | ||
| 930 | + break; | ||
| 931 | + } | ||
| 932 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_POSITION_CTRL_LANDING: { | ||
| 933 | + DjiTest_FlightControlPositionControlSample(); | ||
| 934 | + break; | ||
| 935 | + } | ||
| 936 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_GO_HOME_FORCE_LANDING: { | ||
| 937 | + DjiTest_FlightControlGoHomeForceLandingSample(); | ||
| 938 | + break; | ||
| 939 | + } | ||
| 940 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_TAKE_OFF_VELOCITY_CTRL_LANDING: { | ||
| 941 | + DjiTest_FlightControlVelocityControlSample(); | ||
| 942 | + break; | ||
| 943 | + } | ||
| 944 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_ARREST_FLYING: { | ||
| 945 | + DjiTest_FlightControlArrestFlyingSample(); | ||
| 946 | + break; | ||
| 947 | + } | ||
| 948 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SET_GET_PARAM: { | ||
| 949 | + DjiTest_FlightControlSetGetParamSample(); | ||
| 950 | + break; | ||
| 951 | + } | ||
| 952 | + case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_FTS_TRIGGER: { | ||
| 953 | + DjiTest_FlightControlPassiveTriggerFtsSample(); | ||
| 954 | + break; | ||
| 955 | + } | ||
| 956 | + default: | ||
| 957 | + break; | ||
| 958 | + } | ||
| 959 | +} | ||
| 960 | + | ||
| 961 | +uint8_t DjiTest_FlightControlGetDisplayModeIndex(E_DjiFcSubscriptionDisplayMode displayMode) | ||
| 962 | +{ | ||
| 963 | + uint8_t i; | ||
| 964 | + | ||
| 965 | + for (i = 0; i < sizeof(s_flightControlDisplayModeStr) / sizeof(T_DjiTestFlightControlDisplayModeStr); i++) { | ||
| 966 | + if (s_flightControlDisplayModeStr[i].displayMode == displayMode) { | ||
| 967 | + return i; | ||
| 968 | + } | ||
| 969 | + } | ||
| 970 | + | ||
| 971 | + return i; | ||
| 972 | +} | ||
| 973 | + | ||
| 974 | +T_DjiFcSubscriptionFlightStatus DjiTest_FlightControlGetValueOfFlightStatus(void) | ||
| 975 | +{ | ||
| 976 | + T_DjiReturnCode djiStat; | ||
| 977 | + T_DjiFcSubscriptionFlightStatus flightStatus; | ||
| 978 | + T_DjiDataTimestamp flightStatusTimestamp = {0}; | ||
| 979 | + | ||
| 980 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_STATUS_FLIGHT, | ||
| 981 | + (uint8_t *) &flightStatus, | ||
| 982 | + sizeof(T_DjiFcSubscriptionFlightStatus), | ||
| 983 | + &flightStatusTimestamp); | ||
| 984 | + | ||
| 985 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 986 | + USER_LOG_ERROR("Get value of topic flight status error, error code: 0x%08X", djiStat); | ||
| 987 | + flightStatus = 0; | ||
| 988 | + } else { | ||
| 989 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", flightStatusTimestamp.millisecond, | ||
| 990 | + flightStatusTimestamp.microsecond); | ||
| 991 | + USER_LOG_DEBUG("Flight status: %d.", flightStatus); | ||
| 992 | + } | ||
| 993 | + | ||
| 994 | + return flightStatus; | ||
| 995 | +} | ||
| 996 | + | ||
| 997 | +T_DjiFcSubscriptionDisplaymode DjiTest_FlightControlGetValueOfDisplayMode(void) | ||
| 998 | +{ | ||
| 999 | + T_DjiReturnCode djiStat; | ||
| 1000 | + T_DjiFcSubscriptionDisplaymode displayMode; | ||
| 1001 | + T_DjiDataTimestamp displayModeTimestamp = {0}; | ||
| 1002 | + | ||
| 1003 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_STATUS_DISPLAYMODE, | ||
| 1004 | + (uint8_t *) &displayMode, | ||
| 1005 | + sizeof(T_DjiFcSubscriptionDisplaymode), | ||
| 1006 | + &displayModeTimestamp); | ||
| 1007 | + | ||
| 1008 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1009 | + USER_LOG_ERROR("Get value of topic display mode error, error code: 0x%08X", djiStat); | ||
| 1010 | + displayMode = 0; | ||
| 1011 | + } else { | ||
| 1012 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", displayModeTimestamp.millisecond, | ||
| 1013 | + displayModeTimestamp.microsecond); | ||
| 1014 | + USER_LOG_DEBUG("Display mode : %d.", displayMode); | ||
| 1015 | + } | ||
| 1016 | + | ||
| 1017 | + return displayMode; | ||
| 1018 | +} | ||
| 1019 | + | ||
| 1020 | +T_DjiFcSubscriptionHeightFusion DjiTest_FlightControlGetValueOfHeightFusion(void) | ||
| 1021 | +{ | ||
| 1022 | + T_DjiReturnCode djiStat; | ||
| 1023 | + T_DjiFcSubscriptionHeightFusion heightFusion = {0}; | ||
| 1024 | + T_DjiDataTimestamp timestamp = {0}; | ||
| 1025 | + | ||
| 1026 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, | ||
| 1027 | + (uint8_t *) &heightFusion, | ||
| 1028 | + sizeof(T_DjiFcSubscriptionHeightFusion), | ||
| 1029 | + ×tamp); | ||
| 1030 | + | ||
| 1031 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1032 | + USER_LOG_ERROR("Get value of topic height fusion error, error code: 0x%08X", djiStat); | ||
| 1033 | + } else { | ||
| 1034 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", timestamp.millisecond, timestamp.microsecond); | ||
| 1035 | + USER_LOG_DEBUG("Relative height fusion is %f m", heightFusion); | ||
| 1036 | + } | ||
| 1037 | + | ||
| 1038 | + return heightFusion; | ||
| 1039 | +} | ||
| 1040 | + | ||
| 1041 | +T_DjiFcSubscriptionQuaternion DjiTest_FlightControlGetValueOfQuaternion(void) | ||
| 1042 | +{ | ||
| 1043 | + T_DjiReturnCode djiStat; | ||
| 1044 | + T_DjiFcSubscriptionQuaternion quaternion = {0}; | ||
| 1045 | + T_DjiDataTimestamp quaternionTimestamp = {0}; | ||
| 1046 | + | ||
| 1047 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_QUATERNION, | ||
| 1048 | + (uint8_t *) &quaternion, | ||
| 1049 | + sizeof(T_DjiFcSubscriptionQuaternion), | ||
| 1050 | + &quaternionTimestamp); | ||
| 1051 | + | ||
| 1052 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1053 | + USER_LOG_ERROR("Get value of topic quaternion error, error code: 0x%08X", djiStat); | ||
| 1054 | + } else { | ||
| 1055 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", quaternionTimestamp.millisecond, | ||
| 1056 | + quaternionTimestamp.microsecond); | ||
| 1057 | + USER_LOG_DEBUG("Quaternion: %f %f %f %f.", quaternion.q0, quaternion.q1, quaternion.q2, quaternion.q3); | ||
| 1058 | + } | ||
| 1059 | + | ||
| 1060 | + return quaternion; | ||
| 1061 | +} | ||
| 1062 | + | ||
| 1063 | +T_DjiFcSubscriptionPositionFused DjiTest_FlightControlGetValueOfPositionFused(void) | ||
| 1064 | +{ | ||
| 1065 | + T_DjiReturnCode djiStat; | ||
| 1066 | + T_DjiFcSubscriptionPositionFused positionFused = {0}; | ||
| 1067 | + T_DjiDataTimestamp positionFusedTimestamp = {0}; | ||
| 1068 | + | ||
| 1069 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_POSITION_FUSED, | ||
| 1070 | + (uint8_t *) &positionFused, | ||
| 1071 | + sizeof(T_DjiFcSubscriptionPositionFused), | ||
| 1072 | + &positionFusedTimestamp); | ||
| 1073 | + | ||
| 1074 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1075 | + USER_LOG_ERROR("Get value of topic position fused error, error code: 0x%08X", djiStat); | ||
| 1076 | + } else { | ||
| 1077 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", positionFusedTimestamp.millisecond, | ||
| 1078 | + positionFusedTimestamp.microsecond); | ||
| 1079 | + USER_LOG_DEBUG("PositionFused: %f, %f,%f,%d.", positionFused.latitude, positionFused.longitude, | ||
| 1080 | + positionFused.altitude, positionFused.visibleSatelliteNumber); | ||
| 1081 | + } | ||
| 1082 | + | ||
| 1083 | + return positionFused; | ||
| 1084 | +} | ||
| 1085 | + | ||
| 1086 | +dji_f32_t DjiTest_FlightControlGetValueOfRelativeHeight(void) | ||
| 1087 | +{ | ||
| 1088 | + T_DjiReturnCode djiStat; | ||
| 1089 | + T_DjiFcSubscriptionAltitudeFused altitudeFused = 0; | ||
| 1090 | + T_DjiFcSubscriptionAltitudeOfHomePoint homePointAltitude = 0; | ||
| 1091 | + dji_f32_t relativeHeight = 0; | ||
| 1092 | + T_DjiDataTimestamp relativeHeightTimestamp = {0}; | ||
| 1093 | + | ||
| 1094 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_ALTITUDE_OF_HOMEPOINT, | ||
| 1095 | + (uint8_t *) &homePointAltitude, | ||
| 1096 | + sizeof(T_DjiFcSubscriptionAltitudeOfHomePoint), | ||
| 1097 | + &relativeHeightTimestamp); | ||
| 1098 | + | ||
| 1099 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1100 | + USER_LOG_ERROR("Get value of topic altitude of home point error, error code: 0x%08X", djiStat); | ||
| 1101 | + return -1; | ||
| 1102 | + } else { | ||
| 1103 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", relativeHeightTimestamp.millisecond, | ||
| 1104 | + relativeHeightTimestamp.microsecond); | ||
| 1105 | + } | ||
| 1106 | + | ||
| 1107 | + djiStat = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_ALTITUDE_FUSED, | ||
| 1108 | + (uint8_t *) &altitudeFused, | ||
| 1109 | + sizeof(T_DjiFcSubscriptionAltitudeFused), | ||
| 1110 | + &relativeHeightTimestamp); | ||
| 1111 | + | ||
| 1112 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1113 | + USER_LOG_ERROR("Get value of topic altitude fused error, error code: 0x%08X", djiStat); | ||
| 1114 | + return -1; | ||
| 1115 | + } else { | ||
| 1116 | + USER_LOG_DEBUG("Timestamp: millisecond %u microsecond %u.", relativeHeightTimestamp.millisecond, | ||
| 1117 | + relativeHeightTimestamp.microsecond); | ||
| 1118 | + } | ||
| 1119 | + | ||
| 1120 | + relativeHeight = altitudeFused - homePointAltitude; | ||
| 1121 | + | ||
| 1122 | + return relativeHeight; | ||
| 1123 | +} | ||
| 1124 | + | ||
| 1125 | +bool DjiTest_FlightControlMotorStartedCheck(void) | ||
| 1126 | +{ | ||
| 1127 | + int motorsNotStarted = 0; | ||
| 1128 | + int timeoutCycles = 20; | ||
| 1129 | + | ||
| 1130 | + while (DjiTest_FlightControlGetValueOfFlightStatus() != DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_ON_GROUND && | ||
| 1131 | + DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ENGINE_START && | ||
| 1132 | + motorsNotStarted < timeoutCycles) { | ||
| 1133 | + motorsNotStarted++; | ||
| 1134 | + s_osalHandler->TaskSleepMs(100); | ||
| 1135 | + } | ||
| 1136 | + return motorsNotStarted != timeoutCycles ? true : false; | ||
| 1137 | +} | ||
| 1138 | + | ||
| 1139 | +bool DjiTest_FlightControlTakeOffInAirCheck(void) | ||
| 1140 | +{ | ||
| 1141 | + int stillOnGround = 0; | ||
| 1142 | + int timeoutCycles = 110; | ||
| 1143 | + | ||
| 1144 | + while (DjiTest_FlightControlGetValueOfFlightStatus() != DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR && | ||
| 1145 | + (DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ASSISTED_TAKEOFF || | ||
| 1146 | + DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_TAKEOFF) && | ||
| 1147 | + stillOnGround < timeoutCycles) { | ||
| 1148 | + stillOnGround++; | ||
| 1149 | + s_osalHandler->TaskSleepMs(100); | ||
| 1150 | + } | ||
| 1151 | + | ||
| 1152 | + return stillOnGround != timeoutCycles ? true : false; | ||
| 1153 | +} | ||
| 1154 | + | ||
| 1155 | +bool takeoffFinishedCheck(void) | ||
| 1156 | +{ | ||
| 1157 | + while (DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_TAKEOFF || | ||
| 1158 | + DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ASSISTED_TAKEOFF) { | ||
| 1159 | + s_osalHandler->TaskSleepMs(1000); | ||
| 1160 | + } | ||
| 1161 | + | ||
| 1162 | + return (DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_P_GPS || | ||
| 1163 | + DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE) ? true : false; | ||
| 1164 | +} | ||
| 1165 | + | ||
| 1166 | +bool DjiTest_FlightControlLandFinishedCheck(void) | ||
| 1167 | +{ | ||
| 1168 | + while (DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING || | ||
| 1169 | + DjiTest_FlightControlGetValueOfFlightStatus() == DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR) { | ||
| 1170 | + s_osalHandler->TaskSleepMs(1000); | ||
| 1171 | + } | ||
| 1172 | + | ||
| 1173 | + return (DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_P_GPS || | ||
| 1174 | + DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE) ? true : false; | ||
| 1175 | +} | ||
| 1176 | + | ||
| 1177 | +bool DjiTest_FlightControlCheckActionStarted(E_DjiFcSubscriptionDisplayMode mode) | ||
| 1178 | +{ | ||
| 1179 | + int actionNotStarted = 0; | ||
| 1180 | + int timeoutCycles = 20; | ||
| 1181 | + | ||
| 1182 | + while (DjiTest_FlightControlGetValueOfDisplayMode() != mode && actionNotStarted < timeoutCycles) { | ||
| 1183 | + actionNotStarted++; | ||
| 1184 | + s_osalHandler->TaskSleepMs(100); | ||
| 1185 | + } | ||
| 1186 | + | ||
| 1187 | + if (actionNotStarted == timeoutCycles) { | ||
| 1188 | + USER_LOG_ERROR("%s start failed, now flight is in %s.", | ||
| 1189 | + s_flightControlDisplayModeStr[DjiTest_FlightControlGetDisplayModeIndex(mode)].displayModeStr, | ||
| 1190 | + s_flightControlDisplayModeStr[DjiTest_FlightControlGetDisplayModeIndex( | ||
| 1191 | + DjiTest_FlightControlGetValueOfDisplayMode())].displayModeStr); | ||
| 1192 | + return false; | ||
| 1193 | + } else { | ||
| 1194 | + USER_LOG_INFO("Now flight is in %s.", | ||
| 1195 | + s_flightControlDisplayModeStr[DjiTest_FlightControlGetDisplayModeIndex(mode)].displayModeStr); | ||
| 1196 | + return true; | ||
| 1197 | + } | ||
| 1198 | +} | ||
| 1199 | + | ||
| 1200 | +bool DjiTest_FlightControlMonitoredTakeoff(void) | ||
| 1201 | +{ | ||
| 1202 | + T_DjiReturnCode djiStat; | ||
| 1203 | + | ||
| 1204 | + //! Start takeoff | ||
| 1205 | + djiStat = DjiFlightController_StartTakeoff(); | ||
| 1206 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1207 | + USER_LOG_ERROR("Request to take off failed, error code: 0x%08X", djiStat); | ||
| 1208 | + return false; | ||
| 1209 | + } | ||
| 1210 | + | ||
| 1211 | + //! Motors start check | ||
| 1212 | + if (!DjiTest_FlightControlMotorStartedCheck()) { | ||
| 1213 | + USER_LOG_ERROR("Takeoff failed. Motors are not spinning."); | ||
| 1214 | + return false; | ||
| 1215 | + } else { | ||
| 1216 | + USER_LOG_INFO("Motors spinning..."); | ||
| 1217 | + } | ||
| 1218 | + //! In air check | ||
| 1219 | + if (!DjiTest_FlightControlTakeOffInAirCheck()) { | ||
| 1220 | + USER_LOG_ERROR("Takeoff failed. Aircraft is still on the ground, but the " | ||
| 1221 | + "motors are spinning"); | ||
| 1222 | + return false; | ||
| 1223 | + } else { | ||
| 1224 | + USER_LOG_INFO("Ascending..."); | ||
| 1225 | + } | ||
| 1226 | + //! Finished takeoff check | ||
| 1227 | + if (!takeoffFinishedCheck()) { | ||
| 1228 | + USER_LOG_ERROR("Takeoff finished, but the aircraft is in an unexpected mode. " | ||
| 1229 | + "Please connect DJI GO."); | ||
| 1230 | + return false; | ||
| 1231 | + } | ||
| 1232 | + | ||
| 1233 | + return true; | ||
| 1234 | +} | ||
| 1235 | + | ||
| 1236 | +bool DjiTest_FlightControlMonitoredLanding(void) | ||
| 1237 | +{ | ||
| 1238 | + T_DjiReturnCode djiStat; | ||
| 1239 | + /*! Step 1: Start landing */ | ||
| 1240 | + djiStat = DjiFlightController_StartLanding(); | ||
| 1241 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1242 | + USER_LOG_ERROR("Start landing failed, error code: 0x%08X", djiStat); | ||
| 1243 | + return false; | ||
| 1244 | + } | ||
| 1245 | + | ||
| 1246 | + /*! Step 2: check Landing start*/ | ||
| 1247 | + if (!DjiTest_FlightControlCheckActionStarted(DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING)) { | ||
| 1248 | + USER_LOG_ERROR("Fail to execute Landing action!"); | ||
| 1249 | + return false; | ||
| 1250 | + } else { | ||
| 1251 | + /*! Step 3: check Landing finished*/ | ||
| 1252 | + if (!DjiTest_FlightControlLandFinishedCheck()) { | ||
| 1253 | + USER_LOG_ERROR("Landing finished, but the aircraft is in an unexpected mode. " | ||
| 1254 | + "Please connect DJI Assistant."); | ||
| 1255 | + return false; | ||
| 1256 | + } | ||
| 1257 | + } | ||
| 1258 | + | ||
| 1259 | + return true; | ||
| 1260 | +} | ||
| 1261 | + | ||
| 1262 | +bool DjiTest_FlightControlGoHomeAndConfirmLanding(void) | ||
| 1263 | +{ | ||
| 1264 | + T_DjiReturnCode djiStat; | ||
| 1265 | + T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo; | ||
| 1266 | + E_DjiFlightControllerObstacleAvoidanceEnableStatus enableStatus; | ||
| 1267 | + | ||
| 1268 | + djiStat = DjiFlightController_GetDownwardsVisualObstacleAvoidanceEnableStatus(&enableStatus); | ||
| 1269 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1270 | + USER_LOG_ERROR("get downwards visual obstacle avoidance enable status error"); | ||
| 1271 | + } | ||
| 1272 | + | ||
| 1273 | + djiStat = DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo); | ||
| 1274 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1275 | + USER_LOG_ERROR("get aircraft base info error"); | ||
| 1276 | + } | ||
| 1277 | + | ||
| 1278 | + /*! Step 1: Start go home */ | ||
| 1279 | + USER_LOG_INFO("Start go home action"); | ||
| 1280 | + djiStat = DjiFlightController_StartGoHome(); | ||
| 1281 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1282 | + USER_LOG_ERROR("Start to go home failed, error code: 0x%08X", djiStat); | ||
| 1283 | + return false;; | ||
| 1284 | + } | ||
| 1285 | + | ||
| 1286 | + if (!DjiTest_FlightControlCheckActionStarted(DJI_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_GO_HOME)) { | ||
| 1287 | + return false; | ||
| 1288 | + } else { | ||
| 1289 | + while (DjiTest_FlightControlGetValueOfFlightStatus() == DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR && | ||
| 1290 | + DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_NAVI_GO_HOME) { | ||
| 1291 | + s_osalHandler->TaskSleepMs(1000);// waiting for this action finished | ||
| 1292 | + } | ||
| 1293 | + } | ||
| 1294 | + | ||
| 1295 | + /*! Step 2: Start landing */ | ||
| 1296 | + USER_LOG_INFO("Start landing action"); | ||
| 1297 | + if (!DjiTest_FlightControlCheckActionStarted(DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING)) { | ||
| 1298 | + USER_LOG_ERROR("Fail to execute Landing action"); | ||
| 1299 | + return false; | ||
| 1300 | + } else { | ||
| 1301 | + while (DjiTest_FlightControlGetValueOfDisplayMode() == DJI_FC_SUBSCRIPTION_DISPLAY_MODE_AUTO_LANDING && | ||
| 1302 | + DjiTest_FlightControlGetValueOfFlightStatus() == DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR) { | ||
| 1303 | + T_DjiFcSubscriptionHeightFusion heightFusion = DjiTest_FlightControlGetValueOfHeightFusion(); | ||
| 1304 | + s_osalHandler->TaskSleepMs(1000); | ||
| 1305 | + if (DJI_AIRCRAFT_TYPE_M3E == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType | ||
| 1306 | + || DJI_AIRCRAFT_TYPE_M3D == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType | ||
| 1307 | + || DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType | ||
| 1308 | + || DJI_AIRCRAFT_TYPE_M4E == aircraftInfoBaseInfo.aircraftType | ||
| 1309 | + ) { | ||
| 1310 | + if ((dji_f64_t) 0.45 < heightFusion && heightFusion < (dji_f64_t) 0.55) { | ||
| 1311 | + break; | ||
| 1312 | + } | ||
| 1313 | + } else { | ||
| 1314 | + if ((dji_f64_t) 0.65 < heightFusion && heightFusion < (dji_f64_t) 0.75) { | ||
| 1315 | + break; | ||
| 1316 | + } | ||
| 1317 | + } | ||
| 1318 | + } | ||
| 1319 | + } | ||
| 1320 | + | ||
| 1321 | + /*! Step 4: Confirm Landing */ | ||
| 1322 | + USER_LOG_INFO("Start confirm Landing and avoid ground action"); | ||
| 1323 | + djiStat = DjiFlightController_StartConfirmLanding(); | ||
| 1324 | + if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 1325 | + USER_LOG_ERROR("Fail to execute confirm landing avoid ground action, error code: 0x%08X", djiStat); | ||
| 1326 | + return false; | ||
| 1327 | + } | ||
| 1328 | + | ||
| 1329 | + if (enableStatus == DJI_FLIGHT_CONTROLLER_ENABLE_OBSTACLE_AVOIDANCE) { | ||
| 1330 | + if (!DjiTest_FlightControlCheckActionStarted(DJI_FC_SUBSCRIPTION_DISPLAY_MODE_FORCE_AUTO_LANDING)) { | ||
| 1331 | + return false; | ||
| 1332 | + } else { | ||
| 1333 | + while (DjiTest_FlightControlGetValueOfFlightStatus() == DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR && | ||
| 1334 | + DjiTest_FlightControlGetValueOfDisplayMode() == | ||
| 1335 | + DJI_FC_SUBSCRIPTION_DISPLAY_MODE_FORCE_AUTO_LANDING) { | ||
| 1336 | + s_osalHandler->TaskSleepMs(1000); | ||
| 1337 | + } | ||
| 1338 | + } | ||
| 1339 | + } else { | ||
| 1340 | + while (DjiTest_FlightControlGetValueOfFlightStatus() == DJI_FC_SUBSCRIPTION_FLIGHT_STATUS_IN_AIR && | ||
| 1341 | + DjiTest_FlightControlGetValueOfDisplayMode() == | ||
| 1342 | + DJI_FC_SUBSCRIPTION_DISPLAY_MODE_FORCE_AUTO_LANDING) { | ||
| 1343 | + s_osalHandler->TaskSleepMs(1000); | ||
| 1344 | + } | ||
| 1345 | + } | ||
| 1346 | + | ||
| 1347 | + /*! Step 5: Landing finished check*/ | ||
| 1348 | + if (DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_P_GPS || | ||
| 1349 | + DjiTest_FlightControlGetValueOfDisplayMode() != DJI_FC_SUBSCRIPTION_DISPLAY_MODE_ATTITUDE) { | ||
| 1350 | + USER_LOG_INFO("Successful landing"); | ||
| 1351 | + } else { | ||
| 1352 | + USER_LOG_ERROR("Landing finished, but the aircraft is in an unexpected mode. " | ||
| 1353 | + "Please connect DJI Assistant."); | ||
| 1354 | + return false; | ||
| 1355 | + } | ||
| 1356 | + | ||
| 1357 | + return true; | ||
| 1358 | +} | ||
| 1359 | + | ||
| 1360 | +T_DjiTestFlightControlVector3f DjiTest_FlightControlQuaternionToEulerAngle(const T_DjiFcSubscriptionQuaternion quat) | ||
| 1361 | +{ | ||
| 1362 | + T_DjiTestFlightControlVector3f eulerAngle; | ||
| 1363 | + double q2sqr = quat.q2 * quat.q2; | ||
| 1364 | + double t0 = -2.0 * (q2sqr + quat.q3 * quat.q3) + 1.0; | ||
| 1365 | + double t1 = (dji_f64_t) 2.0 * (quat.q1 * quat.q2 + quat.q0 * quat.q3); | ||
| 1366 | + double t2 = -2.0 * (quat.q1 * quat.q3 - quat.q0 * quat.q2); | ||
| 1367 | + double t3 = (dji_f64_t) 2.0 * (quat.q2 * quat.q3 + quat.q0 * quat.q1); | ||
| 1368 | + double t4 = -2.0 * (quat.q1 * quat.q1 + q2sqr) + 1.0; | ||
| 1369 | + t2 = (t2 > 1.0) ? 1.0 : t2; | ||
| 1370 | + t2 = (t2 < -1.0) ? -1.0 : t2; | ||
| 1371 | + eulerAngle.x = asin(t2); | ||
| 1372 | + eulerAngle.y = atan2(t3, t4); | ||
| 1373 | + eulerAngle.z = atan2(t1, t0); | ||
| 1374 | + return eulerAngle; | ||
| 1375 | +} | ||
| 1376 | + | ||
| 1377 | +T_DjiTestFlightControlVector3f | ||
| 1378 | +DjiTest_FlightControlLocalOffsetFromGpsAndFusedHeightOffset(const T_DjiFcSubscriptionPositionFused target, | ||
| 1379 | + const T_DjiFcSubscriptionPositionFused origin, | ||
| 1380 | + const dji_f32_t targetHeight, | ||
| 1381 | + const dji_f32_t originHeight) | ||
| 1382 | +{ | ||
| 1383 | + T_DjiTestFlightControlVector3f deltaNed; | ||
| 1384 | + double deltaLon = target.longitude - origin.longitude; | ||
| 1385 | + double deltaLat = target.latitude - origin.latitude; | ||
| 1386 | + deltaNed.x = deltaLat * s_earthCenter; | ||
| 1387 | + deltaNed.y = deltaLon * s_earthCenter * cos(target.latitude); | ||
| 1388 | + deltaNed.z = targetHeight - originHeight; | ||
| 1389 | + | ||
| 1390 | + return deltaNed; | ||
| 1391 | +} | ||
| 1392 | + | ||
| 1393 | +T_DjiTestFlightControlVector3f DjiTest_FlightControlVector3FSub(const T_DjiTestFlightControlVector3f vectorA, | ||
| 1394 | + const T_DjiTestFlightControlVector3f vectorB) | ||
| 1395 | +{ | ||
| 1396 | + T_DjiTestFlightControlVector3f result; | ||
| 1397 | + result.x = vectorA.x - vectorB.x; | ||
| 1398 | + result.y = vectorA.y - vectorB.y; | ||
| 1399 | + result.z = vectorA.z - vectorB.z; | ||
| 1400 | + return result; | ||
| 1401 | +} | ||
| 1402 | + | ||
| 1403 | +int DjiTest_FlightControlSignOfData(dji_f32_t data) | ||
| 1404 | +{ | ||
| 1405 | + return data < 0 ? -1 : 1; | ||
| 1406 | +} | ||
| 1407 | + | ||
| 1408 | +void DjiTest_FlightControlHorizCommandLimit(dji_f32_t speedFactor, dji_f32_t *commandX, dji_f32_t *commandY) | ||
| 1409 | +{ | ||
| 1410 | + if (fabs(*commandX) > speedFactor) | ||
| 1411 | + *commandX = speedFactor * DjiTest_FlightControlSignOfData(*commandX); | ||
| 1412 | + if (fabs(*commandY) > speedFactor) | ||
| 1413 | + *commandY = speedFactor * DjiTest_FlightControlSignOfData(*commandY); | ||
| 1414 | +} | ||
| 1415 | + | ||
| 1416 | +dji_f32_t DjiTest_FlightControlVectorNorm(T_DjiTestFlightControlVector3f v) | ||
| 1417 | +{ | ||
| 1418 | + return sqrt(pow(v.x, 2) + pow(v.y, 2) + pow(v.z, 2)); | ||
| 1419 | +} | ||
| 1420 | + | ||
| 1421 | +bool | ||
| 1422 | +DjiTest_FlightControlMoveByPositionOffset(const T_DjiTestFlightControlVector3f offsetDesired, float yawDesiredInDeg, | ||
| 1423 | + float posThresholdInM, float yawThresholdInDeg) | ||
| 1424 | +{ | ||
| 1425 | + int timeoutInMilSec = 20000; | ||
| 1426 | + int controlFreqInHz = 50; // Hz | ||
| 1427 | + int cycleTimeInMs = 1000 / controlFreqInHz; | ||
| 1428 | + int outOfControlBoundsTimeLimit = 10 * cycleTimeInMs; // 10 cycles | ||
| 1429 | + int withinControlBoundsTimeReqmt = 100 * cycleTimeInMs; // 100 cycles | ||
| 1430 | + int elapsedTimeInMs = 0; | ||
| 1431 | + int withinBoundsCounter = 0; | ||
| 1432 | + int outOfBounds = 0; | ||
| 1433 | + int brakeCounter = 0; | ||
| 1434 | + int speedFactor = 2; | ||
| 1435 | + | ||
| 1436 | + //! get origin position and relative height(from home point)of aircraft. | ||
| 1437 | + T_DjiFcSubscriptionPositionFused originGPSPosition = DjiTest_FlightControlGetValueOfPositionFused(); | ||
| 1438 | + dji_f32_t originHeightBaseHomePoint = DjiTest_FlightControlGetValueOfRelativeHeight(); | ||
| 1439 | + if (originHeightBaseHomePoint == -1) { | ||
| 1440 | + USER_LOG_ERROR("Relative height is invalid!"); | ||
| 1441 | + return false; | ||
| 1442 | + } | ||
| 1443 | + | ||
| 1444 | + T_DjiFlightControllerJoystickMode joystickMode = { | ||
| 1445 | + DJI_FLIGHT_CONTROLLER_HORIZONTAL_POSITION_CONTROL_MODE, | ||
| 1446 | + DJI_FLIGHT_CONTROLLER_VERTICAL_POSITION_CONTROL_MODE, | ||
| 1447 | + DJI_FLIGHT_CONTROLLER_YAW_ANGLE_CONTROL_MODE, | ||
| 1448 | + DJI_FLIGHT_CONTROLLER_HORIZONTAL_GROUND_COORDINATE, | ||
| 1449 | + DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_ENABLE, | ||
| 1450 | + }; | ||
| 1451 | + DjiFlightController_SetJoystickMode(joystickMode); | ||
| 1452 | + | ||
| 1453 | + while (elapsedTimeInMs < timeoutInMilSec) { | ||
| 1454 | + T_DjiFcSubscriptionPositionFused currentGPSPosition = DjiTest_FlightControlGetValueOfPositionFused(); | ||
| 1455 | + T_DjiFcSubscriptionQuaternion currentQuaternion = DjiTest_FlightControlGetValueOfQuaternion(); | ||
| 1456 | + dji_f32_t currentHeight = DjiTest_FlightControlGetValueOfRelativeHeight(); | ||
| 1457 | + if (originHeightBaseHomePoint == -1) { | ||
| 1458 | + USER_LOG_ERROR("Relative height is invalid!"); | ||
| 1459 | + return false; | ||
| 1460 | + } | ||
| 1461 | + | ||
| 1462 | + float yawInRad = DjiTest_FlightControlQuaternionToEulerAngle(currentQuaternion).z; | ||
| 1463 | + //! get the vector between aircraft and origin point. | ||
| 1464 | + | ||
| 1465 | + T_DjiTestFlightControlVector3f localOffset = DjiTest_FlightControlLocalOffsetFromGpsAndFusedHeightOffset( | ||
| 1466 | + currentGPSPosition, | ||
| 1467 | + originGPSPosition, | ||
| 1468 | + currentHeight, | ||
| 1469 | + originHeightBaseHomePoint); | ||
| 1470 | + //! get the vector between aircraft and target point. | ||
| 1471 | + T_DjiTestFlightControlVector3f offsetRemaining = DjiTest_FlightControlVector3FSub(offsetDesired, localOffset); | ||
| 1472 | + | ||
| 1473 | + T_DjiTestFlightControlVector3f positionCommand = offsetRemaining; | ||
| 1474 | + DjiTest_FlightControlHorizCommandLimit(speedFactor, &positionCommand.x, &positionCommand.y); | ||
| 1475 | + | ||
| 1476 | + T_DjiFlightControllerJoystickCommand joystickCommand = {positionCommand.x, positionCommand.y, | ||
| 1477 | + offsetDesired.z + originHeightBaseHomePoint, | ||
| 1478 | + yawDesiredInDeg}; | ||
| 1479 | + DjiFlightController_ExecuteJoystickAction(joystickCommand); | ||
| 1480 | + | ||
| 1481 | + if (DjiTest_FlightControlVectorNorm(offsetRemaining) < posThresholdInM && | ||
| 1482 | + fabs(yawInRad / s_degToRad - yawDesiredInDeg) < yawThresholdInDeg) { | ||
| 1483 | + //! 1. We are within bounds; start incrementing our in-bound counter | ||
| 1484 | + withinBoundsCounter += cycleTimeInMs; | ||
| 1485 | + } else { | ||
| 1486 | + if (withinBoundsCounter != 0) { | ||
| 1487 | + //! 2. Start incrementing an out-of-bounds counter | ||
| 1488 | + outOfBounds += cycleTimeInMs; | ||
| 1489 | + } | ||
| 1490 | + } | ||
| 1491 | + //! 3. Reset withinBoundsCounter if necessary | ||
| 1492 | + if (outOfBounds > outOfControlBoundsTimeLimit) { | ||
| 1493 | + withinBoundsCounter = 0; | ||
| 1494 | + outOfBounds = 0; | ||
| 1495 | + } | ||
| 1496 | + //! 4. If within bounds, set flag and break | ||
| 1497 | + if (withinBoundsCounter >= withinControlBoundsTimeReqmt) { | ||
| 1498 | + break; | ||
| 1499 | + } | ||
| 1500 | + s_osalHandler->TaskSleepMs(cycleTimeInMs); | ||
| 1501 | + elapsedTimeInMs += cycleTimeInMs; | ||
| 1502 | + } | ||
| 1503 | + | ||
| 1504 | + while (brakeCounter < withinControlBoundsTimeReqmt) { | ||
| 1505 | + s_osalHandler->TaskSleepMs(cycleTimeInMs); | ||
| 1506 | + brakeCounter += cycleTimeInMs; | ||
| 1507 | + } | ||
| 1508 | + | ||
| 1509 | + if (elapsedTimeInMs >= timeoutInMilSec) { | ||
| 1510 | + USER_LOG_ERROR("Task timeout!"); | ||
| 1511 | + return false; | ||
| 1512 | + } | ||
| 1513 | + | ||
| 1514 | + return true; | ||
| 1515 | +} | ||
| 1516 | + | ||
| 1517 | +void DjiTest_FlightControlVelocityAndYawRateCtrl(const T_DjiTestFlightControlVector3f offsetDesired, float yawRate, | ||
| 1518 | + uint32_t timeMs) | ||
| 1519 | +{ | ||
| 1520 | + T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 1521 | + uint32_t originTime = 0; | ||
| 1522 | + uint32_t currentTime = 0; | ||
| 1523 | + uint32_t elapsedTimeInMs = 0; | ||
| 1524 | + osalHandler->GetTimeMs(&originTime); | ||
| 1525 | + osalHandler->GetTimeMs(¤tTime); | ||
| 1526 | + elapsedTimeInMs = currentTime - originTime; | ||
| 1527 | + T_DjiFlightControllerJoystickMode joystickMode = { | ||
| 1528 | + DJI_FLIGHT_CONTROLLER_HORIZONTAL_VELOCITY_CONTROL_MODE, | ||
| 1529 | + DJI_FLIGHT_CONTROLLER_VERTICAL_VELOCITY_CONTROL_MODE, | ||
| 1530 | + DJI_FLIGHT_CONTROLLER_YAW_ANGLE_RATE_CONTROL_MODE, | ||
| 1531 | + DJI_FLIGHT_CONTROLLER_HORIZONTAL_GROUND_COORDINATE, | ||
| 1532 | + DJI_FLIGHT_CONTROLLER_STABLE_CONTROL_MODE_ENABLE, | ||
| 1533 | + }; | ||
| 1534 | + | ||
| 1535 | + DjiFlightController_SetJoystickMode(joystickMode); | ||
| 1536 | + T_DjiFlightControllerJoystickCommand joystickCommand = {offsetDesired.x, offsetDesired.y, offsetDesired.z, | ||
| 1537 | + yawRate}; | ||
| 1538 | + | ||
| 1539 | + while (elapsedTimeInMs <= timeMs) { | ||
| 1540 | + DjiFlightController_ExecuteJoystickAction(joystickCommand); | ||
| 1541 | + osalHandler->TaskSleepMs(2); | ||
| 1542 | + osalHandler->GetTimeMs(¤tTime); | ||
| 1543 | + elapsedTimeInMs = currentTime - originTime; | ||
| 1544 | + } | ||
| 1545 | +} | ||
| 1546 | + | ||
| 1547 | +T_DjiReturnCode | ||
| 1548 | +DjiTest_FlightControlJoystickCtrlAuthSwitchEventCallback(T_DjiFlightControllerJoystickCtrlAuthorityEventInfo eventData) | ||
| 1549 | +{ | ||
| 1550 | + switch (eventData.joystickCtrlAuthoritySwitchEvent) { | ||
| 1551 | + case DJI_FLIGHT_CONTROLLER_MSDK_GET_JOYSTICK_CTRL_AUTH_EVENT: { | ||
| 1552 | + if (eventData.curJoystickCtrlAuthority == DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_MSDK) { | ||
| 1553 | + USER_LOG_INFO("[Event]Msdk request to obtain joystick ctrl authority\r\n"); | ||
| 1554 | + } else { | ||
| 1555 | + USER_LOG_INFO("[Event]Msdk request to release joystick ctrl authority\r\n"); | ||
| 1556 | + } | ||
| 1557 | + break; | ||
| 1558 | + } | ||
| 1559 | + case DJI_FLIGHT_CONTROLLER_INTERNAL_GET_JOYSTICK_CTRL_AUTH_EVENT: { | ||
| 1560 | + if (eventData.curJoystickCtrlAuthority == DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_INTERNAL) { | ||
| 1561 | + USER_LOG_INFO("[Event]Internal request to obtain joystick ctrl authority\r\n"); | ||
| 1562 | + } else { | ||
| 1563 | + USER_LOG_INFO("[Event]Internal request to release joystick ctrl authority\r\n"); | ||
| 1564 | + } | ||
| 1565 | + break; | ||
| 1566 | + } | ||
| 1567 | + case DJI_FLIGHT_CONTROLLER_OSDK_GET_JOYSTICK_CTRL_AUTH_EVENT: { | ||
| 1568 | + if (eventData.curJoystickCtrlAuthority == DJI_FLIGHT_CONTROLLER_JOYSTICK_CTRL_AUTHORITY_OSDK) { | ||
| 1569 | + USER_LOG_INFO("[Event] Request to obtain joystick ctrl authority\r\n"); | ||
| 1570 | + } else { | ||
| 1571 | + USER_LOG_INFO("[Event] Request to release joystick ctrl authority\r\n"); | ||
| 1572 | + } | ||
| 1573 | + break; | ||
| 1574 | + } | ||
| 1575 | + case DJI_FLIGHT_CONTROLLER_RC_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1576 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to rc lost\r\n"); | ||
| 1577 | + break; | ||
| 1578 | + case DJI_FLIGHT_CONTROLLER_RC_NOT_P_MODE_RESET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1579 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc for rc is not in P mode\r\n"); | ||
| 1580 | + break; | ||
| 1581 | + case DJI_FLIGHT_CONTROLLER_RC_SWITCH_MODE_GET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1582 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to rc switching mode\r\n"); | ||
| 1583 | + break; | ||
| 1584 | + case DJI_FLIGHT_CONTROLLER_RC_PAUSE_GET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1585 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to rc pausing\r\n"); | ||
| 1586 | + break; | ||
| 1587 | + case DJI_FLIGHT_CONTROLLER_RC_REQUEST_GO_HOME_GET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1588 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to rc request for return\r\n"); | ||
| 1589 | + break; | ||
| 1590 | + case DJI_FLIGHT_CONTROLLER_LOW_BATTERY_GO_HOME_RESET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1591 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc for low battery return\r\n"); | ||
| 1592 | + break; | ||
| 1593 | + case DJI_FLIGHT_CONTROLLER_LOW_BATTERY_LANDING_RESET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1594 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc for low battery land\r\n"); | ||
| 1595 | + break; | ||
| 1596 | + case DJI_FLIGHT_CONTROLLER_OSDK_LOST_GET_JOYSTICK_CTRL_AUTH_EVENT: | ||
| 1597 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to sdk lost\r\n"); | ||
| 1598 | + break; | ||
| 1599 | + case DJI_FLIGHT_CONTROLLER_NERA_FLIGHT_BOUNDARY_RESET_JOYSTICK_CTRL_AUTH_EVENT : | ||
| 1600 | + USER_LOG_INFO("[Event]Current joystick ctrl authority is reset to rc due to near boundary\r\n"); | ||
| 1601 | + break; | ||
| 1602 | + default: | ||
| 1603 | + USER_LOG_INFO("[Event]Unknown joystick ctrl authority event\r\n"); | ||
| 1604 | + } | ||
| 1605 | + | ||
| 1606 | + return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 1607 | +} | ||
| 1608 | + | ||
| 1609 | +/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/ |
| @@ -144,6 +144,7 @@ T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition, | @@ -144,6 +144,7 @@ T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition, | ||
| 144 | || DJI_AIRCRAFT_SERIES_M3 == aircraftSeries | 144 | || DJI_AIRCRAFT_SERIES_M3 == aircraftSeries |
| 145 | || DJI_AIRCRAFT_SERIES_M3D == aircraftSeries | 145 | || DJI_AIRCRAFT_SERIES_M3D == aircraftSeries |
| 146 | || DJI_AIRCRAFT_SERIES_M4 == aircraftSeries | 146 | || DJI_AIRCRAFT_SERIES_M4 == aircraftSeries |
| 147 | + || DJI_AIRCRAFT_SERIES_M4D == aircraftSeries | ||
| 147 | ) { | 148 | ) { |
| 148 | if (s_rotationActionList[i].rotation.rotationMode == DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE) { | 149 | if (s_rotationActionList[i].rotation.rotationMode == DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE) { |
| 149 | T_DjiFcSubscriptionGimbalAngles gimbalAngles = {0}; | 150 | T_DjiFcSubscriptionGimbalAngles gimbalAngles = {0}; |
project_build/DJI_大疆PSDK/samples/sample_c/module_sample/gimbal_manager/test_gimbal_manager.c.bak
0 → 100644
| 1 | +/** | ||
| 2 | + ******************************************************************** | ||
| 3 | + * @file test_gimbal_manager.c | ||
| 4 | + * @brief | ||
| 5 | + * | ||
| 6 | + * @copyright (c) 2021 DJI. All rights reserved. | ||
| 7 | + * | ||
| 8 | + * All information contained herein is, and remains, the property of DJI. | ||
| 9 | + * The intellectual and technical concepts contained herein are proprietary | ||
| 10 | + * to DJI and may be covered by U.S. and foreign patents, patents in process, | ||
| 11 | + * and protected by trade secret or copyright law. Dissemination of this | ||
| 12 | + * information, including but not limited to data and other proprietary | ||
| 13 | + * material(s) incorporated within the information, in any form, is strictly | ||
| 14 | + * prohibited without the express written consent of DJI. | ||
| 15 | + * | ||
| 16 | + * If you receive this source code without DJI’s authorization, you may not | ||
| 17 | + * further disseminate the information, and you must immediately remove the | ||
| 18 | + * source code and notify DJI of its removal. DJI reserves the right to pursue | ||
| 19 | + * legal actions against you for any loss(es) or damage(s) caused by your | ||
| 20 | + * failure to do so. | ||
| 21 | + * | ||
| 22 | + ********************************************************************* | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +/* Includes ------------------------------------------------------------------*/ | ||
| 26 | +#include <utils/util_misc.h> | ||
| 27 | +#include <widget_interaction_test/test_widget_interaction.h> | ||
| 28 | +#include "test_gimbal_manager.h" | ||
| 29 | +#include "dji_platform.h" | ||
| 30 | +#include "dji_logger.h" | ||
| 31 | +#include "dji_gimbal_manager.h" | ||
| 32 | +#include "dji_fc_subscription.h" | ||
| 33 | +#include "dji_aircraft_info.h" | ||
| 34 | + | ||
| 35 | +/* Private constants ---------------------------------------------------------*/ | ||
| 36 | + | ||
| 37 | +/* Private types -------------------------------------------------------------*/ | ||
| 38 | +typedef enum { | ||
| 39 | + DJI_TEST_GIMBAL_ROTATION, | ||
| 40 | + DJI_TEST_GIMBAL_RESET, | ||
| 41 | +} E_DjiTestGimbalAction; | ||
| 42 | + | ||
| 43 | +typedef struct { | ||
| 44 | + E_DjiTestGimbalAction action; | ||
| 45 | + T_DjiGimbalManagerRotation rotation; | ||
| 46 | +} T_DjiTestGimbalActionList; | ||
| 47 | + | ||
| 48 | +/* Private values -------------------------------------------------------------*/ | ||
| 49 | +static const T_DjiTestGimbalActionList s_rotationActionList[] = | ||
| 50 | +{ | ||
| 51 | + {.action = DJI_TEST_GIMBAL_RESET}, | ||
| 52 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 30, 0, 0, 0.2}, | ||
| 53 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, -30, 0, 0, 0.2}, | ||
| 54 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, -30, 0, 0, 0.2}, | ||
| 55 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 30, 0, 0, 0.2}, | ||
| 56 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, 30, 0, 0.2}, | ||
| 57 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, -30, 0, 0.2}, | ||
| 58 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, -30, 0, 0.2}, | ||
| 59 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, 30, 0, 0.2}, | ||
| 60 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, 0, 4, 0.2}, | ||
| 61 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_RELATIVE_ANGLE, 0, 0, -4, 0.2}, | ||
| 62 | + {.action = DJI_TEST_GIMBAL_RESET}, | ||
| 63 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE, 30, 0, 0, 0.2}, | ||
| 64 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE, -90, 0, 0, 0.5}, | ||
| 65 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE, -60, 0, 0, 0.5}, | ||
| 66 | + {.action = DJI_TEST_GIMBAL_ROTATION, .rotation.rotationMode = DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE, -30, 0, 0, 0.5}, | ||
| 67 | + {.action = DJI_TEST_GIMBAL_RESET}, | ||
| 68 | +}; | ||
| 69 | + | ||
| 70 | +/* Private functions declaration ---------------------------------------------*/ | ||
| 71 | + | ||
| 72 | +/* Exported functions definition ---------------------------------------------*/ | ||
| 73 | +T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition, E_DjiGimbalMode gimbalMode) | ||
| 74 | +{ | ||
| 75 | + T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler(); | ||
| 76 | + T_DjiReturnCode returnCode; | ||
| 77 | + T_DjiGimbalManagerRotation rotation; | ||
| 78 | + T_DjiAircraftInfoBaseInfo baseInfo; | ||
| 79 | + E_DjiAircraftSeries aircraftSeries; | ||
| 80 | + | ||
| 81 | + returnCode = DjiAircraftInfo_GetBaseInfo(&baseInfo); | ||
| 82 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 83 | + USER_LOG_ERROR("Failed to get aircraft base info, return code 0x%08X", returnCode); | ||
| 84 | + goto out; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + aircraftSeries = baseInfo.aircraftSeries; | ||
| 88 | + | ||
| 89 | + USER_LOG_INFO("Gimbal manager sample start"); | ||
| 90 | + DjiTest_WidgetLogAppend("Gimbal manager sample start"); | ||
| 91 | + | ||
| 92 | + returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, NULL); | ||
| 93 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 94 | + USER_LOG_ERROR("Failed to subscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode); | ||
| 95 | + goto out; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + USER_LOG_INFO("--> Step 1: Init gimbal manager module"); | ||
| 99 | + DjiTest_WidgetLogAppend("--> Step 1: Init gimbal manager module"); | ||
| 100 | + returnCode = DjiGimbalManager_Init(); | ||
| 101 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 102 | + USER_LOG_ERROR("Init gimbal manager failed, error code: 0x%08X", returnCode); | ||
| 103 | + goto out; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + if (gimbalMode == DJI_GIMBAL_MODE_FREE) { | ||
| 107 | + USER_LOG_INFO("--> Step 2: Set gimbal to free mode"); | ||
| 108 | + DjiTest_WidgetLogAppend("--> Step 2: Set gimbal to free mode"); | ||
| 109 | + } else if (gimbalMode == DJI_GIMBAL_MODE_YAW_FOLLOW) { | ||
| 110 | + USER_LOG_INFO("--> Step 2: Set gimbal to yaw follow mode"); | ||
| 111 | + DjiTest_WidgetLogAppend("--> Step 2: Set gimbal to yaw follow mode"); | ||
| 112 | + } | ||
| 113 | + returnCode = DjiGimbalManager_SetMode(mountPosition, gimbalMode); | ||
| 114 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 115 | + USER_LOG_ERROR("Set gimbal mode failed, error code: 0x%08X", returnCode); | ||
| 116 | + goto out; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + USER_LOG_INFO("--> Step 3: Reset gimbal angles.\r\n"); | ||
| 120 | + returnCode = DjiGimbalManager_Reset(mountPosition, DJI_GIMBAL_RESET_MODE_PITCH_AND_YAW); | ||
| 121 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 122 | + USER_LOG_ERROR("Reset gimbal failed, error code: 0x%08X", returnCode); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + USER_LOG_INFO("--> Step 4: Rotate gimbal to target angle by action list\r\n"); | ||
| 126 | + for (int i = 0; i < sizeof(s_rotationActionList) / sizeof(T_DjiTestGimbalActionList); ++i) { | ||
| 127 | + if (s_rotationActionList[i].action == DJI_TEST_GIMBAL_RESET) { | ||
| 128 | + USER_LOG_INFO("Target gimbal reset.\r\n"); | ||
| 129 | + returnCode = DjiGimbalManager_Reset(mountPosition, DJI_GIMBAL_RESET_MODE_PITCH_AND_YAW); | ||
| 130 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 131 | + USER_LOG_ERROR("Reset gimbal failed, error code: 0x%08X", returnCode); | ||
| 132 | + } | ||
| 133 | + osalHandler->TaskSleepMs(2000); | ||
| 134 | + } else if (s_rotationActionList[i].action == DJI_TEST_GIMBAL_ROTATION) { | ||
| 135 | + | ||
| 136 | + if (gimbalMode == DJI_GIMBAL_MODE_FREE && | ||
| 137 | + s_rotationActionList[i].rotation.rotationMode == DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE) { | ||
| 138 | + continue; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + rotation = s_rotationActionList[i].rotation; | ||
| 142 | + | ||
| 143 | + if (DJI_AIRCRAFT_SERIES_M30 == aircraftSeries | ||
| 144 | + || DJI_AIRCRAFT_SERIES_M3 == aircraftSeries | ||
| 145 | + || DJI_AIRCRAFT_SERIES_M3D == aircraftSeries | ||
| 146 | + || DJI_AIRCRAFT_SERIES_M4 == aircraftSeries | ||
| 147 | + ) { | ||
| 148 | + if (s_rotationActionList[i].rotation.rotationMode == DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE) { | ||
| 149 | + T_DjiFcSubscriptionGimbalAngles gimbalAngles = {0}; | ||
| 150 | + T_DjiDataTimestamp timestamp = {0}; | ||
| 151 | + returnCode = DjiFcSubscription_GetLatestValueOfTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, | ||
| 152 | + (uint8_t *) &gimbalAngles, | ||
| 153 | + sizeof(T_DjiFcSubscriptionGimbalAngles), | ||
| 154 | + ×tamp); | ||
| 155 | + rotation.yaw = gimbalAngles.z; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + USER_LOG_INFO("Target gimbal pry = (%.1f, %.1f, %.1f)", rotation.pitch, rotation.roll, rotation.yaw); | ||
| 160 | + | ||
| 161 | + returnCode = DjiGimbalManager_Rotate(mountPosition, rotation); | ||
| 162 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 163 | + USER_LOG_ERROR("Target gimbal pry = (%.1f, %.1f, %.1f) failed, error code: 0x%08X", | ||
| 164 | + s_rotationActionList[i].rotation.pitch, s_rotationActionList[i].rotation.roll, | ||
| 165 | + s_rotationActionList[i].rotation.yaw, | ||
| 166 | + returnCode); | ||
| 167 | + } | ||
| 168 | + osalHandler->TaskSleepMs(1000); | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + returnCode = DjiFcSubscription_UnSubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES); | ||
| 173 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 174 | + USER_LOG_ERROR("Failed to unsubscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + USER_LOG_INFO("--> Step 5: Deinit gimbal manager module"); | ||
| 178 | + DjiTest_WidgetLogAppend("--> Step 5: Deinit gimbal manager module"); | ||
| 179 | + returnCode = DjiGimbalManager_Deinit(); | ||
| 180 | + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { | ||
| 181 | + USER_LOG_ERROR("Deinit gimbal manager failed, error code: 0x%08X", returnCode); | ||
| 182 | + goto out; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | +out: | ||
| 186 | + USER_LOG_INFO("Gimbal manager sample end"); | ||
| 187 | + | ||
| 188 | + return returnCode; | ||
| 189 | +} | ||
| 190 | + | ||
| 191 | +/* Private functions definition-----------------------------------------------*/ | ||
| 192 | +/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/ |
| @@ -280,6 +280,7 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition) | @@ -280,6 +280,7 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition) | ||
| 280 | if (DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType | 280 | if (DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType |
| 281 | || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType | 281 | || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType |
| 282 | || DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType | 282 | || DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType |
| 283 | + || DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType | ||
| 283 | ) { | 284 | ) { |
| 284 | USER_LOG_INFO("--> Start h264 stream of the fpv and selected payload\r\n"); | 285 | USER_LOG_INFO("--> Start h264 stream of the fpv and selected payload\r\n"); |
| 285 | 286 |
-
请 注册 或 登录 后发表评论