作者 ookk303

增加h150a

正在显示 54 个修改的文件 包含 1063 行增加2152 行删除

要显示太多修改。

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

@@ -26,11 +26,11 @@ project_build/GDU_普宙PSDK @@ -26,11 +26,11 @@ project_build/GDU_普宙PSDK
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.12.0/* 29 +project_build/Psdk312/*
30 30
31 project_build/特殊固件 31 project_build/特殊固件
32 project_build/DJI_Test 32 project_build/DJI_Test
33 - 33 +project_build/Psdk2257
34 34
35 # project_build/Attention_提示程序 35 # project_build/Attention_提示程序
36 36
@@ -169,7 +169,10 @@ @@ -169,7 +169,10 @@
169 "psdk_ui_value_menu.h": "c", 169 "psdk_ui_value_menu.h": "c",
170 "iflybak": "c", 170 "iflybak": "c",
171 "iflybak2": "c", 171 "iflybak2": "c",
172 - "ifybak3": "c" 172 + "ifybak3": "c",
  173 + "jz_h150a.h": "c",
  174 + "jzsdk_framesequencequeue.h": "c",
  175 + "searchlighttemcontrol.h": "c"
173 }, 176 },
174 "Codegeex.GenerationPreference": "automatic", 177 "Codegeex.GenerationPreference": "automatic",
175 "C_Cpp.dimInactiveRegions": false, 178 "C_Cpp.dimInactiveRegions": false,
1 # 编译链的配置 1 # 编译链的配置
2 2
3 #1、编译链与设备类型的选择 3 #1、编译链与设备类型的选择
4 -set(DEVICE_NAME JZ_T40) 4 +set(DEVICE_NAME JZ_H150A)
5 #上一行为禁止修改行 5 #上一行为禁止修改行
6 6
7 message("**************************JZSDK构建编译开始***************************\n") 7 message("**************************JZSDK构建编译开始***************************\n")
@@ -14,6 +14,7 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150S") @@ -14,6 +14,7 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150S")
14 set(MAKE_COMPILER ARM_CORTEXA9_LINUX) 14 set(MAKE_COMPILER ARM_CORTEXA9_LINUX)
15 elseif("${DEVICE_NAME}" STREQUAL "JZ_H150T") 15 elseif("${DEVICE_NAME}" STREQUAL "JZ_H150T")
16 set(MAKE_COMPILER ARM_CORTEXA9_LINUX) 16 set(MAKE_COMPILER ARM_CORTEXA9_LINUX)
  17 + #set(MAKE_COMPILER LINARO_ARM_CORTEX_LINUX)
17 elseif("${DEVICE_NAME}" STREQUAL "JZ_H10") 18 elseif("${DEVICE_NAME}" STREQUAL "JZ_H10")
18 set(MAKE_COMPILER ARM_CORTEXA9_LINUX) 19 set(MAKE_COMPILER ARM_CORTEXA9_LINUX)
19 elseif("${DEVICE_NAME}" STREQUAL "JZ_H10T") 20 elseif("${DEVICE_NAME}" STREQUAL "JZ_H10T")
@@ -32,7 +33,7 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_C1") @@ -32,7 +33,7 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_C1")
32 set(MAKE_COMPILER ARM_X86_64_ARRCH64) 33 set(MAKE_COMPILER ARM_X86_64_ARRCH64)
33 elseif("${DEVICE_NAME}" STREQUAL "JZ_ST") 34 elseif("${DEVICE_NAME}" STREQUAL "JZ_ST")
34 set(MAKE_COMPILER ARM_X86_64_ARRCH64) 35 set(MAKE_COMPILER ARM_X86_64_ARRCH64)
35 -elseif("${DEVICE_NAME}" STREQUAL "JZ_H150G") 36 +elseif("${DEVICE_NAME}" STREQUAL "JZ_H150A")
36 set(MAKE_COMPILER LINARO_ARM_CORTEX_LINUX) 37 set(MAKE_COMPILER LINARO_ARM_CORTEX_LINUX)
37 elseif("${DEVICE_NAME}" STREQUAL "JZ_T40") 38 elseif("${DEVICE_NAME}" STREQUAL "JZ_T40")
38 set(MAKE_COMPILER LINARO_ARM_CORTEX_LINUX) 39 set(MAKE_COMPILER LINARO_ARM_CORTEX_LINUX)
@@ -29,7 +29,7 @@ set(WARNLIGHT_MODULE VERSION_SWITCH_OFF) @@ -29,7 +29,7 @@ set(WARNLIGHT_MODULE VERSION_SWITCH_OFF)
29 set(MEGAPHONE_MODULE VERSION_SWITCH_OFF) 29 set(MEGAPHONE_MODULE VERSION_SWITCH_OFF)
30 30
31 # TTS模块 31 # TTS模块
32 -set(TTS_MODULE JZ_TTS_MODULE_1) 32 +set(TTS_MODULE VERSION_SWITCH_OFF)
33 33
34 ################################################## 34 ##################################################
35 35
@@ -125,6 +125,9 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H1T") @@ -125,6 +125,9 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H1T")
125 # 添加AudioDeal 音频处理模块 125 # 添加AudioDeal 音频处理模块
126 set(AUDIODEAL_MODULE VERSION_SWITCH_ON) 126 set(AUDIODEAL_MODULE VERSION_SWITCH_ON)
127 127
  128 + # 添加TTS模块
  129 + set(TTS_MODULE JZ_TTS_MODULE_1)
  130 +
128 # 添加Gimbal 云台处理模块 131 # 添加Gimbal 云台处理模块
129 set(GIMBAL_MODULE VERSION_SWITCH_ON) 132 set(GIMBAL_MODULE VERSION_SWITCH_ON)
130 133
@@ -304,7 +307,10 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150S") @@ -304,7 +307,10 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150S")
304 307
305 # 添加喊话器模块 308 # 添加喊话器模块
306 set(MEGAPHONE_MODULE VERSION_SWITCH_ON) 309 set(MEGAPHONE_MODULE VERSION_SWITCH_ON)
307 - 310 +
  311 + # 添加TTS模块
  312 + set(TTS_MODULE JZ_TTS_MODULE_1)
  313 +
308 # 添加MediaProc 媒体管理模块 314 # 添加MediaProc 媒体管理模块
309 set(MEDIA_PROC_MODULE VERSION_SWITCH_ON) 315 set(MEDIA_PROC_MODULE VERSION_SWITCH_ON)
310 316
@@ -331,6 +337,9 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150T") @@ -331,6 +337,9 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150T")
331 # 添加喊话器模块 337 # 添加喊话器模块
332 set(MEGAPHONE_MODULE VERSION_SWITCH_ON) 338 set(MEGAPHONE_MODULE VERSION_SWITCH_ON)
333 339
  340 + # 添加TTS模块
  341 + set(TTS_MODULE JZ_TTS_MODULE_1)
  342 +
334 # 添加MediaProc 媒体管理模块 343 # 添加MediaProc 媒体管理模块
335 set(MEDIA_PROC_MODULE VERSION_SWITCH_ON) 344 set(MEDIA_PROC_MODULE VERSION_SWITCH_ON)
336 345
@@ -386,7 +395,10 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_ST") @@ -386,7 +395,10 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_ST")
386 395
387 message("ST基础配置完毕\n") 396 message("ST基础配置完毕\n")
388 397
389 -elseif("${DEVICE_NAME}" STREQUAL "JZ_H150G") 398 +elseif("${DEVICE_NAME}" STREQUAL "JZ_H150A")
  399 +
  400 + # 添加WARNLIGHT 警示灯处理模块
  401 + set(WARNLIGHT_MODULE VERSION_SWITCH_ON)
390 402
391 # 添加AudioDeal 音频处理模块 403 # 添加AudioDeal 音频处理模块
392 set(AUDIODEAL_MODULE VERSION_SWITCH_ON) 404 set(AUDIODEAL_MODULE VERSION_SWITCH_ON)
@@ -394,14 +406,17 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150G") @@ -394,14 +406,17 @@ elseif("${DEVICE_NAME}" STREQUAL "JZ_H150G")
394 # 添加喊话器模块 406 # 添加喊话器模块
395 set(MEGAPHONE_MODULE VERSION_SWITCH_ON) 407 set(MEGAPHONE_MODULE VERSION_SWITCH_ON)
396 408
  409 + # 添加TTS模块
  410 + set(TTS_MODULE JZ_TTS_MODULE_2)
  411 +
397 # 添加FFMPEG及其附属模块 412 # 添加FFMPEG及其附属模块
398 set(FFMPEG_MODULE VERSION_SWITCH_ON) 413 set(FFMPEG_MODULE VERSION_SWITCH_ON)
399 414
400 #设备独立配置源文件 415 #设备独立配置源文件
401 - file(GLOB_RECURSE DEVICE_CONFOG_SRC ${ROOT_DIRS}JZsdk_Config/DeviceSample/JZ_H150G/*.c) 416 + file(GLOB_RECURSE DEVICE_CONFOG_SRC ${ROOT_DIRS}JZsdk_Config/DeviceSample/JZ_H150A/*.c)
402 list(APPEND ALL_SRC_FILES ${DEVICE_CONFOG_SRC}) 417 list(APPEND ALL_SRC_FILES ${DEVICE_CONFOG_SRC})
403 418
404 - message("JZ_H150G基础配置完毕\n") 419 + message("JZ_H150A基础配置完毕\n")
405 420
406 elseif("${DEVICE_NAME}" STREQUAL "JZ_T40") 421 elseif("${DEVICE_NAME}" STREQUAL "JZ_T40")
407 422
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 #define APP_PSDK 0x01 15 #define APP_PSDK 0x01
16 #define APP_UART 0x02 16 #define APP_UART 0x02
17 #define APP_TEST 0x03 17 #define APP_TEST 0x03
  18 +#define APP_ATTENTION 0x04
18 19
19 //平台选择 20 //平台选择
20 #define PLATFORM_H3 0x01 21 #define PLATFORM_H3 0x01
@@ -45,7 +46,7 @@ @@ -45,7 +46,7 @@
45 46
46 #define JZ_H150S 0x13 47 #define JZ_H150S 0x13
47 #define JZ_H150T 0x15 48 #define JZ_H150T 0x15
48 -#define JZ_H150G 0x20 49 +#define JZ_H150A 0x20
49 50
50 #define JZ_H10 0x12 51 #define JZ_H10 0x12
51 #define JZ_H10T 0x14 52 #define JZ_H10T 0x14
@@ -141,6 +141,8 @@ typedef enum { @@ -141,6 +141,8 @@ typedef enum {
141 JZ_INSCODE_5AFRAME_GIMBAL_YAW_FINETUNING_CONTROL = 0x10000B05, //云台朝向微调 141 JZ_INSCODE_5AFRAME_GIMBAL_YAW_FINETUNING_CONTROL = 0x10000B05, //云台朝向微调
142 JZ_INSCODE_5AFRAME_GIMBAL_ROLL_FINETUNING_CONTROL = 0x10000B06, //云台旋转微调 142 JZ_INSCODE_5AFRAME_GIMBAL_ROLL_FINETUNING_CONTROL = 0x10000B06, //云台旋转微调
143 143
  144 + JZ_INSCODE_5AFRAME_GIMBAL_PITCH_COMPENSATE = 0x10000B10, //云台俯仰补偿
  145 +
144 146
145 JZ_INSCODE_5AFRAME_LASER_CONTROL = 0x10000C00, //激光控制 147 JZ_INSCODE_5AFRAME_LASER_CONTROL = 0x10000C00, //激光控制
146 JZ_INSCODE_5AFRAME_LASER_MODE = 0x10000C01, //激光模式 148 JZ_INSCODE_5AFRAME_LASER_MODE = 0x10000C01, //激光模式
@@ -63,6 +63,8 @@ typedef enum JZsdk_Widget_Control @@ -63,6 +63,8 @@ typedef enum JZsdk_Widget_Control
63 63
64 JZSDK_WIDGET_SIDE_LASER_MODE = 0x0050, //侧射激光模式 64 JZSDK_WIDGET_SIDE_LASER_MODE = 0x0050, //侧射激光模式
65 65
  66 + JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_LEFT = 0x0060, //左云台单轴补偿
  67 + JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_RIGHT = 0x0061, //右云台单轴补偿
66 }JZsdk_Widget_Control; 68 }JZsdk_Widget_Control;
67 69
68 70
  1 +#include <stdio.h>
  2 +
  3 +#include "JZsdk_FrameSequenceQueue.h"
  4 +
  5 +
  6 +
  7 +T_JZsdkReturnCode JZsdk_Osal_GetFrameSequenceQueue(U8_t *frameSequence)
  8 +{
  9 + //该功能后续完善
  10 + if (*frameSequence != 0x00)
  11 + {
  12 + *frameSequence == *frameSequence;
  13 + }
  14 + else
  15 + {
  16 + *frameSequence = 0x00;
  17 + }
  18 +
  19 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  20 +}
  1 +/**
  2 + ********************************************************************
  3 + * @file JZsdk_FrameSequenceQueue.h
  4 + * JZsdk_FrameSequenceQueue.c 的头文件
  5 + *
  6 + *********************************************************************
  7 + */
  8 +
  9 +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
  10 +#ifndef JZSDK_FRAMESEQUENCEQUEUE_H
  11 +#define JZSDK_FRAMESEQUENCEQUEUE_H
  12 +
  13 +/* Includes ------------------------------------------------------------------*/
  14 +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"
  15 +
  16 +#ifdef __cplusplus
  17 +extern "C" {
  18 +#endif
  19 +
  20 +/* Exported constants --------------------------------------------------------*/
  21 +/* 常亮定义*/
  22 +
  23 +/* Exported macro ------------------------------------------------------------*/
  24 +
  25 +/* Exported types ------------------------------------------------------------*/
  26 +
  27 +
  28 +/* Exported functions --------------------------------------------------------*/
  29 +T_JZsdkReturnCode JZsdk_Osal_GetFrameSequenceQueue(U8_t *frameSequence);
  30 +
  31 +#ifdef __cplusplus
  32 +}
  33 +#endif
  34 +
  35 +#endif
  36 +/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 #include "./JZsdk_Osal.h" 2 #include "./JZsdk_Osal.h"
3 3
4 4
  5 +#include "./JZsdk_FrameSequenceQueue/JZsdk_FrameSequenceQueue.h"
5 6
6 7
7 static T_JZsdkOsalHandler *g_osalHandler = NULL; 8 static T_JZsdkOsalHandler *g_osalHandler = NULL;
@@ -63,6 +64,7 @@ T_JZsdkReturnCode JZsdk_OsalInit() @@ -63,6 +64,7 @@ T_JZsdkReturnCode JZsdk_OsalInit()
63 .GetTimeMs = JZsdk_Osal_GetTimeMs, 64 .GetTimeMs = JZsdk_Osal_GetTimeMs,
64 .GetTimeUs = JZsdk_Osal_GetTimeUs, 65 .GetTimeUs = JZsdk_Osal_GetTimeUs,
65 .GetRandomNum = JZsdk_Osal_GetRandomNum, 66 .GetRandomNum = JZsdk_Osal_GetRandomNum,
  67 + .GetFrameSequenceQueueNum = JZsdk_Osal_GetFrameSequenceQueue,
66 }; 68 };
67 69
68 T_JZsdkFSHandler fileSystemHandler = { 70 T_JZsdkFSHandler fileSystemHandler = {
@@ -70,6 +70,8 @@ typedef struct { @@ -70,6 +70,8 @@ typedef struct {
70 void *(*Malloc)(U32_t size); 70 void *(*Malloc)(U32_t size);
71 71
72 void (*Free)(void *ptr); 72 void (*Free)(void *ptr);
  73 +
  74 + T_JZsdkReturnCode (*GetFrameSequenceQueueNum)(U8_t *frameSequence);
73 } T_JZsdkOsalHandler; 75 } T_JZsdkOsalHandler;
74 76
75 77
@@ -259,7 +259,7 @@ static void *Main_WorkModeTask(void *arg) @@ -259,7 +259,7 @@ static void *Main_WorkModeTask(void *arg)
259 * 259 *
260 * 260 *
261 ************************************************************************************************************************************************/ 261 ************************************************************************************************************************************************/
262 -static T_JZsdkReturnCode DeviceSample_init(int mode) 262 +T_JZsdkReturnCode DeviceSample_init(int mode)
263 { 263 {
264 //a1加载 264 //a1加载
265 #if DEVICE_VERSION == JZ_A1 265 #if DEVICE_VERSION == JZ_A1
@@ -322,8 +322,8 @@ static T_JZsdkReturnCode DeviceSample_init(int mode) @@ -322,8 +322,8 @@ static T_JZsdkReturnCode DeviceSample_init(int mode)
322 #endif 322 #endif
323 323
324 //150G加载 324 //150G加载
325 - #if DEVICE_VERSION == JZ_H150G  
326 - JZ_h150g_init(mode); 325 + #if DEVICE_VERSION == JZ_H150A
  326 + JZ_H150A_init(mode);
327 #endif 327 #endif
328 328
329 //T40加载 329 //T40加载
@@ -228,16 +228,16 @@ extern "C" { @@ -228,16 +228,16 @@ extern "C" {
228 #define NET_WORK_TARGET_IPADDR "192.168.5.10" 228 #define NET_WORK_TARGET_IPADDR "192.168.5.10"
229 #define NET_WORK_NETMASK "255.255.255.0" 229 #define NET_WORK_NETMASK "255.255.255.0"
230 230
231 -#elif DEVICE_VERSION == JZ_H150G 231 +#elif DEVICE_VERSION == JZ_H150A
232 232
233 - #define UART_DEV1_NUM "/dev/ttyS1"  
234 - #define UART_DEV1_BITRATE (921600) 233 + #define UART_DEV1_NUM "/dev/ttyS2"
  234 + #define UART_DEV1_BITRATE (115200)
235 235
236 #define UART_DEV2_NUM NULL 236 #define UART_DEV2_NUM NULL
237 #define UART_DEV2_BITRATE (0) 237 #define UART_DEV2_BITRATE (0)
238 238
239 - #define COMM_4G_UART_NUM NULL  
240 - #define COMM_4G_UART_BITRATE (0) 239 + #define COMM_4G_UART_NUM "/dev/ttyS1"
  240 + #define COMM_4G_UART_BITRATE (115200)
241 241
242 #define GIMBAL_UART_NUM NULL 242 #define GIMBAL_UART_NUM NULL
243 #define GIMBAL_UART_BITRATE (0) 243 #define GIMBAL_UART_BITRATE (0)
@@ -294,6 +294,7 @@ int Main_Device_Wheather_Use(); @@ -294,6 +294,7 @@ int Main_Device_Wheather_Use();
294 T_JZsdkReturnCode Main_StartupPriority(int *choose); 294 T_JZsdkReturnCode Main_StartupPriority(int *choose);
295 T_JZsdkReturnCode Main_SetDeviceName(unsigned int Port, int g_DeviceID); 295 T_JZsdkReturnCode Main_SetDeviceName(unsigned int Port, int g_DeviceID);
296 int BaseConfig_GetDeviceInitFlag(); 296 int BaseConfig_GetDeviceInitFlag();
  297 +T_JZsdkReturnCode DeviceSample_init(int mode);
297 298
298 #ifdef __cplusplus 299 #ifdef __cplusplus
299 } 300 }
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 #include "DeviceSample/JZ_H10_series/JZ_H10T/JZ_h10t.h" 19 #include "DeviceSample/JZ_H10_series/JZ_H10T/JZ_h10t.h"
20 20
21 #include "DeviceSample/JZ_H150S_H150T/JZ_h150s_h150t.h" 21 #include "DeviceSample/JZ_H150S_H150T/JZ_h150s_h150t.h"
22 -#include "DeviceSample/JZ_H150G/JZ_h150g.h" 22 +#include "DeviceSample/JZ_H150A/JZ_h150a.h"
23 23
24 #include "DeviceSample/JZ_U3_series/JZ_U3/JZ_u3.h" 24 #include "DeviceSample/JZ_U3_series/JZ_U3/JZ_u3.h"
25 #include "DeviceSample/JZ_U3_series/JZ_U3S/JZ_u3s.h" 25 #include "DeviceSample/JZ_U3_series/JZ_U3S/JZ_u3s.h"
@@ -6,37 +6,76 @@ @@ -6,37 +6,76 @@
6 #include "JZsdk_Hal.h" 6 #include "JZsdk_Hal.h"
7 #include "Megaphone/Megaphone.h" 7 #include "Megaphone/Megaphone.h"
8 #include "AudioDeal/AudioDeal.h" 8 #include "AudioDeal/AudioDeal.h"
  9 +#include "JZsdk_haldata_deal/JZsdk_data_transmisson.h"
  10 +
  11 +#include "WarnLight/WarnLight.h"
9 12
10 #include "IRCUT/ircut.h" 13 #include "IRCUT/ircut.h"
  14 +#include "Hal_Send/HalSend.h"
11 15
12 -/**************************** 16 +/******************
13 * 17 *
14 - * h150g 初始化  
15 - *  
16 - * mode psdk为psdk模式 uart为串口模式  
17 * 18 *
18 - * ****************************/  
19 -T_JZsdkReturnCode JZ_h150g_init(int mode) 19 + * 引脚初始化
  20 + *
  21 + * *****************/
  22 +T_JZsdkReturnCode JZ_H150A_Ircut_Init()
20 { 23 {
21 - int value[5] = {0};  
22 -  
23 //引脚初始化 24 //引脚初始化
24 IrcutInfo ircut_info; 25 IrcutInfo ircut_info;
25 ircut_info.Amplifiter_Pin.Enable = JZ_FLAGCODE_ON; 26 ircut_info.Amplifiter_Pin.Enable = JZ_FLAGCODE_ON;
26 - ircut_info.Amplifiter_Pin.Port = JZ_IRC_PORT_PA;  
27 - ircut_info.Amplifiter_Pin.index = 17; 27 + ircut_info.Amplifiter_Pin.Port = JZ_IRC_PORT_PG;
  28 + ircut_info.Amplifiter_Pin.index = 5;
28 ircut_info.Amplifiter_Pin.Group = 0; 29 ircut_info.Amplifiter_Pin.Group = 0;
29 ircut_info.Amplifiter_Pin.mode = JZ_IRC_PIN_MODE_OUT; 30 ircut_info.Amplifiter_Pin.mode = JZ_IRC_PIN_MODE_OUT;
  31 +
30 Ircut_Init(ircut_info); 32 Ircut_Init(ircut_info);
  33 +}
  34 +
  35 +/********************
  36 + *
  37 + *
  38 + * 基础参数设置
  39 + *
  40 + *
  41 + * ****************/
  42 +static T_JZsdkReturnCode BaseParamSet(void)
  43 +{
  44 +
  45 + //设置警灯颜色
  46 +
  47 + //设置警灯模式
  48 +
  49 + //设置喊话器音量
31 50
  51 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  52 +}
  53 +
  54 +/****************************
  55 + *
  56 + * T40 初始化
  57 + *
  58 + * mode psdk为psdk模式 uart为串口模式
  59 + *
  60 + * ****************************/
  61 +T_JZsdkReturnCode JZ_H150A_init(int mode)
  62 +{
  63 + //引脚初始化
  64 + JZ_H150A_Ircut_Init();
  65 +
  66 + if (mode == APP_ATTENTION)
  67 + {
  68 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  69 + }
  70 +
32 if (mode == APP_UART) 71 if (mode == APP_UART)
33 { 72 {
34 //串口设备1初始化 73 //串口设备1初始化
35 s_JZ_SerialPortHalRegInfo SerialInfo = { 74 s_JZ_SerialPortHalRegInfo SerialInfo = {
36 .BitRate = UART_DEV1_BITRATE, 75 .BitRate = UART_DEV1_BITRATE,
37 .ConnectType = PORT_CONNECT_TYPE_AS_SUB 76 .ConnectType = PORT_CONNECT_TYPE_AS_SUB
38 - };  
39 - 77 + };
  78 +
40 JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); 79 JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo);
41 } 80 }
42 81
@@ -45,10 +84,37 @@ T_JZsdkReturnCode JZ_h150g_init(int mode) @@ -45,10 +84,37 @@ T_JZsdkReturnCode JZ_h150g_init(int mode)
45 //外接传输模块,用于与飞机的数据通信 84 //外接传输模块,用于与飞机的数据通信
46 JZsdk_data_transmisson_Receive_Init(); 85 JZsdk_data_transmisson_Receive_Init();
47 } 86 }
  87 +
  88 + //4G串口初始化
  89 + s_JZ_SerialPortHalRegInfo SerialInfo3 = {
  90 + .BitRate = COMM_4G_UART_BITRATE,
  91 + .ConnectType = PORT_CONNECT_TYPE_AS_MAIN,
  92 + };
  93 + JZsdk_HalPort_Init(UART_4G, (void *)&SerialInfo3);
48 94
49 //音频库初始化 95 //音频库初始化
50 - //AudioDeal_Init(); 96 + AudioDeal_Init();
51 97
52 //喊话器初始化 98 //喊话器初始化
53 - //Megaphone_Init(); 99 + Megaphone_Init();
  100 +
  101 + //警灯初始化
  102 + T_JzWarnLightInfo WarnLightInfo = {
  103 + .Attribute.Color1 = E_JZ_WARNLIGHT_COLOR_RED,
  104 + .Attribute.Color2 = E_JZ_WARNLIGHT_COLOR_BLUE,
  105 + .Attribute.mode = E_JZ_WARNLIGHT_MODE_SIMULTANEOUS_FAST_FALSHING,
  106 + .Attribute.status = JZ_FLAGCODE_OFF,
  107 +
  108 + .ControlMode = JZ_MODULE_CONTROL_WAY_INDEPENDENT,
  109 + .Device = UART_4G,
  110 + .FrameSequence = 0x00,
  111 + };
  112 + WarnLight_Init(WarnLightInfo);
  113 +
  114 + //基础参数设置
  115 + BaseParamSet();
  116 +
  117 + JZSDK_LOG_INFO("H150A Init Success");
  118 +
  119 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
54 } 120 }
1 /** 1 /**
2 ******************************************************************** 2 ********************************************************************
3 - * @file JZ_h150g.h  
4 - * JZ_h150g.h的头文件 3 + * @file JZ_H150A.h
  4 + * JZ_H150A.h的头文件
5 * 5 *
6 ********************************************************************* 6 *********************************************************************
7 */ 7 */
8 8
9 /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ 9 /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
10 -#ifndef JZ_H150G_H  
11 -#define JZ_H150G_H 10 +#ifndef JZ_H150A_H
  11 +#define JZ_H150A_H
12 12
13 #include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" 13 #include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"
14 14
@@ -25,8 +25,7 @@ extern "C" { @@ -25,8 +25,7 @@ extern "C" {
25 25
26 /* Exported types ------------------------------------------------------------*/ 26 /* Exported types ------------------------------------------------------------*/
27 27
28 -T_JZsdkReturnCode JZ_h150g_init(int mode);  
29 - 28 +T_JZsdkReturnCode JZ_H150A_init(int mode);
30 29
31 #ifdef __cplusplus 30 #ifdef __cplusplus
32 } 31 }
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 #include "AudioDeal/AudioDeal.h" 8 #include "AudioDeal/AudioDeal.h"
9 #include "Gimbal/Gimbal.h" 9 #include "Gimbal/Gimbal.h"
10 #include "JZsdk_haldata_deal/JZsdk_data_transmisson.h" 10 #include "JZsdk_haldata_deal/JZsdk_data_transmisson.h"
  11 +#include "DeviceInfo/DeviceInfo.h"
11 12
12 #include "SearchLight/SearchLight.h" 13 #include "SearchLight/SearchLight.h"
13 #include "WarnLight/WarnLight.h" 14 #include "WarnLight/WarnLight.h"
@@ -32,7 +33,7 @@ void *JZ_T40_SubConnectTask(void *arg) @@ -32,7 +33,7 @@ void *JZ_T40_SubConnectTask(void *arg)
32 LeftGimbalConnectFlag == JZ_FLAGCODE_OFF || 33 LeftGimbalConnectFlag == JZ_FLAGCODE_OFF ||
33 RightLightConnectFlag == JZ_FLAGCODE_OFF || 34 RightLightConnectFlag == JZ_FLAGCODE_OFF ||
34 LeftLightConnectFlag == JZ_FLAGCODE_OFF ) && 35 LeftLightConnectFlag == JZ_FLAGCODE_OFF ) &&
35 - DelayTime < 20000) 36 + DelayTime <= 20000)
36 { 37 {
37 s_JZsdk_Hal_Info *HalInfo = JZsdk_Hal_GetHalInfo(); 38 s_JZsdk_Hal_Info *HalInfo = JZsdk_Hal_GetHalInfo();
38 39
@@ -101,6 +102,26 @@ void *JZ_T40_SubConnectTask(void *arg) @@ -101,6 +102,26 @@ void *JZ_T40_SubConnectTask(void *arg)
101 } 102 }
102 } 103 }
103 104
  105 + if (LeftGimbalConnectFlag != JZ_FLAGCODE_ON)
  106 + {
  107 + JZSDK_LOG_ERROR("LeftGimbalConnectFlag is OFF");
  108 + }
  109 +
  110 + if (RightGimbalConnectFlag != JZ_FLAGCODE_ON)
  111 + {
  112 + JZSDK_LOG_ERROR("RightGimbalConnectFlag is OFF");
  113 + }
  114 +
  115 + if (LeftLightConnectFlag != JZ_FLAGCODE_ON)
  116 + {
  117 + JZSDK_LOG_ERROR("LeftLightConnectFlag is OFF");
  118 + }
  119 +
  120 + if (RightLightConnectFlag != JZ_FLAGCODE_ON)
  121 + {
  122 + JZSDK_LOG_ERROR("RightLightConnectFlag is OFF");
  123 + }
  124 +
104 T40_SubConnectFlag = JZ_FLAGCODE_ON; 125 T40_SubConnectFlag = JZ_FLAGCODE_ON;
105 JZSDK_LOG_INFO("T40 SubDevice Connect Success"); 126 JZSDK_LOG_INFO("T40 SubDevice Connect Success");
106 } 127 }
@@ -149,7 +170,6 @@ void *JZ_T40_CheckLightTemperatureTask(void *arg) @@ -149,7 +170,6 @@ void *JZ_T40_CheckLightTemperatureTask(void *arg)
149 delayMs(100); 170 delayMs(100);
150 } 171 }
151 172
152 -  
153 while (1) 173 while (1)
154 { 174 {
155 //检查左灯温度 175 //检查左灯温度
@@ -203,14 +223,31 @@ static T_JZsdkReturnCode JZ_T40_BaseParamSet(void) @@ -203,14 +223,31 @@ static T_JZsdkReturnCode JZ_T40_BaseParamSet(void)
203 //设置云台角度 223 //设置云台角度
204 224
205 //设置喊话器音量 225 //设置喊话器音量
  226 +
206 227
  228 + //监测飞机信号,设定为对应的功率值
207 229
  230 + E_JZ_SPECIAL_PLANE_INFO g_PlaneInfo;
  231 + JZsdk_PlaneInfo_Get(&g_PlaneInfo);
208 232
209 - //测试部分  
210 -  
211 - //1、将总功率设置为无限制  
212 - HalSend_type1Send_SearchLight_SetLumenPowerLimit(UART_DEV_2, 0x00, 0x64, 0x20, 0x00); 233 + if (g_PlaneInfo == E_JZ_SPECIAL_PLANE_INFO_DJI_M4E)
  234 + {
  235 + //将总功率设置为无限制
  236 + HalSend_type1Send_SearchLight_SetLumenPowerLimit(UART_DEV_2, 0x00, 0x64, 0x20, 0x00);
  237 + }
  238 + else if (g_PlaneInfo == E_JZ_SPECIAL_PLANE_INFO_DJI_M4TD || g_PlaneInfo == E_JZ_SPECIAL_PLANE_INFO_DJI_M4D)
  239 + {
  240 + //将总功率设置为31%
  241 + //HalSend_type1Send_SearchLight_SetLumenPowerLimit(UART_DEV_2, 0x00, 0x1F, 0x20, 0x00);
  242 + HalSend_type1Send_SearchLight_SetLumenPowerLimit(UART_DEV_2, 0x00, 0x64, 0x20, 0x00);
  243 + }
  244 + else
  245 + {
  246 +
  247 + HalSend_type1Send_SearchLight_SetLumenPowerLimit(UART_DEV_2, 0x00, 0x64, 0x20, 0x00);
  248 + }
213 249
  250 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
214 } 251 }
215 252
216 /**************************** 253 /****************************
@@ -225,6 +262,11 @@ T_JZsdkReturnCode JZ_T40_init(int mode) @@ -225,6 +262,11 @@ T_JZsdkReturnCode JZ_T40_init(int mode)
225 //引脚初始化 262 //引脚初始化
226 JZ_T40_Ircut_Init(); 263 JZ_T40_Ircut_Init();
227 264
  265 + if (mode == APP_ATTENTION)
  266 + {
  267 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  268 + }
  269 +
228 if (mode == APP_UART) 270 if (mode == APP_UART)
229 { 271 {
230 //串口设备1初始化 272 //串口设备1初始化
@@ -251,8 +293,11 @@ T_JZsdkReturnCode JZ_T40_init(int mode) @@ -251,8 +293,11 @@ T_JZsdkReturnCode JZ_T40_init(int mode)
251 JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); 293 JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2);
252 294
253 //4G初始化 295 //4G初始化
254 - // int value[1] = {COMM_4G_UART_BITRATE};  
255 - // JZsdk_HalPort_Init(UART_4G, value); 296 + s_JZ_SerialPortHalRegInfo SerialInfo3 = {
  297 + .BitRate = COMM_4G_UART_BITRATE,
  298 + .ConnectType = PORT_CONNECT_TYPE_AS_MAIN,
  299 + };
  300 + JZsdk_HalPort_Init(UART_4G, (void *)&SerialInfo3);
256 301
257 //子设备连接 302 //子设备连接
258 JZ_T40_SubDevice_Init(); 303 JZ_T40_SubDevice_Init();
@@ -267,10 +312,33 @@ T_JZsdkReturnCode JZ_T40_init(int mode) @@ -267,10 +312,33 @@ T_JZsdkReturnCode JZ_T40_init(int mode)
267 Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); 312 Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT);
268 313
269 //探照灯初始化 314 //探照灯初始化
270 - SearchLight_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); 315 + T_JzSearchLightInfo SearchLightInfo = {
  316 + .Attribute.Frequency = 100,
  317 + .Attribute.Mode = E_JZ_SEARCHLIGHTMODE_OFF,
  318 + .Attribute.LeftBrightness = 30,
  319 + .Attribute.RightBrightness = 30,
  320 + .Attribute.LeftTemperature = 0,
  321 + .Attribute.RightTemperature = 0,
  322 +
  323 + .ControlMode = JZ_MODULE_CONTROL_WAY_INDEPENDENT,
  324 + .Device = UART_DEV_2,
  325 + .FrameSequence = 0x20,
  326 + };
  327 + SearchLight_Init(SearchLightInfo);
271 328
272 //警灯初始化 329 //警灯初始化
273 - WarnLight_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); 330 + T_JzWarnLightInfo WarnLightInfo = {
  331 + .Attribute.Color1 = E_JZ_WARNLIGHT_COLOR_RED,
  332 + .Attribute.Color2 = E_JZ_WARNLIGHT_COLOR_BLUE,
  333 + .Attribute.mode = E_JZ_WARNLIGHT_MODE_SIMULTANEOUS_FAST_FALSHING,
  334 + .Attribute.status = JZ_FLAGCODE_OFF,
  335 +
  336 + .ControlMode = JZ_MODULE_CONTROL_WAY_INDEPENDENT,
  337 + .Device = UART_DEV_2,
  338 + .FrameSequence = 0x20,
  339 + };
  340 + WarnLight_Init(WarnLightInfo);
  341 +
274 342
275 //激光初始化 343 //激光初始化
276 SideLaser_Init(); 344 SideLaser_Init();
@@ -7,23 +7,23 @@ @@ -7,23 +7,23 @@
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_T40 10 +#define DEVICE_VERSION JZ_H150A
11 11
12 //禁止修改行 选择是串口程序 还是 psdk程序 12 //禁止修改行 选择是串口程序 还是 psdk程序
13 -#define APP_VERSION APP_PSDK 13 +#define APP_VERSION APP_UART
14 14
15 //禁止修改行 板子型号 15 //禁止修改行 板子型号
16 #define PLATFORM_VERSION PLATFORM_V3S 16 #define PLATFORM_VERSION PLATFORM_V3S
17 17
18 //禁止修改行 串口连接程序的软件版本号 18 //禁止修改行 串口连接程序的软件版本号
19 #define MAJOR_VERSION_TEN_POSITION 0 19 #define MAJOR_VERSION_TEN_POSITION 0
20 -#define MAJOR_VERSION_ONE_POSITION 1 20 +#define MAJOR_VERSION_ONE_POSITION 0
21 #define MINOR_VERSION_TEN_POSITION 0 21 #define MINOR_VERSION_TEN_POSITION 0
22 -#define MINOR_VERSION_ONE_POSITION 3  
23 -#define MODIFY_VERSION_TEN_POSITION 1 22 +#define MINOR_VERSION_ONE_POSITION 0
  23 +#define MODIFY_VERSION_TEN_POSITION 0
24 #define MODIFY_VERSION_ONE_POSITION 2 24 #define MODIFY_VERSION_ONE_POSITION 2
25 -#define DEBUG_VERSION_TEN_POSITION 0  
26 -#define DEBUG_VERSION_ONE_POSITION 0 25 +#define DEBUG_VERSION_TEN_POSITION 2
  26 +#define DEBUG_VERSION_ONE_POSITION 2
27 27
28 28
29 29
@@ -2899,6 +2899,111 @@ static T_JZsdkReturnCode RecvDeal_Gimbal_PitchFineTuningControl(int Port, char * @@ -2899,6 +2899,111 @@ static T_JZsdkReturnCode RecvDeal_Gimbal_PitchFineTuningControl(int Port, char *
2899 } 2899 }
2900 2900
2901 2901
  2902 +/*********
  2903 + *
  2904 + * 云台俯仰补偿
  2905 + *
  2906 + *
  2907 +**********/
  2908 +static T_JZsdkReturnCode RecvDeal_Gimbal_PitchCompensate(int Port, char *getbuf)
  2909 +{
  2910 + T_JZsdkReturnCode ret;
  2911 +
  2912 + JZSDK_LOG_INFO("%s,云台俯仰补偿",JZsdk_DefineCode_GetPortName(Port));
  2913 +
  2914 + //获取帧的序列号
  2915 + int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
  2916 +
  2917 + //获取模式
  2918 + int mode = getbuf[9];
  2919 +
  2920 + //通过云台控制帧 获取云台角度符号
  2921 + int signal = getbuf[10];
  2922 +
  2923 + //计算数据长度
  2924 + int dataLen = JZsdk_Get_FrameLength(getbuf) - 9 - 2 - 1 -1;
  2925 +
  2926 + //计算补偿值
  2927 + int compensate = 0;
  2928 + for (int i = 0; i < dataLen; i++)
  2929 + {
  2930 + compensate += (getbuf[11 + i] << (8 * (dataLen - i - 1)));
  2931 + }
  2932 +
  2933 + //拼接得到补偿值
  2934 + if (signal == 0x00)
  2935 + {
  2936 + compensate = compensate;
  2937 + }
  2938 + else if (signal == 0xff)
  2939 + {
  2940 + compensate = -compensate;
  2941 + }
  2942 + else
  2943 + {
  2944 + JZSDK_LOG_INFO("云台俯仰补偿符号错误,无法正常控制");
  2945 + //回复操作失败
  2946 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  2947 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  2948 + }
  2949 +
  2950 + if (mode == 0x00)
  2951 + {
  2952 + ret = UIcontrol_Set_GimbalPitchFineTuning(Port ,compensate);
  2953 + if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  2954 + {
  2955 + // 回复操作成功
  2956 + HalSend_type1Send_Reply_Success(Port, FrameSequence);
  2957 + }
  2958 + else
  2959 + {
  2960 + // 回复操作失败
  2961 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  2962 + }
  2963 + }
  2964 + //左补偿值
  2965 + else if (mode == 0x01)
  2966 + {
  2967 + ret = UIcontrol_Set_SingleCompensation(Port, 0, compensate);
  2968 + if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  2969 + {
  2970 + // 回复操作成功
  2971 + HalSend_type1Send_Reply_Success(Port, FrameSequence);
  2972 + }
  2973 + else
  2974 + {
  2975 + // 回复操作失败
  2976 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  2977 + }
  2978 + }
  2979 + //右补偿值
  2980 + else if (mode == 0x02)
  2981 + {
  2982 + ret = UIcontrol_Set_SingleCompensation(Port, 1, compensate);
  2983 + if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  2984 + {
  2985 + // 回复操作成功
  2986 + HalSend_type1Send_Reply_Success(Port, FrameSequence);
  2987 + }
  2988 + else
  2989 + {
  2990 + // 回复操作失败
  2991 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  2992 + }
  2993 + }
  2994 + else
  2995 + {
  2996 + JZSDK_LOG_INFO("云台俯仰补偿模式错误,无法正常控制");
  2997 + //回复操作失败
  2998 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  2999 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  3000 + }
  3001 +
  3002 + return ret;
  3003 +}
  3004 +
  3005 +
  3006 +
2902 /******************************************************************************************************************************* 3007 /*******************************************************************************************************************************
2903 * 3008 *
2904 * 探照灯部分 3009 * 探照灯部分
@@ -3964,8 +4069,8 @@ static T_JZsdkReturnCode RecvDeal_ObtainHeartBeat(int Port, char *getbuf) @@ -3964,8 +4069,8 @@ static T_JZsdkReturnCode RecvDeal_ObtainHeartBeat(int Port, char *getbuf)
3964 * ******************************/ 4069 * ******************************/
3965 static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbuf) 4070 static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbuf)
3966 { 4071 {
3967 - uint64_t TimeStamp = (getbuf[16] | (getbuf[15] << 8)  
3968 - | (getbuf[14] << 16) | (getbuf[13] << 24) 4072 + uint64_t TimeStamp = ((uint64_t)getbuf[16] | ((uint64_t)getbuf[15] << 8)
  4073 + | ((uint64_t)getbuf[14] << 16) | ((uint64_t)getbuf[13] << 24)
3969 | ((uint64_t)getbuf[12] << 32) | ((uint64_t)getbuf[11] << 40) 4074 | ((uint64_t)getbuf[12] << 32) | ((uint64_t)getbuf[11] << 40)
3970 | ((uint64_t)getbuf[10] << 48) | ((uint64_t)getbuf[9] << 56)); 4075 | ((uint64_t)getbuf[10] << 48) | ((uint64_t)getbuf[9] << 56));
3971 4076
@@ -4142,7 +4247,6 @@ static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Lumen(int Port, char *getbuf @@ -4142,7 +4247,6 @@ static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Lumen(int Port, char *getbuf
4142 static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Temperature(int Port, char *getbuf) 4247 static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Temperature(int Port, char *getbuf)
4143 { 4248 {
4144 4249
4145 -  
4146 //获取帧的序列号 4250 //获取帧的序列号
4147 int FrameSequence = JZsdk_Get_FrameSequence(getbuf); 4251 int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
4148 4252
@@ -4171,6 +4275,7 @@ static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Temperature(int Port, char * @@ -4171,6 +4275,7 @@ static T_JZsdkReturnCode RecvDeal_ObtainSearchLight_Temperature(int Port, char *
4171 UIcontrol_ObtainSearchLight_SingleTemperature(Port, FrameSequence, value); 4275 UIcontrol_ObtainSearchLight_SingleTemperature(Port, FrameSequence, value);
4172 } 4276 }
4173 4277
  4278 +
4174 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 4279 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
4175 } 4280 }
4176 4281
@@ -5196,6 +5301,12 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi @@ -5196,6 +5301,12 @@ static T_JZsdkReturnCode RecvDeal_InstructInput(int Port, int Receive_mode, unsi
5196 return 0; 5301 return 0;
5197 break; 5302 break;
5198 5303
  5304 + //云台俯仰补偿
  5305 + case JZ_INSCODE_5AFRAME_GIMBAL_PITCH_COMPENSATE:
  5306 + RecvDeal_Gimbal_PitchCompensate(Port,getbuf);
  5307 + return 0;
  5308 + break;
  5309 +
5199 //TTS设置音色 5310 //TTS设置音色
5200 case JZ_INSCODE_5AFRAME_TTS_SET_TONE: 5311 case JZ_INSCODE_5AFRAME_TTS_SET_TONE:
5201 RecvDeal_TTS_SetTone(Port,getbuf); 5312 RecvDeal_TTS_SetTone(Port,getbuf);
@@ -20,8 +20,8 @@ extern "C" { @@ -20,8 +20,8 @@ extern "C" {
20 20
21 /* Exported constants --------------------------------------------------------*/ 21 /* Exported constants --------------------------------------------------------*/
22 /* 常亮定义*/ 22 /* 常亮定义*/
23 -#define SINGLE_THREAD_SEND JZSDK_SINGLE_THREAD  
24 -#define MULTI_THREAD_SEND JZSDK_MULTI_THREAD 23 +#define SINGLE_THREAD_SEND JZSDK_SINGLE_THREAD //单线程发送
  24 +#define MULTI_THREAD_SEND JZSDK_MULTI_THREAD //线程池发送
25 25
26 /* Exported types ------------------------------------------------------------*/ 26 /* Exported types ------------------------------------------------------------*/
27 27
@@ -1683,7 +1683,7 @@ T_JZsdkReturnCode HalSend_type1Send_LaserMode(int Uartport, int frameSequence, i @@ -1683,7 +1683,7 @@ T_JZsdkReturnCode HalSend_type1Send_LaserMode(int Uartport, int frameSequence, i
1683 * **************/ 1683 * **************/
1684 T_JZsdkReturnCode HalSend_type1Send_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature) 1684 T_JZsdkReturnCode HalSend_type1Send_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature)
1685 { 1685 {
1686 - printf("发送探照灯温度帧\n"); 1686 + //printf("发送探照灯温度帧\n");
1687 1687
1688 unsigned char sendbuf[256]; 1688 unsigned char sendbuf[256];
1689 int send_buf_len; 1689 int send_buf_len;
@@ -10,7 +10,7 @@ T_JZsdkReturnCode DebugInfo_Init() @@ -10,7 +10,7 @@ T_JZsdkReturnCode DebugInfo_Init()
10 { 10 {
11 11
12 //强制打开调试模式 12 //强制打开调试模式
13 -#if 1 13 +#if 0
14 JZsdk_create_file("/root/ShakedownTest"); 14 JZsdk_create_file("/root/ShakedownTest");
15 15
16 DebugMode_Flag = JZ_FLAGCODE_ON; 16 DebugMode_Flag = JZ_FLAGCODE_ON;
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 #include "DeviceInfo/Attribute/Attribute.h" 16 #include "DeviceInfo/Attribute/Attribute.h"
17 #include "LanguageInfo/LanguageInfo.h" 17 #include "LanguageInfo/LanguageInfo.h"
18 #include "DebugInfo/DebugInfo.h" 18 #include "DebugInfo/DebugInfo.h"
  19 +#include "PlaneInfo/PlaneInfo.h"
19 20
20 /* Includes ------------------------------------------------------------------*/ 21 /* Includes ------------------------------------------------------------------*/
21 #ifdef __cplusplus 22 #ifdef __cplusplus
  1 +#include "JZsdkLib.h"
  2 +
  3 +#include "PlaneInfo.h"
  4 +
  5 +
  6 +static E_JZ_SPECIAL_PLANE_INFO g_PlaneInfo = E_JZ_SPECIAL_PLANE_INFO_NONE;
  7 +
  8 +T_JZsdkReturnCode JZsdk_PlaneInfo_Set(E_JZ_SPECIAL_PLANE_INFO ePlaneInfo)
  9 +{
  10 + JZSDK_LOG_INFO("Set PlaneInfo: %d", ePlaneInfo);
  11 +
  12 + g_PlaneInfo = ePlaneInfo;
  13 +
  14 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  15 +}
  16 +
  17 +T_JZsdkReturnCode JZsdk_PlaneInfo_Get(E_JZ_SPECIAL_PLANE_INFO *pePlaneInfo)
  18 +{
  19 + *pePlaneInfo = g_PlaneInfo;
  20 +
  21 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  22 +}
  1 +/**
  2 + ********************************************************************
  3 + * @file PlaneInfo.h
  4 + * PlaneInfo.h的头文件
  5 + *
  6 + *********************************************************************
  7 + */
  8 +
  9 +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
  10 +#ifndef PLANE_INFO_H
  11 +#define PLANE_INFO_H
  12 +
  13 +/* Includes ------------------------------------------------------------------*/
  14 +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"
  15 +
  16 +#ifdef __cplusplus
  17 +extern "C" {
  18 +#endif
  19 +
  20 +/* Exported constants --------------------------------------------------------*/
  21 +/* 常亮定义*/
  22 +
  23 +typedef enum E_JZ_SPECIAL_PLANE_INFO
  24 +{
  25 + E_JZ_SPECIAL_PLANE_INFO_NONE = 0, //无特殊信息
  26 + E_JZ_SPECIAL_PLANE_INFO_DJI_M200_V2 = 44, /*!< Aircraft type is Matrice 200 V2. */
  27 + E_JZ_SPECIAL_PLANE_INFO_DJI_M210_V2 = 45, /*!< Aircraft type is Matrice 220 V2. */
  28 + E_JZ_SPECIAL_PLANE_INFO_DJI_M210RTK_V2 = 46, /*!< Aircraft type is Matrice 210 RTK V2. */
  29 + E_JZ_SPECIAL_PLANE_INFO_DJI_M300_RTK = 60, /*!< Aircraft type is Matrice 300 RTK. */
  30 + E_JZ_SPECIAL_PLANE_INFO_DJI_M30 = 67, /*!< Aircraft type is Matrice 30. */
  31 + E_JZ_SPECIAL_PLANE_INFO_DJI_M30T = 68, /*!< Aircraft type is Matrice 30T. */
  32 + E_JZ_SPECIAL_PLANE_INFO_DJI_M3E = 77, /*!< Aircraft type is Mavic 3E. */
  33 + E_JZ_SPECIAL_PLANE_INFO_DJI_FC30 = 78, /* !<Aircraft type is FlyCart 30> */
  34 + E_JZ_SPECIAL_PLANE_INFO_DJI_M3T = 79, /*!< Aircraft type is Mavic 3T. */
  35 + E_JZ_SPECIAL_PLANE_INFO_DJI_M350_RTK = 89, /*!< Aircraft type is Matrice 350 RTK. */
  36 + E_JZ_SPECIAL_PLANE_INFO_DJI_M3D = 91, /*!< Aircraft type is Matrice 3D. */
  37 + E_JZ_SPECIAL_PLANE_INFO_DJI_M3TD = 93, /*!< Aircraft type is Matrice 3TD. */
  38 + E_JZ_SPECIAL_PLANE_INFO_DJI_M4T = 99, /*!< Aircraft type is Matrice 4T. */
  39 + E_JZ_SPECIAL_PLANE_INFO_DJI_M4E = 990, /*!< Aircraft type is Matrice 4E. */
  40 + E_JZ_SPECIAL_PLANE_INFO_DJI_M4TD = 100, /*!< Aircraft type is Matrice 4TD. */
  41 + E_JZ_SPECIAL_PLANE_INFO_DJI_M4D = 1000, /*!< Aircraft type is Matrice 4D. */
  42 + E_JZ_SPECIAL_PLANE_INFO_DJI_M400 = 103, /*!< Aircraft type is Matrice 400. */
  43 +}E_JZ_SPECIAL_PLANE_INFO;
  44 +
  45 +/* Exported types ------------------------------------------------------------*/
  46 +
  47 +/* Exported functions --------------------------------------------------------*/
  48 +T_JZsdkReturnCode JZsdk_PlaneInfo_Set(E_JZ_SPECIAL_PLANE_INFO ePlaneInfo);
  49 +T_JZsdkReturnCode JZsdk_PlaneInfo_Get(E_JZ_SPECIAL_PLANE_INFO *pePlaneInfo);
  50 +
  51 +#ifdef __cplusplus
  52 +}
  53 +#endif
  54 +
  55 +#endif
@@ -37,7 +37,7 @@ T_JZsdkReturnCode Ircut_Init(IrcutInfo ircut_info) @@ -37,7 +37,7 @@ T_JZsdkReturnCode Ircut_Init(IrcutInfo ircut_info)
37 //初始化对应的引脚 37 //初始化对应的引脚
38 if (DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H10T || 38 if (DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H10T ||
39 DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30|| 39 DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30||
40 - DEVICE_VERSION == TF_A1 || DEVICE_VERSION == JZ_T40) 40 + DEVICE_VERSION == TF_A1 || DEVICE_VERSION == JZ_T40 || DEVICE_VERSION == JZ_H150A)
41 { 41 {
42 JZsdk_V3s_Ircut_Init(T_Ircut_info); 42 JZsdk_V3s_Ircut_Init(T_Ircut_info);
43 } 43 }
@@ -116,7 +116,7 @@ T_JZsdkReturnCode Ircut_PinControl(E_JZ_IRC_PORT port, int index, int status) @@ -116,7 +116,7 @@ T_JZsdkReturnCode Ircut_PinControl(E_JZ_IRC_PORT port, int index, int status)
116 116
117 if (DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H10T || 117 if (DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H10T ||
118 DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30|| 118 DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30||
119 - DEVICE_VERSION == TF_A1 || DEVICE_VERSION == JZ_T40) 119 + DEVICE_VERSION == TF_A1 || DEVICE_VERSION == JZ_T40 || DEVICE_VERSION == JZ_H150A)
120 { 120 {
121 JZsdk_V3s_Gpio_SetPin(port, index, status); 121 JZsdk_V3s_Gpio_SetPin(port, index, status);
122 } 122 }
@@ -109,16 +109,26 @@ static T_JZsdkReturnCode TTS_FILE_play(struct t_Megaphone_tts_param *Megaphone_t @@ -109,16 +109,26 @@ static T_JZsdkReturnCode TTS_FILE_play(struct t_Megaphone_tts_param *Megaphone_t
109 //开始合成音频 109 //开始合成音频
110 int loop; 110 int loop;
111 int loop_interval; 111 int loop_interval;
  112 + int addtone = 0x01;
  113 + if (Megaphone_tts_param->tts_add == 1)
  114 + {
  115 + addtone = 0x01;
  116 + }
  117 + else if (Megaphone_tts_param->tts_add == 2)
  118 + {
  119 + addtone = 0x02;
  120 + }
  121 +
112 do 122 do
113 { 123 {
114 //输入数据 124 //输入数据
115 IflyTek_2_Tts_Input(tone, argv, speed, volume); 125 IflyTek_2_Tts_Input(tone, argv, speed, volume);
116 //如果开启了追加模式 126 //如果开启了追加模式
117 - // if(tts_add_mode == JZ_FLAGCODE_ON)  
118 - // {  
119 - // //追加合成音频  
120 - // IflyTek_2_Tts_Input(tone, argv, volume);  
121 - // } 127 + if(tts_add_mode == JZ_FLAGCODE_ON)
  128 + {
  129 + //追加合成音频
  130 + IflyTek_2_Tts_Input(addtone, argv, speed, volume);
  131 + }
122 132
123 Megaphone_param(JZ_FLAGCODE_GET, MEGAPHONE_LOOP, &loop); 133 Megaphone_param(JZ_FLAGCODE_GET, MEGAPHONE_LOOP, &loop);
124 Megaphone_param(JZ_FLAGCODE_GET, MEGAPHONE_LOOP_INTERVAL, &loop_interval); 134 Megaphone_param(JZ_FLAGCODE_GET, MEGAPHONE_LOOP_INTERVAL, &loop_interval);
@@ -112,8 +112,7 @@ void OnOutput(AIKIT_HANDLE* handle, const AIKIT_OutputData* output) @@ -112,8 +112,7 @@ void OnOutput(AIKIT_HANDLE* handle, const AIKIT_OutputData* output)
112 //缓冲区暂无空间,等待一段时间再写入 112 //缓冲区暂无空间,等待一段时间再写入
113 usleep(10000); // 10ms 113 usleep(10000); // 10ms
114 continue; 114 continue;
115 - }  
116 - 115 + }
117 116
118 if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS && ret != JZ_ERROR_SYSTEM_MODULE_CODE_BUFFER_SIZE_NOT_ENOUGH) 117 if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS && ret != JZ_ERROR_SYSTEM_MODULE_CODE_BUFFER_SIZE_NOT_ENOUGH)
119 { 118 {
@@ -46,6 +46,9 @@ extern "C" { @@ -46,6 +46,9 @@ extern "C" {
46 #define MAX_VOLUME (61) 46 #define MAX_VOLUME (61)
47 #define MAX_TTS_VOLUME (69) 47 #define MAX_TTS_VOLUME (69)
48 48
  49 + // #define MAX_VOLUME (100)
  50 + // #define MAX_TTS_VOLUME (100)
  51 +
49 #elif DEVICE_VERSION == JZ_H10 52 #elif DEVICE_VERSION == JZ_H10
50 // #define MAX_VOLUME (65) 53 // #define MAX_VOLUME (65)
51 // #define MAX_TTS_VOLUME (70) 54 // #define MAX_TTS_VOLUME (70)
@@ -107,6 +110,12 @@ extern "C" { @@ -107,6 +110,12 @@ extern "C" {
107 #define MAX_VOLUME (63) 110 #define MAX_VOLUME (63)
108 #define MAX_TTS_VOLUME (70) 111 #define MAX_TTS_VOLUME (70)
109 112
  113 +#elif DEVICE_VERSION == JZ_H150A
  114 + // #define MAX_VOLUME (80)
  115 + // #define MAX_TTS_VOLUME (75)
  116 +
  117 + #define MAX_VOLUME (100)
  118 + #define MAX_TTS_VOLUME (100)
110 #else 119 #else
111 #define MAX_VOLUME (75) 120 #define MAX_VOLUME (75)
112 #define MAX_TTS_VOLUME (75) 121 #define MAX_TTS_VOLUME (75)
@@ -35,7 +35,10 @@ T_JZsdkReturnCode Meg_SetVolumeFun(int volume) @@ -35,7 +35,10 @@ T_JZsdkReturnCode Meg_SetVolumeFun(int volume)
35 { 35 {
36 snprintf(cmdBuffer,128, "amixer set -c 0 Master %d",volume); 36 snprintf(cmdBuffer,128, "amixer set -c 0 Master %d",volume);
37 } 37 }
38 - else if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30 || DEVICE_VERSION == JZ_T40) 38 + else if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 ||
  39 + DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D ||
  40 + DEVICE_VERSION == JZ_U30 || DEVICE_VERSION == JZ_T40 ||
  41 + DEVICE_VERSION == JZ_H150A)
39 { 42 {
40 snprintf(cmdBuffer,128, "amixer sset -c 0 'Headphone' %d unmute",volume); 43 snprintf(cmdBuffer,128, "amixer sset -c 0 'Headphone' %d unmute",volume);
41 } 44 }
@@ -119,7 +122,10 @@ static T_JZsdkReturnCode Megaphone_SetTTSvolume() @@ -119,7 +122,10 @@ static T_JZsdkReturnCode Megaphone_SetTTSvolume()
119 printf("TTS音量修改\n"); 122 printf("TTS音量修改\n");
120 123
121 //v3s自设系统 要提高10初始音量 124 //v3s自设系统 要提高10初始音量
122 - if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) 125 + if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 ||
  126 + DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D ||
  127 + DEVICE_VERSION == JZ_U30 || DEVICE_VERSION == JZ_T40 ||
  128 + DEVICE_VERSION == JZ_H150A)
123 { 129 {
124 if (value > 0) 130 if (value > 0)
125 { 131 {
@@ -170,7 +176,10 @@ T_JZsdkReturnCode Megaphone_SetVolume(int value, int mode)//设置音é‡ï¼ŒéŸ³é‡ @@ -170,7 +176,10 @@ T_JZsdkReturnCode Megaphone_SetVolume(int value, int mode)//设置音é‡ï¼ŒéŸ³é‡
170 g_Megaphone_Volume = value;//获取当前音量 176 g_Megaphone_Volume = value;//获取当前音量
171 177
172 //v3s自设系统 要提高10初始音量 178 //v3s自设系统 要提高10初始音量
173 - if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 || DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) 179 + if (DEVICE_VERSION == JZ_H10T || DEVICE_VERSION == JZ_U3 ||
  180 + DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D ||
  181 + DEVICE_VERSION == JZ_U30 || DEVICE_VERSION == JZ_T40 ||
  182 + DEVICE_VERSION == JZ_H150A)
174 { 183 {
175 if (value > 0) 184 if (value > 0)
176 { 185 {
@@ -11,38 +11,20 @@ @@ -11,38 +11,20 @@
11 static int g_SearchLight_Subscription_Flag = JZ_FLAGCODE_OFF; //消息订阅状态 默认关闭本机的 11 static int g_SearchLight_Subscription_Flag = JZ_FLAGCODE_OFF; //消息订阅状态 默认关闭本机的
12 12
13 13
14 -typedef struct T_JzSearchLightInfo{  
15 - T_JzSearchLightAttribute Attribute;  
16 - JZ_MODULE_CONTROL_WAY ControlMode; //控制模式  
17 -  
18 -}T_JzSearchLightInfo;  
19 14
20 static T_JzSearchLightInfo g_SearchLight_Info; 15 static T_JzSearchLightInfo g_SearchLight_Info;
21 16
22 17
23 -T_JZsdkReturnCode SearchLight_Init(enum JZ_MODULE_CONTROL_WAY Mode) 18 +T_JZsdkReturnCode SearchLight_Init(T_JzSearchLightInfo Info)
24 { 19 {
25 - //温控初始化  
26 - JZsdk_SearchLightTemControl_Init();  
27 -  
28 - //初始化参数属性  
29 - static T_JzSearchLightAttribute SearchLight_Attribute = {  
30 - .Frequency = 100,  
31 - .Mode = E_JZ_SEARCHLIGHTMODE_OFF,  
32 - .LeftBrightness = 30,  
33 - .RightBrightness = 30,  
34 - .LeftTemperature = 0,  
35 - .RightTemperature = 0  
36 - };  
37 -  
38 - memcpy(&g_SearchLight_Info.Attribute, &SearchLight_Attribute, sizeof(T_JzSearchLightAttribute));  
39 -  
40 - //创建一个每隔一段时间就去查询探照灯数据的线程  
41 - T_JZsdkOsalHandler *osal_handle = JZsdk_Platform_GetOsalHandler();  
42 - if (osal_handle == NULL) 20 +
  21 + memset(&g_SearchLight_Info, 0, sizeof(T_JzSearchLightInfo));
  22 + memcpy(&g_SearchLight_Info, &Info, sizeof(T_JzSearchLightInfo));
  23 +
  24 + if (g_SearchLight_Info.ControlMode == JZ_MODULE_CONTROL_WAY_INDEPENDENT)
43 { 25 {
44 - JZSDK_LOG_ERROR("osal_handle is NULL\n");  
45 - return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; 26 + //温控初始化
  27 + JZsdk_SearchLightTemControl_Init();
46 } 28 }
47 29
48 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 30 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
@@ -73,21 +55,17 @@ T_JZsdkReturnCode SearchLight_CheckStatus_Attribute(T_JzSearchLightAttribute *p) @@ -73,21 +55,17 @@ T_JZsdkReturnCode SearchLight_CheckStatus_Attribute(T_JzSearchLightAttribute *p)
73 T_JZsdkReturnCode SearchLight_SetMode(E_JzSearchLightMode mode) 55 T_JZsdkReturnCode SearchLight_SetMode(E_JzSearchLightMode mode)
74 { 56 {
75 JZSDK_LOG_DEBUG("探照灯模式改变%d\n", mode); 57 JZSDK_LOG_DEBUG("探照灯模式改变%d\n", mode);
76 -#if (DEVICE_VERSION == JZ_U3 || \  
77 - DEVICE_VERSION == JZ_U3S || \  
78 - DEVICE_VERSION == JZ_U3D || \  
79 - DEVICE_VERSION == JZ_U30 || \  
80 - DEVICE_VERSION == TF_A1)  
81 -  
82 - HalSend_type1Send_SearchLight_Control(UART_DEV_2, mode, 0x00);  
83 -  
84 -#elif (DEVICE_VERSION == JZ_T40)  
85 - HalSend_type1Send_SearchLight_Control(UART_DEV_2, mode, 0x20);  
86 58
87 -#elif (DEVICE_VERSION == JZ_H1T)  
88 - HalSend_type1Send_SearchLight_Control(UART_DEV_1, mode, 0x20); 59 + T_JZsdkOsalHandler *osalHandle = JZsdk_Platform_GetOsalHandler();
  60 + if (osalHandle == NULL)
  61 + {
  62 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  63 + }
  64 +
  65 + int FrameSequence = g_SearchLight_Info.FrameSequence;
  66 + osalHandle->GetFrameSequenceQueueNum(&FrameSequence);
89 67
90 -#endif 68 + HalSend_type1Send_SearchLight_Control(g_SearchLight_Info.Device, mode, FrameSequence);
91 69
92 g_SearchLight_Info.Attribute.Mode = mode; 70 g_SearchLight_Info.Attribute.Mode = mode;
93 71
@@ -191,7 +169,7 @@ T_JZsdkReturnCode SearchLight_Obtain_Frequency(int Frequency) @@ -191,7 +169,7 @@ T_JZsdkReturnCode SearchLight_Obtain_Frequency(int Frequency)
191 //收到探照灯温度 169 //收到探照灯温度
192 T_JZsdkReturnCode SearchLight_Obtain_Temperature(int left, int right) 170 T_JZsdkReturnCode SearchLight_Obtain_Temperature(int left, int right)
193 { 171 {
194 - //JZSDK_LOG_DEBUG("%x收到探照灯温度回复%d %d",DEVICE_VERSION, left, right); 172 + JZSDK_LOG_DEBUG("%x收到探照灯温度回复%d %d",DEVICE_VERSION, left, right);
195 173
196 g_SearchLight_Info.Attribute.LeftTemperature = left; 174 g_SearchLight_Info.Attribute.LeftTemperature = left;
197 g_SearchLight_Info.Attribute.RightTemperature = right; 175 g_SearchLight_Info.Attribute.RightTemperature = right;
@@ -255,7 +233,7 @@ T_JZsdkReturnCode SearchLight_Flush_SearchLightTemerature() @@ -255,7 +233,7 @@ T_JZsdkReturnCode SearchLight_Flush_SearchLightTemerature()
255 { 233 {
256 #if DEVICE_VERSION == JZ_H1T 234 #if DEVICE_VERSION == JZ_H1T
257 235
258 - HalSend_type1Send_CheckStatus_SearchLight_Temperture(UART_DEV_1); 236 + HalSend_type1Send_CheckStatus_SearchLight_Temperture(UART_DEV_1, 0x00);
259 #endif 237 #endif
260 } 238 }
261 239
@@ -26,6 +26,13 @@ typedef struct T_JzSearchLightAttribute{ @@ -26,6 +26,13 @@ typedef struct T_JzSearchLightAttribute{
26 int RightTemperature; //右灯光温度 26 int RightTemperature; //右灯光温度
27 }T_JzSearchLightAttribute; 27 }T_JzSearchLightAttribute;
28 28
  29 +typedef struct T_JzSearchLightInfo{
  30 + T_JzSearchLightAttribute Attribute;
  31 + JZ_MODULE_CONTROL_WAY ControlMode; //控制模式
  32 + JZ_DEVICE_PORT_TYPE Device; //控制的设备
  33 + int FrameSequence;//是否指定特别的序列号
  34 +}T_JzSearchLightInfo;
  35 +
29 typedef enum E_JzSearchLightMode{ 36 typedef enum E_JzSearchLightMode{
30 E_JZ_SEARCHLIGHTMODE_OFF = 0, //关闭 37 E_JZ_SEARCHLIGHTMODE_OFF = 0, //关闭
31 E_JZ_SEARCHLIGHTMODE_BRUST = 1, //爆闪 38 E_JZ_SEARCHLIGHTMODE_BRUST = 1, //爆闪
@@ -51,6 +58,6 @@ T_JZsdkReturnCode SearchLight_Obtain_Mode(E_JzSearchLightMode mode); @@ -51,6 +58,6 @@ T_JZsdkReturnCode SearchLight_Obtain_Mode(E_JzSearchLightMode mode);
51 T_JZsdkReturnCode JZsdk_SearchLight_SetMessageSubFlag(int InputFlag); 58 T_JZsdkReturnCode JZsdk_SearchLight_SetMessageSubFlag(int InputFlag);
52 int JZsdk_SearchLight_GetMessageSubFlag(void); 59 int JZsdk_SearchLight_GetMessageSubFlag(void);
53 60
54 -T_JZsdkReturnCode SearchLight_Init(enum JZ_MODULE_CONTROL_WAY Mode); 61 +T_JZsdkReturnCode SearchLight_Init(T_JzSearchLightInfo Info);
55 62
56 #endif 63 #endif
@@ -425,7 +425,7 @@ T_JZsdkReturnCode JZsdk_PsdkUi_value_get(JZsdk_Widget_Control index, int *value) @@ -425,7 +425,7 @@ T_JZsdkReturnCode JZsdk_PsdkUi_value_get(JZsdk_Widget_Control index, int *value)
425 425
426 if (LanguageInfo == LANGUAGE_INFO_CHINESE) 426 if (LanguageInfo == LANGUAGE_INFO_CHINESE)
427 { 427 {
428 - switch (value) 428 + switch (*value)
429 { 429 {
430 case 0: 430 case 0:
431 tone = 0x01; 431 tone = 0x01;
@@ -466,7 +466,7 @@ T_JZsdkReturnCode JZsdk_PsdkUi_value_get(JZsdk_Widget_Control index, int *value) @@ -466,7 +466,7 @@ T_JZsdkReturnCode JZsdk_PsdkUi_value_get(JZsdk_Widget_Control index, int *value)
466 466
467 else 467 else
468 { 468 {
469 - switch (value) 469 + switch (*value)
470 { 470 {
471 case 0: 471 case 0:
472 tone = 0x11; 472 tone = 0x11;
@@ -1004,6 +1004,36 @@ T_JZsdkReturnCode UIcontrol_Set_GimbalPitchFineTuning(int DeviceName,int value) @@ -1004,6 +1004,36 @@ T_JZsdkReturnCode UIcontrol_Set_GimbalPitchFineTuning(int DeviceName,int value)
1004 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 1004 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
1005 } 1005 }
1006 1006
  1007 +//设置pitch云台补偿值
  1008 +T_JZsdkReturnCode UIcontrol_Set_SingleCompensation(int DeviceName,int direction, int value)
  1009 +{
  1010 +#ifdef GIMBAL_STATUS_ON
  1011 +
  1012 + if(direction == 0)
  1013 + {
  1014 + T_JZsdkReturnCode ret = Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_LEFT, value);
  1015 + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  1016 + {
  1017 + printf("%s:%s\n",UI_CONTROL_ERROR,JZsdk_GetReturnCodeMessage(ret));
  1018 + return ret;
  1019 + }
  1020 + }
  1021 + else if (direction == 1)
  1022 + {
  1023 + T_JZsdkReturnCode ret = Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_RIGHT, value);
  1024 + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  1025 + {
  1026 + printf("%s:%s\n",UI_CONTROL_ERROR,JZsdk_GetReturnCodeMessage(ret));
  1027 + return ret;
  1028 + }
  1029 + }
  1030 +#endif
  1031 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  1032 +}
  1033 +
  1034 +
  1035 +
  1036 +
1007 //查询云台角度 1037 //查询云台角度
1008 T_JZsdkReturnCode UIcontrol_CheckStatus_GimbalAngle(int *PitchValue, int *YawValue) 1038 T_JZsdkReturnCode UIcontrol_CheckStatus_GimbalAngle(int *PitchValue, int *YawValue)
1009 { 1039 {
@@ -1348,8 +1378,8 @@ T_JZsdkReturnCode UIcontrol_CheckStatus_SearchLightTemperture(int *ValueLeftTemp @@ -1348,8 +1378,8 @@ T_JZsdkReturnCode UIcontrol_CheckStatus_SearchLightTemperture(int *ValueLeftTemp
1348 //获取探照灯属性 1378 //获取探照灯属性
1349 T_JzSearchLightAttribute LightAttribute; 1379 T_JzSearchLightAttribute LightAttribute;
1350 SearchLight_Get_SearchLightAttribute(&LightAttribute); 1380 SearchLight_Get_SearchLightAttribute(&LightAttribute);
1351 - *ValueLeftTemperature = LightAttribute.LeftBrightness;  
1352 - *ValueRightTemperaturen = LightAttribute.RightBrightness; 1381 + *ValueLeftTemperature = LightAttribute.LeftTemperature;
  1382 + *ValueRightTemperaturen = LightAttribute.RightTemperature;
1353 1383
1354 #endif 1384 #endif
1355 1385
@@ -1838,7 +1868,7 @@ T_JZsdkReturnCode UIcontrol_ObtainSearchLight_SingleTemperature(int DeviceName, @@ -1838,7 +1868,7 @@ T_JZsdkReturnCode UIcontrol_ObtainSearchLight_SingleTemperature(int DeviceName,
1838 T_JzSearchLightAttribute Attribute; 1868 T_JzSearchLightAttribute Attribute;
1839 SearchLight_Get_SearchLightAttribute(&Attribute); 1869 SearchLight_Get_SearchLightAttribute(&Attribute);
1840 1870
1841 - if(Brocastflag == JZ_FLAGCODE_ON && FrameSequence == 0x21) 1871 + if(Brocastflag == JZ_FLAGCODE_ON)
1842 { 1872 {
1843 //通知其他设备的ui界面变化 1873 //通知其他设备的ui界面变化
1844 //如果4G模块有启动 1874 //如果4G模块有启动
@@ -1857,12 +1887,12 @@ T_JZsdkReturnCode UIcontrol_ObtainSearchLight_SingleTemperature(int DeviceName, @@ -1857,12 +1887,12 @@ T_JZsdkReturnCode UIcontrol_ObtainSearchLight_SingleTemperature(int DeviceName,
1857 //如果设备2有启动 1887 //如果设备2有启动
1858 if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) ) 1888 if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) && (DeviceName != UART_DEV_2) )
1859 { 1889 {
1860 - HalSend_type1Send_SearchLight_Temperature(UART_DEV_1, Attribute.LeftTemperature, Attribute.RightTemperature); 1890 + HalSend_type1Send_SearchLight_Temperature(UART_DEV_2, Attribute.LeftTemperature, Attribute.RightTemperature);
1861 } 1891 }
1862 //如果psdk接口已经使用 1892 //如果psdk接口已经使用
1863 if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK ) 1893 if ( (JZsdk_HalPort_UseFlag(DEVICE_PSDK) == JZ_FLAGCODE_ON) && DeviceName != DEVICE_PSDK )
1864 { 1894 {
1865 - HalSend_type1Send_SearchLight_Temperature(UART_DEV_1, Attribute.LeftTemperature, Attribute.RightTemperature); 1895 + //无反应
1866 } 1896 }
1867 } 1897 }
1868 1898
@@ -65,6 +65,8 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_AppendTone(int DeviceName,int value); @@ -65,6 +65,8 @@ T_JZsdkReturnCode UIcontrol_Set_TTS_AppendTone(int DeviceName,int value);
65 T_JZsdkReturnCode UIcontrol_Set_GimbalPitchAngle(int DeviceName, int value); 65 T_JZsdkReturnCode UIcontrol_Set_GimbalPitchAngle(int DeviceName, int value);
66 T_JZsdkReturnCode UIcontrol_SetGimbalRange(int DeviceName,int value); 66 T_JZsdkReturnCode UIcontrol_SetGimbalRange(int DeviceName,int value);
67 T_JZsdkReturnCode UIcontrol_Set_GimbalPitchFineTuning(int DeviceName,int value); 67 T_JZsdkReturnCode UIcontrol_Set_GimbalPitchFineTuning(int DeviceName,int value);
  68 +T_JZsdkReturnCode UIcontrol_Set_SingleCompensation(int DeviceName,int direction, int value);
  69 +
68 T_JZsdkReturnCode UIcontrol_CheckStatus_GimbalPitchFineTuning(int *PitchValue, int *YawValue); 70 T_JZsdkReturnCode UIcontrol_CheckStatus_GimbalPitchFineTuning(int *PitchValue, int *YawValue);
69 T_JZsdkReturnCode UIcontrol_Obtain_GimbalPitchFineTuninng(int DeviceName, int Pitch); 71 T_JZsdkReturnCode UIcontrol_Obtain_GimbalPitchFineTuninng(int DeviceName, int Pitch);
70 T_JZsdkReturnCode UIcontrol_Set_GimbalLinkageControl(int DeviceName, int value); 72 T_JZsdkReturnCode UIcontrol_Set_GimbalLinkageControl(int DeviceName, int value);
@@ -151,6 +151,14 @@ static int WidgetMgMT_Control_WorkFuntion(int Inscode, int value) @@ -151,6 +151,14 @@ static int WidgetMgMT_Control_WorkFuntion(int Inscode, int value)
151 case JZSDK_WIDGET_SIDE_LASER_MODE: 151 case JZSDK_WIDGET_SIDE_LASER_MODE:
152 JZsdk_Psdk_UI_io_SideLaserMode(JZ_FLAGCODE_ON, value); 152 JZsdk_Psdk_UI_io_SideLaserMode(JZ_FLAGCODE_ON, value);
153 break; 153 break;
  154 +
  155 + case JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_LEFT:
  156 + UIcontrol_Set_SingleCompensation(JZ_FLAGCODE_ON, 0, value);
  157 + break;
  158 +
  159 + case JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_RIGHT:
  160 + UIcontrol_Set_SingleCompensation(JZ_FLAGCODE_ON, 1, value);
  161 + break;
154 162
155 default: 163 default:
156 break; 164 break;
@@ -5,26 +5,18 @@ @@ -5,26 +5,18 @@
5 #include "WarnLight/WarnLight.h" 5 #include "WarnLight/WarnLight.h"
6 6
7 7
8 -typedef struct T_JzWarnLightInfo{  
9 - T_JzWarnLightAttribute Attribute;  
10 - JZ_MODULE_CONTROL_WAY ControlMode; //控制模式  
11 -}T_JzWarnLightInfo;  
12 -  
13 static T_JzWarnLightInfo g_WarnLightInfo; 8 static T_JzWarnLightInfo g_WarnLightInfo;
14 9
15 -T_JZsdkReturnCode WarnLight_Init(enum JZ_MODULE_CONTROL_WAY Mode) 10 +T_JZsdkReturnCode WarnLight_Init(T_JzWarnLightInfo RegInfo)
16 { 11 {
17 //初始化参数 12 //初始化参数
18 - static T_JzWarnLightAttribute Attribute = {  
19 - .Color1 = E_JZ_WARNLIGHT_COLOR_RED,  
20 - .Color2 = E_JZ_WARNLIGHT_COLOR_BLUE,  
21 - .mode = E_JZ_WARNLIGHT_MODE_ALTERATING_FAST_FALSHING,  
22 - .status = JZ_FLAGCODE_OFF,  
23 - }; 13 + memset(&g_WarnLightInfo, 0, sizeof(T_JzWarnLightInfo));
  14 + memcpy(&g_WarnLightInfo, &RegInfo, sizeof(T_JzWarnLightInfo));
24 15
25 - memcpy(&g_WarnLightInfo.Attribute, &Attribute, sizeof(T_JzWarnLightAttribute)); 16 + //打印参数
  17 + JZSDK_LOG_INFO("WarnLightControlMode:%d",g_WarnLightInfo.ControlMode);
26 18
27 - g_WarnLightInfo.ControlMode = Mode; 19 + JZSDK_LOG_INFO("WarnLight Init Success");
28 20
29 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 21 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
30 } 22 }
@@ -33,22 +25,16 @@ T_JZsdkReturnCode WarnLight_Set_StatusAndMode(int status, int mode) @@ -33,22 +25,16 @@ T_JZsdkReturnCode WarnLight_Set_StatusAndMode(int status, int mode)
33 { 25 {
34 JZSDK_LOG_DEBUG("WarnLight_Set_StatusAndMode: status = %d, mode = %d", status, mode); 26 JZSDK_LOG_DEBUG("WarnLight_Set_StatusAndMode: status = %d, mode = %d", status, mode);
35 27
36 -#if DEVICE_VERSION == JZ_H1T  
37 -  
38 - HalSend_type1Send_Set_WarningLight_Status(UART_DEV_1, 0x00, status, mode);  
39 -  
40 -#elif DEVICE_VERSION == TF_A1 || \  
41 - DEVICE_VERSION == JZ_U3S || \  
42 - DEVICE_VERSION == JZ_U3D || \  
43 - DEVICE_VERSION == JZ_U30 28 + T_JZsdkOsalHandler *osalHandle = JZsdk_Platform_GetOsalHandler();
  29 + if (osalHandle == NULL)
  30 + {
  31 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  32 + }
44 33
45 - HalSend_type1Send_Set_WarningLight_Status(UART_DEV_2, 0x00, status, mode);  
46 -  
47 -#elif DEVICE_VERSION == JZ_T40 34 + U8_t FrameSequence = g_WarnLightInfo.FrameSequence;
  35 + osalHandle->GetFrameSequenceQueueNum(&FrameSequence);
48 36
49 - HalSend_type1Send_Set_WarningLight_Status(UART_DEV_2, 0x20, status, mode);  
50 -  
51 -#endif 37 + HalSend_type1Send_Set_WarningLight_Status(g_WarnLightInfo.Device, FrameSequence, status, mode);
52 38
53 g_WarnLightInfo.Attribute.mode = mode; 39 g_WarnLightInfo.Attribute.mode = mode;
54 g_WarnLightInfo.Attribute.status = status; 40 g_WarnLightInfo.Attribute.status = status;
@@ -78,7 +64,7 @@ T_JZsdkReturnCode WarnLight_Flush_StatusAndMode() @@ -78,7 +64,7 @@ T_JZsdkReturnCode WarnLight_Flush_StatusAndMode()
78 if(g_WarnLightInfo.ControlMode == JZ_MODULE_CONTROL_WAY_TRANSPARENT) 64 if(g_WarnLightInfo.ControlMode == JZ_MODULE_CONTROL_WAY_TRANSPARENT)
79 { 65 {
80 //查询灯光属性 66 //查询灯光属性
81 - HalSend_type1Send_CheckStatus_WarningLightStatus(UART_DEV_1); 67 + HalSend_type1Send_CheckStatus_WarningLightStatus(g_WarnLightInfo.Device);
82 } 68 }
83 69
84 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 70 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
@@ -91,22 +77,17 @@ T_JZsdkReturnCode WarnLight_Set_Color(int Color1, int Color2) @@ -91,22 +77,17 @@ T_JZsdkReturnCode WarnLight_Set_Color(int Color1, int Color2)
91 { 77 {
92 JZSDK_LOG_DEBUG("设置0x%x:警灯颜色 Color1:0x%x, color:0x%x",DEVICE_VERSION, Color1, Color2); 78 JZSDK_LOG_DEBUG("设置0x%x:警灯颜色 Color1:0x%x, color:0x%x",DEVICE_VERSION, Color1, Color2);
93 79
94 -#if DEVICE_VERSION == JZ_H1T  
95 - HalSend_type1Send_Set_WarningLight_Color(UART_DEV_1, 0x00, Color1, Color2);  
96 -  
97 -#elif DEVICE_VERSION == TF_A1 || \  
98 - DEVICE_VERSION == JZ_U3S || \  
99 - DEVICE_VERSION == JZ_U3D || \  
100 - DEVICE_VERSION == JZ_U30  
101 -  
102 -  
103 - HalSend_type1Send_Set_WarningLight_Color(UART_DEV_2, 0x00, Color1, Color2); 80 + T_JZsdkOsalHandler *osalHandle = JZsdk_Platform_GetOsalHandler();
  81 + if (osalHandle == NULL)
  82 + {
  83 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  84 + }
104 85
105 -#elif DEVICE_VERSION == JZ_T40 86 + U8_t FrameSequence = g_WarnLightInfo.FrameSequence;
  87 + osalHandle->GetFrameSequenceQueueNum(&FrameSequence);
106 88
107 - HalSend_type1Send_Set_WarningLight_Color(UART_DEV_2, 0x20, Color1, Color2);  
108 -  
109 -#endif 89 + //发送警灯颜色
  90 + HalSend_type1Send_Set_WarningLight_Color(g_WarnLightInfo.Device, FrameSequence, Color1, Color2);
110 91
111 g_WarnLightInfo.Attribute.Color1 = Color1; 92 g_WarnLightInfo.Attribute.Color1 = Color1;
112 g_WarnLightInfo.Attribute.Color2 = Color2; 93 g_WarnLightInfo.Attribute.Color2 = Color2;
@@ -132,7 +113,7 @@ T_JZsdkReturnCode WarnLight_Flush_Color() @@ -132,7 +113,7 @@ T_JZsdkReturnCode WarnLight_Flush_Color()
132 if(g_WarnLightInfo.ControlMode == JZ_MODULE_CONTROL_WAY_TRANSPARENT) 113 if(g_WarnLightInfo.ControlMode == JZ_MODULE_CONTROL_WAY_TRANSPARENT)
133 { 114 {
134 //查询灯光属性 115 //查询灯光属性
135 - HalSend_type1Send_CheckStatus_WarningLightColor(UART_DEV_1); 116 + HalSend_type1Send_CheckStatus_WarningLightColor(g_WarnLightInfo.Device);
136 } 117 }
137 118
138 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 119 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
@@ -146,7 +127,7 @@ T_JZsdkReturnCode WarnLight_Get_Attribute(T_JzWarnLightAttribute *Attribute) @@ -146,7 +127,7 @@ T_JZsdkReturnCode WarnLight_Get_Attribute(T_JzWarnLightAttribute *Attribute)
146 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; 127 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
147 } 128 }
148 129
149 - memcpy(Attribute, &g_WarnLightInfo.Attribute, sizeof(T_JzWarnLightAttribute)); 130 + memcpy(Attribute, &(g_WarnLightInfo.Attribute), sizeof(T_JzWarnLightAttribute));
150 131
151 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 132 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
152 } 133 }
@@ -23,12 +23,20 @@ extern "C" { @@ -23,12 +23,20 @@ extern "C" {
23 /* Exported types ------------------------------------------------------------*/ 23 /* Exported types ------------------------------------------------------------*/
24 typedef struct T_JzWarnLightAttribute{ 24 typedef struct T_JzWarnLightAttribute{
25 int mode; //模式 25 int mode; //模式
  26 +
26 int status; //状态 27 int status; //状态
27 int Color1; //颜色1 28 int Color1; //颜色1
28 int Color2; //颜色2 29 int Color2; //颜色2
29 }T_JzWarnLightAttribute; 30 }T_JzWarnLightAttribute;
30 31
31 32
  33 +typedef struct T_JzWarnLightInfo{
  34 + T_JzWarnLightAttribute Attribute;
  35 + JZ_MODULE_CONTROL_WAY ControlMode; //控制模式
  36 + JZ_DEVICE_PORT_TYPE Device; //控制的设备
  37 + int FrameSequence;//是否指定特别的序列号
  38 +}T_JzWarnLightInfo;
  39 +
32 typedef enum E_JzWarnLightColor{ 40 typedef enum E_JzWarnLightColor{
33 E_JZ_WARNLIGHT_COLOR_RED = 1, 41 E_JZ_WARNLIGHT_COLOR_RED = 1,
34 E_JZ_WARNLIGHT_COLOR_GREEN = 2, 42 E_JZ_WARNLIGHT_COLOR_GREEN = 2,
@@ -57,7 +65,7 @@ T_JZsdkReturnCode WarnLight_Flush_Color(); @@ -57,7 +65,7 @@ T_JZsdkReturnCode WarnLight_Flush_Color();
57 T_JZsdkReturnCode WarnLight_Obatin_StatusAndMode(int status, int mode); 65 T_JZsdkReturnCode WarnLight_Obatin_StatusAndMode(int status, int mode);
58 T_JZsdkReturnCode WarnLight_Obatin_Color(int Color1, int Color2); 66 T_JZsdkReturnCode WarnLight_Obatin_Color(int Color1, int Color2);
59 67
60 -T_JZsdkReturnCode WarnLight_Init(enum JZ_MODULE_CONTROL_WAY Mode); 68 +T_JZsdkReturnCode WarnLight_Init(T_JzWarnLightInfo RegInfo);
61 69
62 70
63 #ifdef __cplusplus 71 #ifdef __cplusplus
@@ -25,15 +25,8 @@ T_JZsdkReturnCode Megphone_Attention() @@ -25,15 +25,8 @@ T_JZsdkReturnCode Megphone_Attention()
25 //如果是喊话器设备 25 //如果是喊话器设备
26 #ifdef MEGAPHONE_CONFIG_STATUS_ON 26 #ifdef MEGAPHONE_CONFIG_STATUS_ON
27 27
28 - //引脚初始化  
29 - IrcutInfo ircut_info;  
30 - ircut_info.Amplifiter_Pin.Enable = JZ_FLAGCODE_ON;  
31 - ircut_info.Amplifiter_Pin.Port = JZ_IRC_PORT_PG;  
32 - ircut_info.Amplifiter_Pin.index = 5;  
33 - ircut_info.Amplifiter_Pin.Group = 0;  
34 - ircut_info.Amplifiter_Pin.mode = JZ_IRC_PIN_MODE_OUT;  
35 -  
36 - Ircut_Init(ircut_info); 28 + //设备例程初始化
  29 + DeviceSample_init(APP_ATTENTION);
37 30
38 //音频库初始化 31 //音频库初始化
39 AudioDeal_Init(); 32 AudioDeal_Init();
@@ -28,32 +28,28 @@ The CXX compiler identification is GNU, found in "/mnt/hgfs/share/JZSDK_Linux/pr @@ -28,32 +28,28 @@ The CXX compiler identification is GNU, found in "/mnt/hgfs/share/JZSDK_Linux/pr
28 Determining if the C compiler works passed with the following output: 28 Determining if the C compiler works passed 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:"/usr/bin/make" "cmTC_5dd78/fast"  
32 -make: Warning: File 'Makefile' has modification time 0.094 s in the future  
33 -/usr/bin/make -f CMakeFiles/cmTC_5dd78.dir/build.make CMakeFiles/cmTC_5dd78.dir/build 31 +Run Build Command:"/usr/bin/make" "cmTC_96269/fast"
  32 +/usr/bin/make -f CMakeFiles/cmTC_96269.dir/build.make CMakeFiles/cmTC_96269.dir/build
34 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 33 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
35 -make[1]: Warning: File 'CMakeFiles/cmTC_5dd78.dir/flags.make' has modification time 0.08 s in the future  
36 -Building C object CMakeFiles/cmTC_5dd78.dir/testCCompiler.c.o  
37 -/usr/bin/cc -o CMakeFiles/cmTC_5dd78.dir/testCCompiler.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp/testCCompiler.c  
38 -Linking C executable cmTC_5dd78  
39 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5dd78.dir/link.txt --verbose=1  
40 -/usr/bin/cc CMakeFiles/cmTC_5dd78.dir/testCCompiler.c.o -o cmTC_5dd78 -rdynamic  
41 -make[1]: 警告:检测到时钟错误。您的创建可能是不完整的。 34 +Building C object CMakeFiles/cmTC_96269.dir/testCCompiler.c.o
  35 +/usr/bin/cc -o CMakeFiles/cmTC_96269.dir/testCCompiler.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp/testCCompiler.c
  36 +Linking C executable cmTC_96269
  37 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_96269.dir/link.txt --verbose=1
  38 +/usr/bin/cc CMakeFiles/cmTC_96269.dir/testCCompiler.c.o -o cmTC_96269 -rdynamic
42 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 39 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
43 -make: 警告:检测到时钟错误。您的创建可能是不完整的。  
44 40
45 41
46 Detecting C compiler ABI info compiled with the following output: 42 Detecting C compiler ABI info compiled with the following output:
47 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 43 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
48 44
49 -Run Build Command:"/usr/bin/make" "cmTC_a0142/fast"  
50 -/usr/bin/make -f CMakeFiles/cmTC_a0142.dir/build.make CMakeFiles/cmTC_a0142.dir/build 45 +Run Build Command:"/usr/bin/make" "cmTC_49efd/fast"
  46 +/usr/bin/make -f CMakeFiles/cmTC_49efd.dir/build.make CMakeFiles/cmTC_49efd.dir/build
51 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 47 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
52 -Building C object CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o  
53 -/usr/bin/cc -o CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c  
54 -Linking C executable cmTC_a0142  
55 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a0142.dir/link.txt --verbose=1  
56 -/usr/bin/cc -v CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o -o cmTC_a0142 -rdynamic 48 +Building C object CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o
  49 +/usr/bin/cc -o CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c
  50 +Linking C executable cmTC_49efd
  51 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_49efd.dir/link.txt --verbose=1
  52 +/usr/bin/cc -v CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o -o cmTC_49efd -rdynamic
57 Using built-in specs. 53 Using built-in specs.
58 COLLECT_GCC=/usr/bin/cc 54 COLLECT_GCC=/usr/bin/cc
59 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper 55 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
@@ -63,8 +59,8 @@ Thread model: posix @@ -63,8 +59,8 @@ Thread model: posix
63 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 59 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
64 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/ 60 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 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/ 61 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 -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_a0142' '-rdynamic' '-mtune=generic' '-march=x86-64'  
67 - /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/cc8mxu0M.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_a0142 /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_a0142.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 62 +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_49efd' '-rdynamic' '-mtune=generic' '-march=x86-64'
  63 + /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/cclcS6gK.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_49efd /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_49efd.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
68 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 64 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
69 65
70 66
@@ -72,14 +68,14 @@ Parsed C implicit link information from above output: @@ -72,14 +68,14 @@ Parsed C implicit link information from above output:
72 link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] 68 link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
73 ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] 69 ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp]
74 ignore line: [] 70 ignore line: []
75 - ignore line: [Run Build Command:"/usr/bin/make" "cmTC_a0142/fast"]  
76 - ignore line: [/usr/bin/make -f CMakeFiles/cmTC_a0142.dir/build.make CMakeFiles/cmTC_a0142.dir/build] 71 + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_49efd/fast"]
  72 + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_49efd.dir/build.make CMakeFiles/cmTC_49efd.dir/build]
77 ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] 73 ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp']
78 - ignore line: [Building C object CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o]  
79 - ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c]  
80 - ignore line: [Linking C executable cmTC_a0142]  
81 - ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a0142.dir/link.txt --verbose=1]  
82 - ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o -o cmTC_a0142 -rdynamic ] 74 + ignore line: [Building C object CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o]
  75 + ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c]
  76 + ignore line: [Linking C executable cmTC_49efd]
  77 + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_49efd.dir/link.txt --verbose=1]
  78 + ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o -o cmTC_49efd -rdynamic ]
83 ignore line: [Using built-in specs.] 79 ignore line: [Using built-in specs.]
84 ignore line: [COLLECT_GCC=/usr/bin/cc] 80 ignore line: [COLLECT_GCC=/usr/bin/cc]
85 ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] 81 ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper]
@@ -89,13 +85,13 @@ Parsed C implicit link information from above output: @@ -89,13 +85,13 @@ Parsed C implicit link information from above output:
89 ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] 85 ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ]
90 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/] 86 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/]
91 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/] 87 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/]
92 - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_a0142' '-rdynamic' '-mtune=generic' '-march=x86-64']  
93 - 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/cc8mxu0M.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_a0142 /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_a0142.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] 88 + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_49efd' '-rdynamic' '-mtune=generic' '-march=x86-64']
  89 + 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/cclcS6gK.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_49efd /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_49efd.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]
94 arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore 90 arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore
95 arg [-plugin] ==> ignore 91 arg [-plugin] ==> ignore
96 arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore 92 arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore
97 arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore 93 arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore
98 - arg [-plugin-opt=-fresolution=/tmp/cc8mxu0M.res] ==> ignore 94 + arg [-plugin-opt=-fresolution=/tmp/cclcS6gK.res] ==> ignore
99 arg [-plugin-opt=-pass-through=-lgcc] ==> ignore 95 arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
100 arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore 96 arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
101 arg [-plugin-opt=-pass-through=-lc] ==> ignore 97 arg [-plugin-opt=-pass-through=-lc] ==> ignore
@@ -113,7 +109,7 @@ Parsed C implicit link information from above output: @@ -113,7 +109,7 @@ Parsed C implicit link information from above output:
113 arg [/lib64/ld-linux-x86-64.so.2] ==> ignore 109 arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
114 arg [-zrelro] ==> ignore 110 arg [-zrelro] ==> ignore
115 arg [-o] ==> ignore 111 arg [-o] ==> ignore
116 - arg [cmTC_a0142] ==> ignore 112 + arg [cmTC_49efd] ==> ignore
117 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore 113 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore
118 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore 114 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore
119 arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore 115 arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore
@@ -125,7 +121,7 @@ Parsed C implicit link information from above output: @@ -125,7 +121,7 @@ Parsed C implicit link information from above output:
125 arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] 121 arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
126 arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] 122 arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
127 arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] 123 arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..]
128 - arg [CMakeFiles/cmTC_a0142.dir/CMakeCCompilerABI.c.o] ==> ignore 124 + arg [CMakeFiles/cmTC_49efd.dir/CMakeCCompilerABI.c.o] ==> ignore
129 arg [-lgcc] ==> lib [gcc] 125 arg [-lgcc] ==> lib [gcc]
130 arg [--as-needed] ==> ignore 126 arg [--as-needed] ==> ignore
131 arg [-lgcc_s] ==> lib [gcc_s] 127 arg [-lgcc_s] ==> lib [gcc_s]
@@ -159,14 +155,14 @@ Parsed C implicit link information from above output: @@ -159,14 +155,14 @@ Parsed C implicit link information from above output:
159 Detecting C [-std=c11] compiler features compiled with the following output: 155 Detecting C [-std=c11] compiler features compiled with the following output:
160 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 156 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
161 157
162 -Run Build Command:"/usr/bin/make" "cmTC_225dd/fast"  
163 -/usr/bin/make -f CMakeFiles/cmTC_225dd.dir/build.make CMakeFiles/cmTC_225dd.dir/build 158 +Run Build Command:"/usr/bin/make" "cmTC_599d5/fast"
  159 +/usr/bin/make -f CMakeFiles/cmTC_599d5.dir/build.make CMakeFiles/cmTC_599d5.dir/build
164 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 160 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
165 -Building C object CMakeFiles/cmTC_225dd.dir/feature_tests.c.o  
166 -/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_225dd.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c  
167 -Linking C executable cmTC_225dd  
168 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_225dd.dir/link.txt --verbose=1  
169 -/usr/bin/cc CMakeFiles/cmTC_225dd.dir/feature_tests.c.o -o cmTC_225dd -rdynamic 161 +Building C object CMakeFiles/cmTC_599d5.dir/feature_tests.c.o
  162 +/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_599d5.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c
  163 +Linking C executable cmTC_599d5
  164 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_599d5.dir/link.txt --verbose=1
  165 +/usr/bin/cc CMakeFiles/cmTC_599d5.dir/feature_tests.c.o -o cmTC_599d5 -rdynamic
170 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 166 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
171 167
172 168
@@ -179,14 +175,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_ @@ -179,14 +175,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_
179 Detecting C [-std=c99] compiler features compiled with the following output: 175 Detecting C [-std=c99] compiler features compiled with the following output:
180 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 176 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
181 177
182 -Run Build Command:"/usr/bin/make" "cmTC_ed5e9/fast"  
183 -/usr/bin/make -f CMakeFiles/cmTC_ed5e9.dir/build.make CMakeFiles/cmTC_ed5e9.dir/build 178 +Run Build Command:"/usr/bin/make" "cmTC_d3a2f/fast"
  179 +/usr/bin/make -f CMakeFiles/cmTC_d3a2f.dir/build.make CMakeFiles/cmTC_d3a2f.dir/build
184 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 180 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
185 -Building C object CMakeFiles/cmTC_ed5e9.dir/feature_tests.c.o  
186 -/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_ed5e9.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c  
187 -Linking C executable cmTC_ed5e9  
188 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ed5e9.dir/link.txt --verbose=1  
189 -/usr/bin/cc CMakeFiles/cmTC_ed5e9.dir/feature_tests.c.o -o cmTC_ed5e9 -rdynamic 181 +Building C object CMakeFiles/cmTC_d3a2f.dir/feature_tests.c.o
  182 +/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_d3a2f.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c
  183 +Linking C executable cmTC_d3a2f
  184 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d3a2f.dir/link.txt --verbose=1
  185 +/usr/bin/cc CMakeFiles/cmTC_d3a2f.dir/feature_tests.c.o -o cmTC_d3a2f -rdynamic
190 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 186 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
191 187
192 188
@@ -199,19 +195,15 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_ @@ -199,19 +195,15 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_
199 Detecting C [-std=c90] compiler features compiled with the following output: 195 Detecting C [-std=c90] compiler features compiled with the following output:
200 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 196 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
201 197
202 -Run Build Command:"/usr/bin/make" "cmTC_157bf/fast"  
203 -make: Warning: File 'Makefile' has modification time 0.081 s in the future  
204 -/usr/bin/make -f CMakeFiles/cmTC_157bf.dir/build.make CMakeFiles/cmTC_157bf.dir/build 198 +Run Build Command:"/usr/bin/make" "cmTC_f41ba/fast"
  199 +/usr/bin/make -f CMakeFiles/cmTC_f41ba.dir/build.make CMakeFiles/cmTC_f41ba.dir/build
205 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 200 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
206 -make[1]: Warning: File 'CMakeFiles/cmTC_157bf.dir/flags.make' has modification time 0.068 s in the future  
207 -Building C object CMakeFiles/cmTC_157bf.dir/feature_tests.c.o  
208 -/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_157bf.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c  
209 -Linking C executable cmTC_157bf  
210 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_157bf.dir/link.txt --verbose=1  
211 -/usr/bin/cc CMakeFiles/cmTC_157bf.dir/feature_tests.c.o -o cmTC_157bf -rdynamic  
212 -make[1]: 警告:检测到时钟错误。您的创建可能是不完整的。 201 +Building C object CMakeFiles/cmTC_f41ba.dir/feature_tests.c.o
  202 +/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_f41ba.dir/feature_tests.c.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.c
  203 +Linking C executable cmTC_f41ba
  204 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f41ba.dir/link.txt --verbose=1
  205 +/usr/bin/cc CMakeFiles/cmTC_f41ba.dir/feature_tests.c.o -o cmTC_f41ba -rdynamic
213 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 206 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
214 -make: 警告:检测到时钟错误。您的创建可能是不完整的。  
215 207
216 208
217 Feature record: C_FEATURE:1c_function_prototypes 209 Feature record: C_FEATURE:1c_function_prototypes
@@ -221,28 +213,28 @@ make: 警告:检测到时钟错误。您的创建可能是不完整的。 @@ -221,28 +213,28 @@ make: 警告:检测到时钟错误。您的创建可能是不完整的。
221 Determining if the CXX compiler works passed with the following output: 213 Determining if the CXX compiler works passed with the following output:
222 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 214 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
223 215
224 -Run Build Command:"/usr/bin/make" "cmTC_11296/fast"  
225 -/usr/bin/make -f CMakeFiles/cmTC_11296.dir/build.make CMakeFiles/cmTC_11296.dir/build 216 +Run Build Command:"/usr/bin/make" "cmTC_f41e1/fast"
  217 +/usr/bin/make -f CMakeFiles/cmTC_f41e1.dir/build.make CMakeFiles/cmTC_f41e1.dir/build
226 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 218 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
227 -Building CXX object CMakeFiles/cmTC_11296.dir/testCXXCompiler.cxx.o  
228 -/usr/bin/c++ -o CMakeFiles/cmTC_11296.dir/testCXXCompiler.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx  
229 -Linking CXX executable cmTC_11296  
230 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_11296.dir/link.txt --verbose=1  
231 -/usr/bin/c++ CMakeFiles/cmTC_11296.dir/testCXXCompiler.cxx.o -o cmTC_11296 -rdynamic 219 +Building CXX object CMakeFiles/cmTC_f41e1.dir/testCXXCompiler.cxx.o
  220 +/usr/bin/c++ -o CMakeFiles/cmTC_f41e1.dir/testCXXCompiler.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
  221 +Linking CXX executable cmTC_f41e1
  222 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f41e1.dir/link.txt --verbose=1
  223 +/usr/bin/c++ CMakeFiles/cmTC_f41e1.dir/testCXXCompiler.cxx.o -o cmTC_f41e1 -rdynamic
232 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 224 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
233 225
234 226
235 Detecting CXX compiler ABI info compiled with the following output: 227 Detecting CXX compiler ABI info compiled with the following output:
236 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 228 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
237 229
238 -Run Build Command:"/usr/bin/make" "cmTC_716a2/fast"  
239 -/usr/bin/make -f CMakeFiles/cmTC_716a2.dir/build.make CMakeFiles/cmTC_716a2.dir/build 230 +Run Build Command:"/usr/bin/make" "cmTC_8f2d1/fast"
  231 +/usr/bin/make -f CMakeFiles/cmTC_8f2d1.dir/build.make CMakeFiles/cmTC_8f2d1.dir/build
240 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 232 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
241 -Building CXX object CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o  
242 -/usr/bin/c++ -o CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp  
243 -Linking CXX executable cmTC_716a2  
244 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_716a2.dir/link.txt --verbose=1  
245 -/usr/bin/c++ -v CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_716a2 -rdynamic 233 +Building CXX object CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o
  234 +/usr/bin/c++ -o CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
  235 +Linking CXX executable cmTC_8f2d1
  236 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8f2d1.dir/link.txt --verbose=1
  237 +/usr/bin/c++ -v CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8f2d1 -rdynamic
246 Using built-in specs. 238 Using built-in specs.
247 COLLECT_GCC=/usr/bin/c++ 239 COLLECT_GCC=/usr/bin/c++
248 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper 240 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
@@ -252,8 +244,8 @@ Thread model: posix @@ -252,8 +244,8 @@ Thread model: posix
252 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 244 gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
253 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/ 245 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/
254 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/ 246 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/
255 -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_716a2' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'  
256 - /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/cchAFKsB.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_716a2 /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_716a2.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 247 +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8f2d1' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
  248 + /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/ccgdzjsR.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_8f2d1 /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_8f2d1.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
257 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 249 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
258 250
259 251
@@ -261,14 +253,14 @@ Parsed CXX implicit link information from above output: @@ -261,14 +253,14 @@ Parsed CXX implicit link information from above output:
261 link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] 253 link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
262 ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp] 254 ignore line: [Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp]
263 ignore line: [] 255 ignore line: []
264 - ignore line: [Run Build Command:"/usr/bin/make" "cmTC_716a2/fast"]  
265 - ignore line: [/usr/bin/make -f CMakeFiles/cmTC_716a2.dir/build.make CMakeFiles/cmTC_716a2.dir/build] 256 + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_8f2d1/fast"]
  257 + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_8f2d1.dir/build.make CMakeFiles/cmTC_8f2d1.dir/build]
266 ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'] 258 ignore line: [make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp']
267 - ignore line: [Building CXX object CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o]  
268 - ignore line: [/usr/bin/c++ -o CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp]  
269 - ignore line: [Linking CXX executable cmTC_716a2]  
270 - ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_716a2.dir/link.txt --verbose=1]  
271 - ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_716a2 -rdynamic ] 259 + ignore line: [Building CXX object CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o]
  260 + ignore line: [/usr/bin/c++ -o CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp]
  261 + ignore line: [Linking CXX executable cmTC_8f2d1]
  262 + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8f2d1.dir/link.txt --verbose=1]
  263 + ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8f2d1 -rdynamic ]
272 ignore line: [Using built-in specs.] 264 ignore line: [Using built-in specs.]
273 ignore line: [COLLECT_GCC=/usr/bin/c++] 265 ignore line: [COLLECT_GCC=/usr/bin/c++]
274 ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] 266 ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper]
@@ -278,13 +270,13 @@ Parsed CXX implicit link information from above output: @@ -278,13 +270,13 @@ Parsed CXX implicit link information from above output:
278 ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ] 270 ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) ]
279 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/] 271 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/]
280 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/] 272 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/]
281 - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_716a2' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64']  
282 - 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/cchAFKsB.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_716a2 /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_716a2.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] 273 + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_8f2d1' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
  274 + 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/ccgdzjsR.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_8f2d1 /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_8f2d1.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]
283 arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore 275 arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore
284 arg [-plugin] ==> ignore 276 arg [-plugin] ==> ignore
285 arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore 277 arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore
286 arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore 278 arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore
287 - arg [-plugin-opt=-fresolution=/tmp/cchAFKsB.res] ==> ignore 279 + arg [-plugin-opt=-fresolution=/tmp/ccgdzjsR.res] ==> ignore
288 arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore 280 arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
289 arg [-plugin-opt=-pass-through=-lgcc] ==> ignore 281 arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
290 arg [-plugin-opt=-pass-through=-lc] ==> ignore 282 arg [-plugin-opt=-pass-through=-lc] ==> ignore
@@ -302,7 +294,7 @@ Parsed CXX implicit link information from above output: @@ -302,7 +294,7 @@ Parsed CXX implicit link information from above output:
302 arg [/lib64/ld-linux-x86-64.so.2] ==> ignore 294 arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
303 arg [-zrelro] ==> ignore 295 arg [-zrelro] ==> ignore
304 arg [-o] ==> ignore 296 arg [-o] ==> ignore
305 - arg [cmTC_716a2] ==> ignore 297 + arg [cmTC_8f2d1] ==> ignore
306 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore 298 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore
307 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore 299 arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore
308 arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore 300 arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore
@@ -314,7 +306,7 @@ Parsed CXX implicit link information from above output: @@ -314,7 +306,7 @@ Parsed CXX implicit link information from above output:
314 arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] 306 arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
315 arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] 307 arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
316 arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] 308 arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..]
317 - arg [CMakeFiles/cmTC_716a2.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore 309 + arg [CMakeFiles/cmTC_8f2d1.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
318 arg [-lstdc++] ==> lib [stdc++] 310 arg [-lstdc++] ==> lib [stdc++]
319 arg [-lm] ==> lib [m] 311 arg [-lm] ==> lib [m]
320 arg [-lgcc_s] ==> lib [gcc_s] 312 arg [-lgcc_s] ==> lib [gcc_s]
@@ -346,14 +338,14 @@ Parsed CXX implicit link information from above output: @@ -346,14 +338,14 @@ Parsed CXX implicit link information from above output:
346 Detecting CXX [-std=c++14] compiler features compiled with the following output: 338 Detecting CXX [-std=c++14] compiler features compiled with the following output:
347 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 339 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
348 340
349 -Run Build Command:"/usr/bin/make" "cmTC_27bcf/fast"  
350 -/usr/bin/make -f CMakeFiles/cmTC_27bcf.dir/build.make CMakeFiles/cmTC_27bcf.dir/build 341 +Run Build Command:"/usr/bin/make" "cmTC_84ac0/fast"
  342 +/usr/bin/make -f CMakeFiles/cmTC_84ac0.dir/build.make CMakeFiles/cmTC_84ac0.dir/build
351 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 343 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
352 -Building CXX object CMakeFiles/cmTC_27bcf.dir/feature_tests.cxx.o  
353 -/usr/bin/c++ -std=c++14 -o CMakeFiles/cmTC_27bcf.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx  
354 -Linking CXX executable cmTC_27bcf  
355 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_27bcf.dir/link.txt --verbose=1  
356 -/usr/bin/c++ CMakeFiles/cmTC_27bcf.dir/feature_tests.cxx.o -o cmTC_27bcf -rdynamic 344 +Building CXX object CMakeFiles/cmTC_84ac0.dir/feature_tests.cxx.o
  345 +/usr/bin/c++ -std=c++14 -o CMakeFiles/cmTC_84ac0.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx
  346 +Linking CXX executable cmTC_84ac0
  347 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_84ac0.dir/link.txt --verbose=1
  348 +/usr/bin/c++ CMakeFiles/cmTC_84ac0.dir/feature_tests.cxx.o -o cmTC_84ac0 -rdynamic
357 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 349 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
358 350
359 351
@@ -419,14 +411,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_ @@ -419,14 +411,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_
419 Detecting CXX [-std=c++11] compiler features compiled with the following output: 411 Detecting CXX [-std=c++11] compiler features compiled with the following output:
420 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 412 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
421 413
422 -Run Build Command:"/usr/bin/make" "cmTC_3096b/fast"  
423 -/usr/bin/make -f CMakeFiles/cmTC_3096b.dir/build.make CMakeFiles/cmTC_3096b.dir/build 414 +Run Build Command:"/usr/bin/make" "cmTC_2910d/fast"
  415 +/usr/bin/make -f CMakeFiles/cmTC_2910d.dir/build.make CMakeFiles/cmTC_2910d.dir/build
424 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 416 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
425 -Building CXX object CMakeFiles/cmTC_3096b.dir/feature_tests.cxx.o  
426 -/usr/bin/c++ -std=c++11 -o CMakeFiles/cmTC_3096b.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx  
427 -Linking CXX executable cmTC_3096b  
428 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3096b.dir/link.txt --verbose=1  
429 -/usr/bin/c++ CMakeFiles/cmTC_3096b.dir/feature_tests.cxx.o -o cmTC_3096b -rdynamic 417 +Building CXX object CMakeFiles/cmTC_2910d.dir/feature_tests.cxx.o
  418 +/usr/bin/c++ -std=c++11 -o CMakeFiles/cmTC_2910d.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx
  419 +Linking CXX executable cmTC_2910d
  420 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2910d.dir/link.txt --verbose=1
  421 +/usr/bin/c++ CMakeFiles/cmTC_2910d.dir/feature_tests.cxx.o -o cmTC_2910d -rdynamic
430 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 422 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
431 423
432 424
@@ -492,14 +484,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_ @@ -492,14 +484,14 @@ make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_
492 Detecting CXX [-std=c++98] compiler features compiled with the following output: 484 Detecting CXX [-std=c++98] compiler features compiled with the following output:
493 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp 485 Change Dir: /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp
494 486
495 -Run Build Command:"/usr/bin/make" "cmTC_ef2a5/fast"  
496 -/usr/bin/make -f CMakeFiles/cmTC_ef2a5.dir/build.make CMakeFiles/cmTC_ef2a5.dir/build 487 +Run Build Command:"/usr/bin/make" "cmTC_7bf51/fast"
  488 +/usr/bin/make -f CMakeFiles/cmTC_7bf51.dir/build.make CMakeFiles/cmTC_7bf51.dir/build
497 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 489 make[1]: Entering directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
498 -Building CXX object CMakeFiles/cmTC_ef2a5.dir/feature_tests.cxx.o  
499 -/usr/bin/c++ -std=c++98 -o CMakeFiles/cmTC_ef2a5.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx  
500 -Linking CXX executable cmTC_ef2a5  
501 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef2a5.dir/link.txt --verbose=1  
502 -/usr/bin/c++ CMakeFiles/cmTC_ef2a5.dir/feature_tests.cxx.o -o cmTC_ef2a5 -rdynamic 490 +Building CXX object CMakeFiles/cmTC_7bf51.dir/feature_tests.cxx.o
  491 +/usr/bin/c++ -std=c++98 -o CMakeFiles/cmTC_7bf51.dir/feature_tests.cxx.o -c /mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/feature_tests.cxx
  492 +Linking CXX executable cmTC_7bf51
  493 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7bf51.dir/link.txt --verbose=1
  494 +/usr/bin/c++ CMakeFiles/cmTC_7bf51.dir/feature_tests.cxx.o -o cmTC_7bf51 -rdynamic
503 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp' 495 make[1]: Leaving directory '/mnt/hgfs/share/JZSDK_Linux/project_build/Attention_提示程序/build/CMakeFiles/CMakeTmp'
504 496
505 497
@@ -1546,7 +1546,7 @@ bool DjiTest_CameraIsInited(void) @@ -1546,7 +1546,7 @@ bool DjiTest_CameraIsInited(void)
1546 1546
1547 //手动添加 by ookk303 1547 //手动添加 by ookk303
1548 // 0空闲中 1录像中 2单拍中 3连拍中 4转码中 1548 // 0空闲中 1录像中 2单拍中 3连拍中 4转码中
1549 -int DJI_CamEmu_base_CameraTransLock(int flag) 1549 +T_JZsdkReturnCode DJI_CamEmu_base_CameraTransLock(int flag)
1550 { 1550 {
1551 switch (flag) 1551 switch (flag)
1552 { 1552 {
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
30 /* Includes ------------------------------------------------------------------*/ 30 /* Includes ------------------------------------------------------------------*/
31 #include "dji_typedef.h" 31 #include "dji_typedef.h"
32 #include "dji_payload_camera.h" 32 #include "dji_payload_camera.h"
  33 +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"
33 34
34 #ifdef __cplusplus 35 #ifdef __cplusplus
35 extern "C" { 36 extern "C" {
@@ -46,7 +47,7 @@ T_DjiReturnCode DjiTest_CameraGetOpticalZoomFactor(dji_f32_t *factor); @@ -46,7 +47,7 @@ T_DjiReturnCode DjiTest_CameraGetOpticalZoomFactor(dji_f32_t *factor);
46 T_DjiReturnCode DjiTest_CameraGetMode(E_DjiCameraMode *mode); 47 T_DjiReturnCode DjiTest_CameraGetMode(E_DjiCameraMode *mode);
47 T_DjiReturnCode DjiTest_CameraGetVideoStreamType(E_DjiCameraVideoStreamType *type); 48 T_DjiReturnCode DjiTest_CameraGetVideoStreamType(E_DjiCameraVideoStreamType *type);
48 bool DjiTest_CameraIsInited(void); 49 bool DjiTest_CameraIsInited(void);
49 -int DJI_CamEmu_base_CameraTransLock(int flag); 50 +T_JZsdkReturnCode DJI_CamEmu_base_CameraTransLock(int flag);
50 51
51 #ifdef __cplusplus 52 #ifdef __cplusplus
52 } 53 }
@@ -259,11 +259,6 @@ T_DjiReturnCode DjiTest_WidgetStartService(void) @@ -259,11 +259,6 @@ T_DjiReturnCode DjiTest_WidgetStartService(void)
259 { 259 {
260 snprintf(curFileDirPath, WIDGET_DIR_PATH_LEN_MAX, "%s/en",WIDGET_FILE_DIR); 260 snprintf(curFileDirPath, WIDGET_DIR_PATH_LEN_MAX, "%s/en",WIDGET_FILE_DIR);
261 } 261 }
262 - // else  
263 - // {  
264 - // JZSDK_LOG_ERROR("控件加载错误");  
265 - // snprintf(curFileDirPath, WIDGET_DIR_PATH_LEN_MAX, "%s/cn",WIDGET_FILE_DIR);  
266 - // }  
267 262
268 //检查是否存在开启测试的文件 263 //检查是否存在开启测试的文件
269 if (JZsdk_check_file_exists("/root/ShakedownTest") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) 264 if (JZsdk_check_file_exists("/root/ShakedownTest") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
@@ -692,36 +687,34 @@ static T_JZsdkReturnCode Megphone_Widget(unsigned int index, unsigned int value) @@ -692,36 +687,34 @@ static T_JZsdkReturnCode Megphone_Widget(unsigned int index, unsigned int value)
692 break; 687 break;
693 } 688 }
694 689
695 -#ifdef GIMBAL_STATUS_ON  
696 -  
697 case 28://设置临时参数 690 case 28://设置临时参数
698 { 691 {
699 Temp_GimbalCompensation_Flag = value; 692 Temp_GimbalCompensation_Flag = value;
700 break; 693 break;
701 } 694 }
702 695
703 -  
704 case 29://设置云台补偿 696 case 29://设置云台补偿
705 { 697 {
706 if (Temp_GimbalCompensation_Flag == 0) 698 if (Temp_GimbalCompensation_Flag == 0)
707 { 699 {
708 - Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_LEFT, +5); 700 + JZSDK_WidgetMgMT_ConrtrolInputTask(JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_LEFT, +5);
709 } 701 }
710 else if (Temp_GimbalCompensation_Flag == 1) 702 else if (Temp_GimbalCompensation_Flag == 1)
711 { 703 {
712 - Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_LEFT, -5); 704 + JZSDK_WidgetMgMT_ConrtrolInputTask(JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_LEFT, -5);
713 } 705 }
714 else if (Temp_GimbalCompensation_Flag == 2) 706 else if (Temp_GimbalCompensation_Flag == 2)
715 { 707 {
716 - Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_RIGHT, +5); 708 + JZSDK_WidgetMgMT_ConrtrolInputTask(JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_RIGHT, +5);
717 } 709 }
718 else if (Temp_GimbalCompensation_Flag == 3) 710 else if (Temp_GimbalCompensation_Flag == 3)
719 { 711 {
720 - Gimbal_Set_SingleCompensation(JZ_SINGLE_COMPENSATION_MODE_PITCH_RIGHT, -5); 712 + JZSDK_WidgetMgMT_ConrtrolInputTask(JZSDK_WIDGET_GIMBAL_SINGLE_COMPENSATION_RIGHT, -5);
721 } 713 }
722 break; 714 break;
723 } 715 }
724 716
  717 +#ifdef GIMBAL_STATUS_ON
725 718
726 case 30://设置云台补偿 719 case 30://设置云台补偿
727 { 720 {
@@ -87,8 +87,9 @@ T_DjiReturnCode DjiTest_XPortStartService(void) @@ -87,8 +87,9 @@ T_DjiReturnCode DjiTest_XPortStartService(void)
87 } 87 }
88 88
89 limitAngle.upperLimit = 300; 89 limitAngle.upperLimit = 300;
90 - //limitAngle.lowerLimit = -1000;  
91 - limitAngle.lowerLimit = -350; 90 + //limitAngle.lowerLimit = -1000; //原本的下限角度
  91 + //limitAngle.lowerLimit = -350;
  92 + limitAngle.lowerLimit = -900;
92 djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE, limitAngle); 93 djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE, limitAngle);
93 if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { 94 if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
94 USER_LOG_ERROR("set pitch joint angle limit angle for XPort error: 0x%08llX.", djiStat); 95 USER_LOG_ERROR("set pitch joint angle limit angle for XPort error: 0x%08llX.", djiStat);
@@ -96,8 +97,9 @@ T_DjiReturnCode DjiTest_XPortStartService(void) @@ -96,8 +97,9 @@ T_DjiReturnCode DjiTest_XPortStartService(void)
96 } 97 }
97 98
98 limitAngle.upperLimit = 300; 99 limitAngle.upperLimit = 300;
99 - limitAngle.lowerLimit = -800; 100 + //limitAngle.lowerLimit = -800; //原版
100 //limitAngle.lowerLimit = -300; 101 //limitAngle.lowerLimit = -300;
  102 + limitAngle.lowerLimit = -900;
101 USER_LOG_INFO("Set euler angle limit of pitch axis, upperLimit %d, lowerLimit %d", limitAngle.upperLimit, limitAngle.lowerLimit); 103 USER_LOG_INFO("Set euler angle limit of pitch axis, upperLimit %d, lowerLimit %d", limitAngle.upperLimit, limitAngle.lowerLimit);
102 djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE, limitAngle); 104 djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE, limitAngle);
103 if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { 105 if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
@@ -120,20 +122,35 @@ T_DjiReturnCode DjiTest_XPortStartService(void) @@ -120,20 +122,35 @@ T_DjiReturnCode DjiTest_XPortStartService(void)
120 return djiStat; 122 return djiStat;
121 } 123 }
122 124
  125 + // //航向轴关节角
  126 + // if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) {
  127 + // limitAngle.upperLimit = 300;
  128 + // //limitAngle.lowerLimit = -900;
  129 + // limitAngle.lowerLimit = -300;
  130 + // } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2) {
  131 + // //limitAngle.upperLimit = 900;
  132 + // limitAngle.upperLimit = 300;
  133 + // limitAngle.lowerLimit = -300;
  134 + // } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {
  135 + // // limitAngle.upperLimit = 900;
  136 + // // limitAngle.lowerLimit = -900;
  137 + // limitAngle.upperLimit = 300;
  138 + // limitAngle.lowerLimit = -300;
  139 + // } else {
  140 + // USER_LOG_WARN("payload mount position is unknown.");
  141 + // return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
  142 + // }
  143 +
123 //航向轴关节角 144 //航向轴关节角
124 if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) { 145 if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) {
125 limitAngle.upperLimit = 300; 146 limitAngle.upperLimit = 300;
126 - //limitAngle.lowerLimit = -900;  
127 - limitAngle.lowerLimit = -300; 147 + limitAngle.lowerLimit = -900;
128 } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2) { 148 } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2) {
129 - //limitAngle.upperLimit = 900;  
130 - limitAngle.upperLimit = 300; 149 + limitAngle.upperLimit = 900;
131 limitAngle.lowerLimit = -300; 150 limitAngle.lowerLimit = -300;
132 } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) { 151 } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {
133 - // limitAngle.upperLimit = 900;  
134 - // limitAngle.lowerLimit = -900;  
135 - limitAngle.upperLimit = 300;  
136 - limitAngle.lowerLimit = -300; 152 + limitAngle.upperLimit = 900;
  153 + limitAngle.lowerLimit = -900;
137 } else { 154 } else {
138 USER_LOG_WARN("payload mount position is unknown."); 155 USER_LOG_WARN("payload mount position is unknown.");
139 return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR; 156 return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
1 -/**  
2 - ********************************************************************  
3 - * @file test_xport.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 -/* Includes ------------------------------------------------------------------*/  
27 -#include <dji_gimbal.h>  
28 -#include "test_payload_xport.h"  
29 -#include "dji_logger.h"  
30 -#include "dji_platform.h"  
31 -#include "utils/util_misc.h"  
32 -#include "dji_aircraft_info.h"  
33 -#include "camera_emu/test_payload_cam_emu_base.h"  
34 -  
35 -/* Private constants ---------------------------------------------------------*/  
36 -#define XPORT_TASK_FREQ (10)  
37 -#define XPORT_TASK_STACK_SIZE (2048)  
38 -  
39 -/* Private types -------------------------------------------------------------*/  
40 -  
41 -  
42 -/* Private functions declaration ---------------------------------------------*/  
43 -static void *UserXPort_Task(void *arg);  
44 -static T_DjiReturnCode ReceiveXPortSystemState(T_DjiGimbalSystemState systemState);  
45 -static T_DjiReturnCode ReceiveXPortAttitudeInformation(T_DjiGimbalAttitudeInformation attitudeInformation);  
46 -  
47 -/* Private variables ---------------------------------------------------------*/  
48 -static T_DjiTaskHandle s_userXPortThread;  
49 -static T_DjiMutexHandle s_userXPortMutex;  
50 -static T_DjiGimbalSystemState s_userXPortSystemState = {0};  
51 -static bool s_isUserXPortInited = false;  
52 -static bool s_isUserXPortSystemStateVaild = false;  
53 -  
54 -/* Exported functions definition ---------------------------------------------*/  
55 -T_DjiReturnCode DjiTest_XPortStartService(void)  
56 -{  
57 - T_DjiReturnCode djiStat;  
58 - T_DjiXPortLimitAngle limitAngle = {0};  
59 - T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo = {0};  
60 - T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();  
61 -  
62 - djiStat = DjiXPort_Init();  
63 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
64 - USER_LOG_ERROR("XPort init error: 0x%08llX.", djiStat);  
65 - return djiStat;  
66 - }  
67 -  
68 - s_isUserXPortInited = true;  
69 -  
70 - djiStat = osalHandler->MutexCreate(&s_userXPortMutex);  
71 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
72 - USER_LOG_ERROR("user XPort mutex create error: 0x%08llX.", djiStat);  
73 - return djiStat;  
74 - }  
75 -  
76 - djiStat = DjiXPort_RegReceiveSystemStateCallback(ReceiveXPortSystemState);  
77 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
78 - USER_LOG_ERROR("register receive XPort system state callback function error: 0x%08llX.", djiStat);  
79 - return djiStat;  
80 - }  
81 -  
82 - djiStat = DjiXPort_RegReceiveAttitudeInformationCallback(ReceiveXPortAttitudeInformation);  
83 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
84 - USER_LOG_ERROR("register receive XPort attitude information callback function error: 0x%08llX.",  
85 - djiStat);  
86 - return djiStat;  
87 - }  
88 -  
89 - limitAngle.upperLimit = 300;  
90 - //limitAngle.lowerLimit = -1000;  
91 - limitAngle.lowerLimit = -350;  
92 - djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE, limitAngle);  
93 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
94 - USER_LOG_ERROR("set pitch joint angle limit angle for XPort error: 0x%08llX.", djiStat);  
95 - return djiStat;  
96 - }  
97 -  
98 - limitAngle.upperLimit = 300;  
99 - limitAngle.lowerLimit = -800;  
100 - //limitAngle.lowerLimit = -300;  
101 - USER_LOG_INFO("Set euler angle limit of pitch axis, upperLimit %d, lowerLimit %d", limitAngle.upperLimit, limitAngle.lowerLimit);  
102 - djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE, limitAngle);  
103 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
104 - USER_LOG_ERROR("set pitch euler angle limit angle for XPort error: 0x%08llX.", djiStat);  
105 - return djiStat;  
106 - }  
107 -  
108 - limitAngle.upperLimit = 300;  
109 - limitAngle.lowerLimit = -1000;  
110 - USER_LOG_INFO("Set extended euler angle limit of pitch axis, upperLimit %d, lowerLimit %d", limitAngle.upperLimit, limitAngle.lowerLimit);  
111 - djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE_EXTENSION, limitAngle);  
112 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
113 - USER_LOG_ERROR("set pitch extension euler angle limit angle for XPort error: 0x%08llX.", djiStat);  
114 - return djiStat;  
115 - }  
116 -  
117 - djiStat = DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo);  
118 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
119 - USER_LOG_ERROR("get aircraft base information error: 0x%08llX.", djiStat);  
120 - return djiStat;  
121 - }  
122 -  
123 - //航向轴关节角  
124 - if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1) {  
125 - limitAngle.upperLimit = 300;  
126 - //limitAngle.lowerLimit = -900;  
127 - limitAngle.lowerLimit = -300;  
128 - } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2) {  
129 - //limitAngle.upperLimit = 900;  
130 - limitAngle.upperLimit = 300;  
131 - limitAngle.lowerLimit = -300;  
132 - } else if (aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {  
133 - // limitAngle.upperLimit = 900;  
134 - // limitAngle.lowerLimit = -900;  
135 - limitAngle.upperLimit = 300;  
136 - limitAngle.lowerLimit = -300;  
137 - } else {  
138 - USER_LOG_WARN("payload mount position is unknown.");  
139 - return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;  
140 - }  
141 -  
142 - djiStat = DjiXPort_SetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_YAW_JOINT_ANGLE, limitAngle);  
143 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
144 - USER_LOG_ERROR("set yaw joint angle limit angle for XPort error: 0x%08llX.", djiStat);  
145 - return djiStat;  
146 - }  
147 -  
148 - djiStat = DjiXPort_SetGimbalModeSync(DJI_GIMBAL_MODE_FREE);  
149 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
150 - USER_LOG_ERROR("set XPort gimbal mode error: 0x%08llX.", djiStat);  
151 - return djiStat;  
152 - }  
153 -  
154 - djiStat = DjiXPort_ResetSync(DJI_GIMBAL_RESET_MODE_PITCH_AND_YAW);  
155 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
156 - USER_LOG_ERROR("reset XPort gimbal error: 0x%08llX.", djiStat);  
157 - return djiStat;  
158 - }  
159 -  
160 - if (osalHandler->TaskCreate("user_xport_task", UserXPort_Task, XPORT_TASK_STACK_SIZE, NULL, &s_userXPortThread) !=  
161 - DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
162 - USER_LOG_ERROR("user XPort task create error.");  
163 - return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;  
164 - }  
165 -  
166 - return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
167 -}  
168 -  
169 -T_DjiReturnCode DjiTest_XPortDeInit(void)  
170 -{  
171 - T_DjiReturnCode djiStat;  
172 - T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();  
173 -  
174 - djiStat = osalHandler->TaskDestroy(s_userXPortThread);  
175 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
176 - USER_LOG_ERROR("Destroy test xport thread error: 0x%08llX.", djiStat);  
177 - return djiStat;  
178 - }  
179 -  
180 - djiStat = osalHandler->MutexDestroy(s_userXPortMutex);  
181 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
182 - USER_LOG_ERROR("Destroy test xport mutex error: 0x%08llX.", djiStat);  
183 - return djiStat;  
184 - }  
185 -  
186 - djiStat = DjiXPort_DeInit();  
187 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
188 - USER_LOG_ERROR("XPort de-init error: 0x%08llX.", djiStat);  
189 - return djiStat;  
190 - }  
191 -  
192 - s_isUserXPortInited = false;  
193 -  
194 - return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
195 -}  
196 -  
197 -T_DjiReturnCode DjiTest_XPortGetSystemState(T_DjiGimbalSystemState *systemState)  
198 -{  
199 - T_DjiReturnCode returnCode;  
200 - T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();  
201 -  
202 - if (s_isUserXPortInited != true || s_isUserXPortSystemStateVaild != true) {  
203 - USER_LOG_ERROR("user XPort has not inited.");  
204 - return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;  
205 - }  
206 -  
207 - returnCode = osalHandler->MutexLock(s_userXPortMutex);  
208 - if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
209 - USER_LOG_ERROR("user XPort mutex lock error: 0x%08llX.", returnCode);  
210 - return returnCode;  
211 - }  
212 -  
213 - memcpy(systemState, &s_userXPortSystemState, sizeof(T_DjiGimbalSystemState));  
214 -  
215 - returnCode = osalHandler->MutexUnlock(s_userXPortMutex);  
216 - if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
217 - USER_LOG_ERROR("user XPort mutex unlock error: 0x%08llX.", returnCode);  
218 - return returnCode;  
219 - }  
220 -  
221 - return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
222 -}  
223 -  
224 -/* Private functions definition-----------------------------------------------*/  
225 -#ifndef __CC_ARM  
226 -#pragma GCC diagnostic push  
227 -#pragma GCC diagnostic ignored "-Wmissing-noreturn"  
228 -#pragma GCC diagnostic ignored "-Wreturn-type"  
229 -#endif  
230 -  
231 -static void *UserXPort_Task(void *arg)  
232 -{  
233 - T_DjiReturnCode djiStat;  
234 - T_DjiXPortLimitAngle limitAngle = {0};  
235 - float opticalZoomFactor = 1.0f;  
236 - float digitalZoomFactor = 1.0f;  
237 - int step = 0;  
238 - T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();  
239 -  
240 - USER_UTIL_UNUSED(arg);  
241 -  
242 - while (1) {  
243 - osalHandler->TaskSleepMs(1000 / XPORT_TASK_FREQ);  
244 - step++;  
245 -  
246 - if (USER_UTIL_IS_WORK_TURN(step, 1, XPORT_TASK_FREQ)) {  
247 - djiStat = DjiXPort_GetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_ROLL_JOINT_ANGLE, &limitAngle);  
248 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
249 - USER_LOG_ERROR("get roll joint angle limit angle from XPort error: 0x%08llX.", djiStat);  
250 - continue;  
251 - }  
252 -  
253 - USER_LOG_DEBUG("roll joint angle limit angle of XPort: upper limit %d, lower limit %d.",  
254 - limitAngle.upperLimit, limitAngle.lowerLimit);  
255 -  
256 - djiStat = DjiXPort_GetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_JOINT_ANGLE, &limitAngle);  
257 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
258 - USER_LOG_ERROR("get pitch joint angle limit angle from XPort error: 0x%08llX.", djiStat);  
259 - continue;  
260 - }  
261 -  
262 - USER_LOG_DEBUG("pitch joint angle limit angle of XPort: upper limit %d, lower limit %d.",  
263 - limitAngle.upperLimit, limitAngle.lowerLimit);  
264 -  
265 - djiStat = DjiXPort_GetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE, &limitAngle);  
266 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
267 - USER_LOG_ERROR("get pitch euler angle limit angle from XPort error: 0x%08llX.", djiStat);  
268 - continue;  
269 - }  
270 -  
271 - USER_LOG_DEBUG("pitch euler angle limit angle of XPort: upper limit %d, lower limit %d.",  
272 - limitAngle.upperLimit, limitAngle.lowerLimit);  
273 -  
274 - djiStat = DjiXPort_GetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_PITCH_EULER_ANGLE_EXTENSION,  
275 - &limitAngle);  
276 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
277 - USER_LOG_ERROR("get pitch extension euler angle limit angle from XPort error: 0x%08llX.",  
278 - djiStat);  
279 - continue;  
280 - }  
281 -  
282 - USER_LOG_DEBUG("pitch extension euler angle limit angle of XPort: upper limit %d, lower limit %d.",  
283 - limitAngle.upperLimit, limitAngle.lowerLimit);  
284 -  
285 - djiStat = DjiXPort_GetLimitAngleSync(DJI_XPORT_LIMIT_ANGLE_CATEGORY_YAW_JOINT_ANGLE, &limitAngle);  
286 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
287 - USER_LOG_ERROR("get yaw joint angle limit angle from XPort error: 0x%08llX.", djiStat);  
288 - continue;  
289 - }  
290 -  
291 - USER_LOG_DEBUG("yaw joint angle limit angle of XPort: upper limit %d, lower limit %d.",  
292 - limitAngle.upperLimit, limitAngle.lowerLimit);  
293 - }  
294 -  
295 - if (USER_UTIL_IS_WORK_TURN(step, 10, XPORT_TASK_FREQ)) {  
296 - if (DjiTest_CameraIsInited()) {  
297 - djiStat = DjiTest_CameraGetOpticalZoomFactor(&opticalZoomFactor);  
298 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
299 - USER_LOG_ERROR("get camera optical zoom factor error: %d.", djiStat);  
300 - continue;  
301 - }  
302 -  
303 - djiStat = DjiTest_CameraGetDigitalZoomFactor(&digitalZoomFactor);  
304 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
305 - USER_LOG_ERROR("get camera digital zoom factor error: %d.", djiStat);  
306 - continue;  
307 - }  
308 -  
309 - djiStat = DjiXPort_SetSpeedConversionFactor(1 / (opticalZoomFactor * digitalZoomFactor));  
310 - if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
311 - USER_LOG_ERROR("set speed conversion factor error: %d.", djiStat);  
312 - continue;  
313 - }  
314 - }  
315 - }  
316 - }  
317 -}  
318 -  
319 -#ifndef __CC_ARM  
320 -#pragma GCC diagnostic pop  
321 -#endif  
322 -  
323 -static T_DjiReturnCode ReceiveXPortSystemState(T_DjiGimbalSystemState systemState)  
324 -{  
325 - T_DjiReturnCode returnCode;  
326 - T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();  
327 -  
328 - returnCode = osalHandler->MutexLock(s_userXPortMutex);  
329 - if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
330 - USER_LOG_ERROR("user XPort mutex lock error: 0x%08llX.", returnCode);  
331 - return returnCode;  
332 - }  
333 -  
334 - s_isUserXPortSystemStateVaild = true;  
335 - memcpy(&s_userXPortSystemState, &systemState, sizeof(T_DjiGimbalSystemState));  
336 -  
337 - returnCode = osalHandler->MutexUnlock(s_userXPortMutex);  
338 - if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
339 - USER_LOG_ERROR("user XPort mutex unlock error: 0x%08llX.", returnCode);  
340 - return returnCode;  
341 - }  
342 -  
343 - USER_LOG_DEBUG("receive XPort system state: mounted upward flag %d, gimbal mode %d.",  
344 - systemState.mountedUpward, systemState.gimbalMode);  
345 -  
346 - USER_LOG_DEBUG("XPort fine tune: %d %d %d.", systemState.fineTuneAngle.pitch,  
347 - systemState.fineTuneAngle.roll, systemState.fineTuneAngle.yaw);  
348 -  
349 - return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
350 -}  
351 -  
352 -static T_DjiReturnCode ReceiveXPortAttitudeInformation(T_DjiGimbalAttitudeInformation attitudeInformation)  
353 -{  
354 - USER_LOG_DEBUG("receive XPort attitude information:");  
355 - USER_LOG_DEBUG("XPort attitude: pitch %d, roll %d, yaw %d.", attitudeInformation.attitude.pitch,  
356 - attitudeInformation.attitude.roll, attitudeInformation.attitude.yaw);  
357 -  
358 - return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
359 -}  
360 -  
361 -/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/  
@@ -69,10 +69,12 @@ extern "C" { @@ -69,10 +69,12 @@ extern "C" {
69 69
70 #if (DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_U3|| DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30) 70 #if (DEVICE_VERSION == JZ_H1T || DEVICE_VERSION == JZ_H1E || DEVICE_VERSION == JZ_U3|| DEVICE_VERSION == JZ_U3S || DEVICE_VERSION == JZ_U3D || DEVICE_VERSION == JZ_U30)
71 #define USER_BAUD_RATE "921600" 71 #define USER_BAUD_RATE "921600"
72 - #elif (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T || DEVICE_VERSION == JZ_H10 || DEVICE_VERSION == JZ_C1 || DEVICE_VERSION == JZ_ST) 72 + #elif (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T || DEVICE_VERSION == JZ_H10 || DEVICE_VERSION == JZ_C1 || DEVICE_VERSION == JZ_ST || DEVICE_VERSION == JZ_H150A)
73 #define USER_BAUD_RATE "230400" 73 #define USER_BAUD_RATE "230400"
74 #elif (DEVICE_VERSION == JZ_H10T) 74 #elif (DEVICE_VERSION == JZ_H10T)
75 #define USER_BAUD_RATE "115200" 75 #define USER_BAUD_RATE "115200"
  76 + #else
  77 + #define USER_BAUD_RATE "115200"
76 #endif 78 #endif
77 79
78 #endif 80 #endif
@@ -45,8 +45,7 @@ extern "C" { @@ -45,8 +45,7 @@ extern "C" {
45 * */ 45 * */
46 46
47 #if (DEVICE_VERSION == JZ_H150S) || (DEVICE_VERSION == JZ_H150T) || (DEVICE_VERSION == JZ_C1) || (DEVICE_VERSION == JZ_ST) 47 #if (DEVICE_VERSION == JZ_H150S) || (DEVICE_VERSION == JZ_H150T) || (DEVICE_VERSION == JZ_C1) || (DEVICE_VERSION == JZ_ST)
48 - //#define CONFIG_HARDWARE_CONNECTION DJI_USE_UART_AND_NETWORK_DEVICE  
49 - #define CONFIG_HARDWARE_CONNECTION DJI_USE_ONLY_NETWORK 48 + #define CONFIG_HARDWARE_CONNECTION DJI_USE_UART_AND_NETWORK_DEVICE
50 #elif (DEVICE_VERSION == JZ_U3 && ALLWINNER_CEDAR == VERSION_SWITCH_ON) 49 #elif (DEVICE_VERSION == JZ_U3 && ALLWINNER_CEDAR == VERSION_SWITCH_ON)
51 #define CONFIG_HARDWARE_CONNECTION DJI_USE_UART_AND_NETWORK_DEVICE 50 #define CONFIG_HARDWARE_CONNECTION DJI_USE_UART_AND_NETWORK_DEVICE
52 // #elif (DEVICE_VERSION == JZ_H10 && SPECIAL_VERSION == SPECIAL_H10_M300) 51 // #elif (DEVICE_VERSION == JZ_H10 && SPECIAL_VERSION == SPECIAL_H10_M300)
@@ -193,6 +193,9 @@ int main(int argc, char *argv[]) @@ -193,6 +193,9 @@ int main(int argc, char *argv[])
193 193
194 USER_LOG_INFO("DjiAircraftInfo_GetBaseInfo"); 194 USER_LOG_INFO("DjiAircraftInfo_GetBaseInfo");
195 195
  196 + //设置飞机信息
  197 + JZsdk_PlaneInfo_Set((E_JZ_SPECIAL_PLANE_INFO)(aircraftInfoBaseInfo.aircraftType));
  198 +
196 //m30和m30t有滤波锁 199 //m30和m30t有滤波锁
197 if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T) 200 if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T)
198 { 201 {
@@ -300,6 +303,14 @@ int main(int argc, char *argv[]) @@ -300,6 +303,14 @@ int main(int argc, char *argv[])
300 { 303 {
301 memcpy(psdk_name, "U340_OGI", sizeof("U340_OGI")); 304 memcpy(psdk_name, "U340_OGI", sizeof("U340_OGI"));
302 } 305 }
  306 + else if (DEVICE_VERSION == JZ_T40)
  307 + {
  308 + memcpy(psdk_name, "JZ_T40", sizeof("JZ_T40"));
  309 + }
  310 + else if (DEVICE_VERSION == JZ_H150A)
  311 + {
  312 + memcpy(psdk_name, "JZ_H150A", sizeof("JZ_H150A"));
  313 + }
303 else 314 else
304 { 315 {
305 memcpy(psdk_name, "测试型号", sizeof("测试型号")); 316 memcpy(psdk_name, "测试型号", sizeof("测试型号"));
@@ -793,6 +804,13 @@ static T_DjiReturnCode DjiUser_PrepareSystemEnvironment(void) @@ -793,6 +804,13 @@ static T_DjiReturnCode DjiUser_PrepareSystemEnvironment(void)
793 return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR; 804 return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
794 } 805 }
795 806
  807 + //Attention: if you want to use camera stream view function, please uncomment it.
  808 + returnCode = DjiPlatform_RegSocketHandler(&socketHandler);
  809 + if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
  810 + printf("register osal socket handler error");
  811 + return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
  812 + }
  813 +
796 #endif 814 #endif
797 815
798 returnCode = DjiPlatform_RegFileSystemHandler(&fileSystemHandler); 816 returnCode = DjiPlatform_RegFileSystemHandler(&fileSystemHandler);
  1 +# Ziyan Payload SDK (PSDK)
  2 +
  3 +
  4 +
  5 +## What is the Ziyan Payload SDK?
  6 +
  7 +The ziyan Payload SDK(PSDK), is a development kit provided by ziyan to support developers to develop payload that can be mounted on ziyan aircraft. developers can obtain the information or other resource from the aircraft. According to the software logic and algorithm framework designed by the developer, users could develop payload that can be mounted on ziyan aircraft, to perform actions they need, such as Automated Flight Controller, Payload Controller, Video Image Analysis Platform, Mapping Camera, Megaphone And Searchlight, etc.
  8 +
  9 +
  10 +
  11 +## Latest Release
  12 +
  13 +The latest release version of PSDK is 1.0.0.0 This version of Payload SDK mainly first release. Please refer to the release notes for detailed changes list.
  14 +
  15 +## License
  16 +
  17 +Payload SDK codebase is MIT-licensed. Please refer to the LICENSE file for detailed information.
  1 +# Ziyan Payload SDK Release Log
  2 +
  3 +## V1.1.1.0-20250721-Release
  4 +**[Note]**:
  5 +* Refactored the camera range finder handler and separated it into an independent interface.
  6 +* Introduced a new camera API to support the camera tracker.
  7 +* Resolved several known issues.
  8 +
  9 +**[Added]**:
  10 +* Added support for the camera tracker feature. Introduced new APIs for controlling the camera tracker integrated with the payload camera, and exposed additional tracking status feedback data.
  11 +* Separated the camera range finder into a dedicated interface to improve modularity.
  12 +
  13 +**[Optimized]**:
  14 +* Optimized the video streaming transmission mechanism for improved efficiency and stability.
  15 +* Enhanced core task monitoring by periodically reporting tasks with abnormal execution time, ensuring stable and reliable system behavior.
  16 +
  17 +**[Fixed]**:
  18 +* Fixed an issue where the widget module ignored items with an index greater than 256.
  19 +----
  20 +
  21 +
  22 +
  23 +
  24 +## V1.1.0.0-20250620-Release
  25 +**[Note]**:
  26 +* Introduced a new self-checking mechanism.
  27 +* Fixed several known issues.
  28 +
  29 +**[Added]**:
  30 +* Added support for the self-checking mechanism. Users will now be prompted to update their PSPK version in the event of communication or version mismatches.
  31 +* Added support for the I2C communication protocol.
  32 +
  33 +**[Optimized]**:
  34 +* Optimized the widget configuration file loading method. UAVs can now load configuration files dynamically.
  35 +* Optimized the speaker module to improve real-time speaker and TTS (text-to-speech) transmission logic.
  36 +* Refined the core initialization logic.
  37 +
  38 +**[Fixed]**:
  39 +* Fixed an issue where the widget module occasionally failed to load the configuration file, causing the Ziyan app to not display payload widget information.
  40 +* Fixed an issue where log timestamps were displayed abnormally.
  41 +---
  42 +
  43 +
  44 +
  45 +
  46 +## V1.0.0.4-20250603-Release
  47 +**[Note]**:
  48 +* Added new module.
  49 +* Fixed some known issues.
  50 +
  51 +**[Added]**:
  52 +* Add support for the speaker module.
  53 +
  54 +**[Optimized]**:
  55 +* Optimize the core initialization process and provide more log information to support developers in quickly identifying the cause of exceptions during the adaptation process.
  56 +
  57 +**[Fixed]**:
  58 +* Fix issues that may cause abnormal program termination in specific communication scenarios.
  59 +* Fix the issue of strong coupling between the sample program and the system environment
  60 +---
  61 +
  62 +
  63 +
  64 +
  65 +## V1.0.0.3-20250429-Release
  66 +**[Note]**:
  67 +To support more camera expansion features, Add new camera API. Fixed some known issues.
  68 +
  69 +**[Added]**:
  70 +* Adjust the feedback frequency of the camera status, support the remote control to refresh data at a higher frequency, and ensure real-time display.
  71 +* Add diverse debugging options
  72 +
  73 +**[Fixed]**:
  74 +* Fix the dependency of the sample program and run the samples based on the computer system environment where they were compiled.
  75 +---
  76 +
  77 +
  78 +
  79 +
  80 +## V1.0.0.2-20250401-Release
  81 +**[Note]**:
  82 +To support more camera expansion features, Add new camera API. Fixed some known issues.
  83 +
  84 +**[Added]**:
  85 +* Add API which used to get obtain camera calculation position.
  86 +* Add API which used to control the camera tracker integrated into the payload camera.
  87 +
  88 +**[Fixed]**:
  89 +* Fix the issue that the camera status is not updated when the camera has connected.
  90 +* Fix occasional screen distortion in camera videos
  91 +---
  92 +
  93 +
  94 +
  95 +
  96 +## V1.0.0.1-20250310-Release
  97 +**[Note]**:
  98 +To support more camera expansion features, Add new camera API. Fixed some known issues.
  99 +
  100 +**[Added]**:
  101 +* Add API which used to control the range finder integrated into the payload camera.
  102 +---
  103 +
  104 +
  105 +
  106 +
  107 +## V1.0.0.0-20250306-Release
  108 +**[Note]**:
  109 +This version of Payload SDK mainly first release. Please refer to the release notes for detailed changes list.
  110 +
  111 +**[Added]**:
  112 +* Added support for gimbal functionality
  113 +* Added support for basic camera functionality
  114 +* Added support for widget functionality
  115 +* Added support for subscription functionality
  116 +---
  117 +
  118 +
  119 +
  120 +
  121 +
  122 +
@@ -182,12 +182,42 @@ typedef struct { @@ -182,12 +182,42 @@ typedef struct {
182 } T_ZiyanCameraSystemState; 182 } T_ZiyanCameraSystemState;
183 183
184 /** 184 /**
  185 + * @brief Camera tracking target state.
  186 + */
  187 +typedef enum {
  188 + ZIYAN_CAMERA_TRACKING_TARGET_STATUS_READY = 0,
  189 + ZIYAN_CAMERA_TRACKING_TARGET_STATUS_FAILED = 1,
  190 + ZIYAN_CAMERA_TRACKING_TARGET_STATUS_TRACKING = 2,
  191 + ZIYAN_CAMERA_TRACKING_TARGET_STATUS_LOST = 3,
  192 +} E_ZiyanCameraTrackingTargetState;
  193 +/**
185 * @brief Camera tracking state. 194 * @brief Camera tracking state.
186 */ 195 */
187 typedef struct { 196 typedef struct {
188 - bool isTraking; /*!< Specifies if the camera is in tracking status. This parameter is boolean type. */  
189 - T_ZiyanCameraPointInScreen targetPoint;  
190 - T_ZiyanLocation targetLocation; 197 + E_ZiyanCameraTrackingTargetState status; /*!< Specifies track the status of the target, #E_ZiyanCameraTrackingTargetState. */
  198 + float startX; /*!< Specifies the ratio of the x-coordinate of the starting point to the maximum horizontal pixel, This parameter is float type. */
  199 + float startY; /*!< Specifies the ratio of the y-coordinate of the starting point to the maximum vertical pixel, This parameter is float type. */
  200 + float endX; /*!< Specifies the ratio of the x-coordinate of the endpoint to the maximum horizontal pixel, This parameter is float type. */
  201 + float endY; /*!< Specifies the ratio of the y-coordinate of the endpoint to the maximum vertical pixel, This parameter is float type. */
  202 + float centerX;/*!< Specifies the x-coordinate of the center point of the tracked target, This parameter is float type. */
  203 + float centerY;/*!< Specifies the y-coordinate of the center point of the tracked target, This parameter is float type. */
  204 + double longitude; /*!< Specifies track the longitude of the center of the target object, This parameter is double type. */
  205 + double latitude; /*!< Specifies track the latitude of the center of the target object, This parameter is double type. */
  206 + double altitude; /*!< Specifies track the altitude of the center of the target object, This parameter is double type. unit: m*/
  207 + float coorN; /*!< Specifies tracking the northbound velocity of the target object center in the WGS-84 coordinate system, This parameter is float type. */
  208 + float coorE; /*!< Specifies tracking the eastward velocity of the center of the target object in the WGS-84 coordinate system, This parameter is float type. */
  209 + float coorD; /*!< Specifies tracking the radial velocity of the center of the target object in the WGS-84 coordinate system, This parameter is float type. */
  210 + float bodyX; /*!< Specifies tracking the velocity of the center of the target object in the x-axis direction of the body coordinates, This parameter is float type. */
  211 + float bodyY; /*!< Specifies tracking the velocity of the center of the target object in the y-axis direction of the body coordinates, This parameter is float type. */
  212 + float bodyZ; /*!< Specifies tracking the velocity of the center of the target object in the z-axis direction of the body coordinates, This parameter is float type. */
  213 + char targetName[17]; /*!< Specifies target recognition name for tracking, This parameter is string type. */
  214 + int confidence; /*!< Specifies confidence level of tracked targets, This parameter is int type. */
  215 + char targetType[17]; /*!< Specifies the type name of the tracked target, This parameter is string type. */
  216 +
  217 + /* The following variables will be deprecated! */
  218 + bool isTraking; /*!< Deprecated! Specifies if the camera is in tracking status. This parameter is boolean type. */
  219 + T_ZiyanCameraPointInScreen targetPoint; /*!< Deprecated! */
  220 + T_ZiyanLocation targetLocation; /*!< Deprecated! */
191 } T_ZiyanCameraTrackState; 221 } T_ZiyanCameraTrackState;
192 222
193 /** 223 /**
@@ -736,7 +766,7 @@ typedef struct { @@ -736,7 +766,7 @@ typedef struct {
736 766
737 767
738 /** 768 /**
739 - * @brief Prototype of handler functions for Extend function. 769 + * @brief Prototype of handler functions for Range finder function.
740 * @note User can not execute blocking style operations or functions in callback function, like ziyanXPort_RotateSync() 770 * @note User can not execute blocking style operations or functions in callback function, like ziyanXPort_RotateSync()
741 * function, because that will block ziyan root thread, causing problems such as slow system response, payload 771 * function, because that will block ziyan root thread, causing problems such as slow system response, payload
742 * disconnection or infinite loop. 772 * disconnection or infinite loop.
@@ -777,7 +807,15 @@ typedef struct { @@ -777,7 +807,15 @@ typedef struct {
777 * @return Execution result. 807 * @return Execution result.
778 */ 808 */
779 T_ZiyanReturnCode (*GetRangeFinderLocation)(T_ZiyanLocation* location); 809 T_ZiyanReturnCode (*GetRangeFinderLocation)(T_ZiyanLocation* location);
  810 +} T_ZiyanCameraRangeFinderHandler;
780 811
  812 +/**
  813 + * @brief Prototype of handler functions for Tracking function.
  814 + * @note User can not execute blocking style operations or functions in callback function, like ziyanXPort_RotateSync()
  815 + * function, because that will block ziyan root thread, causing problems such as slow system response, payload
  816 + * disconnection or infinite loop.
  817 + */
  818 +typedef struct {
781 /** 819 /**
782 * @brief Prototype of callback function used to track target. 820 * @brief Prototype of callback function used to track target.
783 * @details User can select desired target by tap screen or manual draw a bounding box, this callback function 821 * @details User can select desired target by tap screen or manual draw a bounding box, this callback function
@@ -786,7 +824,16 @@ typedef struct { @@ -786,7 +824,16 @@ typedef struct {
786 * @param target_end: end point of target. Range: 0 to 1. 824 * @param target_end: end point of target. Range: 0 to 1.
787 * @return Execution result. 825 * @return Execution result.
788 */ 826 */
789 - T_ZiyanReturnCode (*TrackTarget)(T_ZiyanCameraPointInScreen target_begin, T_ZiyanCameraPointInScreen target_end); 827 + T_ZiyanReturnCode (*TrackTarget)(T_ZiyanCameraPointInScreen targetBegin, T_ZiyanCameraPointInScreen targetEnd);
  828 +
  829 + /**
  830 + * @brief Prototype of callback function used to track target.
  831 + * @details Users can input the target recognition name, this callback function
  832 + * will be called when User select target on the application or GSDK.
  833 + * @param targetName: Target recognition name.
  834 + * @return Execution result.
  835 + */
  836 + T_ZiyanReturnCode (*TrackTargetByName)(const char *targetName);
790 837
791 /** 838 /**
792 * @brief Prototype of callback function used to stop track target. 839 * @brief Prototype of callback function used to stop track target.
@@ -804,7 +851,7 @@ typedef struct { @@ -804,7 +851,7 @@ typedef struct {
804 */ 851 */
805 T_ZiyanReturnCode (*GetTrackState)(T_ZiyanCameraTrackState* state); 852 T_ZiyanReturnCode (*GetTrackState)(T_ZiyanCameraTrackState* state);
806 853
807 -} T_ZiyanCameraExtendHandler; 854 +} T_ZiyanCameraTrackingHandler;
808 855
809 /* Exported functions --------------------------------------------------------*/ 856 /* Exported functions --------------------------------------------------------*/
810 /** 857 /**
@@ -878,14 +925,24 @@ T_ZiyanReturnCode ZiyanPayloadCamera_RegOpticalZoomHandler(const T_ZiyanCameraOp @@ -878,14 +925,24 @@ T_ZiyanReturnCode ZiyanPayloadCamera_RegOpticalZoomHandler(const T_ZiyanCameraOp
878 T_ZiyanReturnCode ZiyanPayloadCamera_RegTapZoomHandler(const T_ZiyanCameraTapZoomHandler *cameraTapZoomHandler); 925 T_ZiyanReturnCode ZiyanPayloadCamera_RegTapZoomHandler(const T_ZiyanCameraTapZoomHandler *cameraTapZoomHandler);
879 926
880 /** 927 /**
881 - * @brief Register the handler for payload camera extend function interfaces.  
882 - * @note This interface registers the camera's extend interface, which includes setting and acquiring the range finder 928 + * @brief Register the handler for payload camera range finder function interfaces.
  929 + * @note This interface registers the camera's range finder interface, which includes setting and acquiring the range finder
883 * switch. Registering the load on this interface requires support for range finder. Registration of this interface 930 * switch. Registering the load on this interface requires support for range finder. Registration of this interface
884 * needs to be after ZiyanPayloadCamera_Init. 931 * needs to be after ZiyanPayloadCamera_Init.
885 - * @param cameraExtendHandler: pointer to the handler for payload camera extend functions. 932 + * @param cameraRangeFinderHandler: pointer to the handler for payload camera range finder functions.
  933 + * @return Execution result.
  934 +*/
  935 +T_ZiyanReturnCode ZiyanPayloadCamera_RegRangeFinderHandler(const T_ZiyanCameraRangeFinderHandler *cameraRangeFinderHandler);
  936 +
  937 +/**
  938 + * @brief Register the handler for payload camera tracking function interfaces.
  939 + * @note This interface registers the camera's tracking interface, which includes setting and acquiring the tracking
  940 + * switch. Registering the load on this interface requires support for tracking. Registration of this interface
  941 + * needs to be after ZiyanPayloadCamera_Init.
  942 + * @param cameraTrackingHandler: pointer to the handler for payload camera tracking functions.
886 * @return Execution result. 943 * @return Execution result.
887 */ 944 */
888 -T_ZiyanReturnCode ZiyanPayloadCamera_RegExtendHandler(const T_ZiyanCameraExtendHandler *cameraExtendHandler); 945 +T_ZiyanReturnCode ZiyanPayloadCamera_RegTrackingHandler(const T_ZiyanCameraTrackingHandler *cameraTrackingHandler);
889 946
890 /** 947 /**
891 * @brief Set the type of camera video stream. 948 * @brief Set the type of camera video stream.
@@ -53,6 +53,11 @@ typedef void *T_ZiyanUsbBulkHandle; @@ -53,6 +53,11 @@ typedef void *T_ZiyanUsbBulkHandle;
53 typedef void *T_ZiyanNetworkHandle; 53 typedef void *T_ZiyanNetworkHandle;
54 54
55 /** 55 /**
  56 +* @brief Platform handle of i2c device operation.
  57 +*/
  58 +typedef void *T_ZiyanI2cHandle;
  59 +
  60 +/**
56 * @brief Platform handle of thread task operation. 61 * @brief Platform handle of thread task operation.
57 */ 62 */
58 typedef void *T_ZiyanTaskHandle; 63 typedef void *T_ZiyanTaskHandle;
@@ -195,6 +200,23 @@ typedef struct { @@ -195,6 +200,23 @@ typedef struct {
195 } T_ZiyanHalNetworkHandler; 200 } T_ZiyanHalNetworkHandler;
196 201
197 typedef struct { 202 typedef struct {
  203 + uint32_t i2cSpeed;
  204 + uint16_t devAddress;
  205 +} T_ZiyanHalI2cConfig;
  206 +
  207 +typedef struct {
  208 + T_ZiyanReturnCode (*I2cInit)(T_ZiyanHalI2cConfig i2cConfig, T_ZiyanI2cHandle *i2cHandle);
  209 +
  210 + T_ZiyanReturnCode (*I2cDeInit)(T_ZiyanI2cHandle *i2cHandle);
  211 +
  212 + T_ZiyanReturnCode (*I2cWriteData)(T_ZiyanI2cHandle *i2cHandle, uint16_t devAddress, const uint8_t *buf,
  213 + uint32_t len, uint32_t *realLen);
  214 +
  215 + T_ZiyanReturnCode (*I2cReadData)(T_ZiyanI2cHandle *i2cHandle, uint16_t devAddress, uint8_t *buf,
  216 + uint32_t len, uint32_t *realLen);
  217 +} T_ZiyanHalI2cHandler;
  218 +
  219 +typedef struct {
198 T_ZiyanReturnCode (*TaskCreate)(const char *name, void *(*taskFunc)(void *), 220 T_ZiyanReturnCode (*TaskCreate)(const char *name, void *(*taskFunc)(void *),
199 uint32_t stackSize, void *arg, T_ZiyanTaskHandle *task); 221 uint32_t stackSize, void *arg, T_ZiyanTaskHandle *task);
200 222
@@ -320,6 +342,19 @@ T_ZiyanReturnCode ZiyanPlatform_RegHalUsbBulkHandler(const T_ZiyanHalUsbBulkHand @@ -320,6 +342,19 @@ T_ZiyanReturnCode ZiyanPlatform_RegHalUsbBulkHandler(const T_ZiyanHalUsbBulkHand
320 T_ZiyanReturnCode ZiyanPlatform_RegHalNetworkHandler(const T_ZiyanHalNetworkHandler *halNetworkHandler); 342 T_ZiyanReturnCode ZiyanPlatform_RegHalNetworkHandler(const T_ZiyanHalNetworkHandler *halNetworkHandler);
321 343
322 /** 344 /**
  345 + * @brief Register the handler for hal i2c master mode interfaces by your platform.
  346 + * @note It should be noted that the interface in hal is written and tested well. Users need to implement all the
  347 + * interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
  348 + * through the interface. If the registration fails, it needs to be based on the return code. To judge the problem. Make
  349 + * sure that the feature is available after a successful registration.
  350 + * @attention The interface needs to be called at the beginning of the application for registration, otherwise, the
  351 + * subsequent functions will not work properly.
  352 + * @param halI2cHandler: pointer to the handler for hal i2c handler interfaces by your platform.
  353 + * @return Execution result.
  354 + */
  355 +T_ZiyanReturnCode ZiyanPlatform_RegHalI2cHandler(const T_ZiyanHalI2cHandler *halI2cHandler);
  356 +
  357 +/**
323 * @brief Register the handler for osal interfaces by your platform. 358 * @brief Register the handler for osal interfaces by your platform.
324 * @note It should be noted that the interface in osal is written and tested well. Users need to implement all the 359 * @note It should be noted that the interface in osal is written and tested well. Users need to implement all the
325 * interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered 360 * interfaces. Otherwise, the user interface cannot be successfully registered, and then the user interface is registered
@@ -34,9 +34,9 @@ extern "C" { @@ -34,9 +34,9 @@ extern "C" {
34 34
35 /* Exported constants --------------------------------------------------------*/ 35 /* Exported constants --------------------------------------------------------*/
36 #define ZIYAN_SDK_VERSION_MAJOR 1 /*!< ZIYAN SDK major version num, when have incompatible API changes. Range from 0 to 99. */ 36 #define ZIYAN_SDK_VERSION_MAJOR 1 /*!< ZIYAN SDK major version num, when have incompatible API changes. Range from 0 to 99. */
37 -#define ZIYAN_SDK_VERSION_MINOR 0 /*!< ZIYAN SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */  
38 -#define ZIYAN_SDK_VERSION_MODIFY 0 /*!< ZIYAN SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */  
39 -#define ZIYAN_SDK_VERSION_DEBUG 4 /*!< ZIYAN SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */ 37 +#define ZIYAN_SDK_VERSION_MINOR 1 /*!< ZIYAN SDK minor version num, when add functionality in a backwards compatible manner changes. Range from 0 to 99. */
  38 +#define ZIYAN_SDK_VERSION_MODIFY 1 /*!< ZIYAN SDK modify version num, when have backwards compatible bug fixes changes. Range from 0 to 99. */
  39 +#define ZIYAN_SDK_VERSION_DEBUG 0 /*!< ZIYAN SDK version beta info, release version will be 0, when beta version release changes. Range from 0 to 255. */
40 #define ZIYAN_SDK_VERSION_BUILD 1 /*!< ZIYAN SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */ 40 #define ZIYAN_SDK_VERSION_BUILD 1 /*!< ZIYAN SDK version build info, when jenkins trigger build changes. Range from 0 to 65535. */
41 41
42 /* Exported types ------------------------------------------------------------*/ 42 /* Exported types ------------------------------------------------------------*/
@@ -81,7 +81,7 @@ static T_ZiyanCameraFocusHandler s_focusHandler; @@ -81,7 +81,7 @@ static T_ZiyanCameraFocusHandler s_focusHandler;
81 static T_ZiyanCameraDigitalZoomHandler s_digitalZoomHandler; 81 static T_ZiyanCameraDigitalZoomHandler s_digitalZoomHandler;
82 static T_ZiyanCameraOpticalZoomHandler s_opticalZoomHandler; 82 static T_ZiyanCameraOpticalZoomHandler s_opticalZoomHandler;
83 static T_ZiyanCameraTapZoomHandler s_tapZoomHandler; 83 static T_ZiyanCameraTapZoomHandler s_tapZoomHandler;
84 -static T_ZiyanCameraExtendHandler s_extendHander; 84 +static T_ZiyanCameraRangeFinderHandler s_rangeFinderHander;
85 85
86 static T_ZiyanTaskHandle s_userCameraThread; 86 static T_ZiyanTaskHandle s_userCameraThread;
87 87
@@ -181,1140 +181,12 @@ static void *UserCamera_Task(void *arg); @@ -181,1140 +181,12 @@ static void *UserCamera_Task(void *arg);
181 181
182 /* Private functions definition-----------------------------------------------*/ 182 /* Private functions definition-----------------------------------------------*/
183 183
184 -#if 0  
185 -  
186 -/**************************************************************************************************/  
187 -  
188 -#include <stdio.h>  
189 -#include <stdint.h>  
190 -#include <stdlib.h>  
191 -#include <string.h>  
192 -#include <libavformat/avformat.h>  
193 -#include <libavcodec/avcodec.h>  
194 -  
195 -  
196 -#define VIDEO_STREAM_INDEX 0 // 视频流索引,假设为 0  
197 -#define BUFFER_SIZE 4096 // 每个帧的缓冲区大小  
198 -  
199 -// void* push_video_stream(void* arg)  
200 -// {  
201 -// AVFormatContext *format_ctx = NULL;  
202 -// AVCodecContext *codec_ctx = NULL;  
203 -// AVCodec *codec = NULL;  
204 -// AVPacket packet;  
205 -// int video_stream_index = -1;  
206 -  
207 -// const char* filename = "/home/levi/Videos/test.mp4";  
208 -// USER_UTIL_UNUSED(arg);  
209 -  
210 -// // 初始化 FFmpeg 库  
211 -// av_register_all();  
212 -// avformat_network_init();  
213 -  
214 -// // 打开输入文件  
215 -// if (avformat_open_input(&format_ctx, filename, NULL, NULL) < 0) {  
216 -// fprintf(stderr, "Could not open file: %s\n", filename);  
217 -// return;  
218 -// }  
219 -  
220 -// // 获取文件信息  
221 -// if (avformat_find_stream_info(format_ctx, NULL) < 0) {  
222 -// fprintf(stderr, "Could not find stream information\n");  
223 -// return;  
224 -// }  
225 -  
226 -// // 查找视频流  
227 -// for (int i = 0; i < format_ctx->nb_streams; i++) {  
228 -// if (format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
229 -// video_stream_index = i;  
230 -// break;  
231 -// }  
232 -// }  
233 -  
234 -// if (video_stream_index == -1) {  
235 -// fprintf(stderr, "No video stream found in file\n");  
236 -// return;  
237 -// }  
238 -  
239 -// // 获取视频流的解码器  
240 -// codec = avcodec_find_decoder(format_ctx->streams[video_stream_index]->codecpar->codec_id);  
241 -// if (!codec) {  
242 -// fprintf(stderr, "Codec not found\n");  
243 -// return;  
244 -// }  
245 -  
246 -// // 创建解码器上下文  
247 -// codec_ctx = avcodec_alloc_context3(codec);  
248 -// if (!codec_ctx) {  
249 -// fprintf(stderr, "Could not allocate codec context\n");  
250 -// return;  
251 -// }  
252 -  
253 -// // 初始化解码器上下文  
254 -// if (avcodec_parameters_to_context(codec_ctx, format_ctx->streams[video_stream_index]->codecpar) < 0) {  
255 -// fprintf(stderr, "Could not copy codec parameters to context\n");  
256 -// return;  
257 -// }  
258 -  
259 -// // 打开解码器  
260 -// if (avcodec_open2(codec_ctx, codec, NULL) < 0) {  
261 -// fprintf(stderr, "Could not open codec\n");  
262 -// return;  
263 -// }  
264 -  
265 -// // 读取视频数据包并推送每个视频帧  
266 -// av_init_packet(&packet);  
267 -// while (av_read_frame(format_ctx, &packet) >= 0) {  
268 -// if (packet.stream_index == video_stream_index) {  
269 -// // 发送每一帧数据到 ZiyanPayloadCamera_SendVideoStream  
270 -// T_ZiyanReturnCode ret = ZiyanPayloadCamera_SendVideoStream(packet.data, packet.size);  
271 -// usleep(1000 * 100);  
272 -// if (ret != 0) {  
273 -// printf("Failed to send video stream\n");  
274 -// }  
275 -// }  
276 -  
277 -// // 释放数据包  
278 -// av_packet_unref(&packet);  
279 -// }  
280 -  
281 -// // 释放资源  
282 -// avcodec_free_context(&codec_ctx);  
283 -// avformat_close_input(&format_ctx);  
284 -// }  
285 -  
286 -#define UDP_STREAM_URL "udp://127.0.0.1:9600?pkt_size=1316"  
287 -// #define UDP_STREAM_URL "udp://192.168.3.74:9600"  
288 -// #define UDP_STREAM_URL "udp://127.0.0.1:9600"  
289 -  
290 -void* push_video_stream(void* arg)  
291 -{  
292 - const char *input_file = "/home/levi/Videos/test.mp4";  
293 - AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;  
294 - AVOutputFormat *ofmt = NULL;  
295 - AVPacket pkt;  
296 - int ret, stream_index = 0;  
297 - int *stream_mapping = NULL;  
298 - int stream_mapping_size = 0;  
299 -  
300 - // 初始化libavformat并注册所有的muxers, demuxers和protocols  
301 - av_register_all();  
302 - avformat_network_init();  
303 -  
304 - // 打开输入文件  
305 - if ((ret = avformat_open_input(&ifmt_ctx, input_file, NULL, NULL)) < 0) {  
306 - fprintf(stderr, "Could not open input file '%s'\n", input_file);  
307 - goto end;  
308 - }  
309 -  
310 - // 获取流信息  
311 - if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) {  
312 - fprintf(stderr, "Failed to retrieve input stream information\n");  
313 - goto end;  
314 - }  
315 -  
316 - // 打印输入文件信息  
317 - av_dump_format(ifmt_ctx, 0, input_file, 0);  
318 -  
319 - // 分配输出上下文,并显式指定输出格式为mpegts  
320 - ofmt = av_guess_format("mpegts", NULL, NULL);  
321 - if (!ofmt) {  
322 - fprintf(stderr, "Could not find MPEG-TS output format\n");  
323 - ret = AVERROR_UNKNOWN;  
324 - goto end;  
325 - }  
326 -  
327 - ofmt_ctx = avformat_alloc_context();  
328 - if (!ofmt_ctx) {  
329 - fprintf(stderr, "Could not create output context\n");  
330 - ret = AVERROR_UNKNOWN;  
331 - goto end;  
332 - }  
333 - ofmt_ctx->oformat = ofmt;  
334 -  
335 - // 设置输出URL  
336 - snprintf(ofmt_ctx->filename, sizeof(ofmt_ctx->filename), "%s", UDP_STREAM_URL);  
337 -  
338 - // 映射输入流到输出流  
339 - stream_mapping_size = ifmt_ctx->nb_streams;  
340 - stream_mapping = av_mallocz_array(stream_mapping_size, sizeof(*stream_mapping));  
341 - if (!stream_mapping) {  
342 - ret = AVERROR(ENOMEM);  
343 - goto end;  
344 - }  
345 -  
346 - for (int i = 0; i < ifmt_ctx->nb_streams; i++) {  
347 - AVStream *out_stream;  
348 - AVStream *in_stream = ifmt_ctx->streams[i];  
349 - AVCodecParameters *in_codecpar = in_stream->codecpar;  
350 -  
351 - if (in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {  
352 - stream_mapping[i] = -1;  
353 - continue;  
354 - }  
355 -  
356 - stream_mapping[i] = stream_index++;  
357 -  
358 - out_stream = avformat_new_stream(ofmt_ctx, NULL);  
359 - if (!out_stream) {  
360 - fprintf(stderr, "Failed allocating output stream\n");  
361 - ret = AVERROR_UNKNOWN;  
362 - goto end;  
363 - }  
364 -  
365 - ret = avcodec_parameters_copy(out_stream->codecpar, in_codecpar);  
366 - if (ret < 0) {  
367 - fprintf(stderr, "Failed to copy codec parameters\n");  
368 - goto end;  
369 - }  
370 - out_stream->codecpar->codec_tag = 0;  
371 - }  
372 -  
373 - // 打印输出格式信息  
374 - av_dump_format(ofmt_ctx, 0, UDP_STREAM_URL, 1);  
375 -  
376 - // 打开输出URL  
377 - if (!(ofmt->flags & AVFMT_NOFILE)) {  
378 - ret = avio_open(&ofmt_ctx->pb, UDP_STREAM_URL, AVIO_FLAG_WRITE);  
379 - if (ret < 0) {  
380 - fprintf(stderr, "Could not open output URL '%s'\n", UDP_STREAM_URL);  
381 - goto end;  
382 - }  
383 - }  
384 -  
385 - // 写文件头  
386 - ret = avformat_write_header(ofmt_ctx, NULL);  
387 - if (ret < 0) {  
388 - fprintf(stderr, "Error occurred when opening output URL\n");  
389 - goto end;  
390 - }  
391 -  
392 - // 读取并写入数据包  
393 - while (1) {  
394 - AVStream *in_stream, *out_stream;  
395 -  
396 - ret = av_read_frame(ifmt_ctx, &pkt);  
397 - if (ret < 0)  
398 - break;  
399 -  
400 - in_stream = ifmt_ctx->streams[pkt.stream_index];  
401 - if (pkt.stream_index >= stream_mapping_size ||  
402 - stream_mapping[pkt.stream_index] < 0) {  
403 - av_packet_unref(&pkt);  
404 - continue;  
405 - }  
406 -  
407 - pkt.stream_index = stream_mapping[pkt.stream_index];  
408 - out_stream = ofmt_ctx->streams[pkt.stream_index];  
409 -  
410 - // 复制packet  
411 - pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);  
412 - pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);  
413 - pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);  
414 - pkt.pos = -1;  
415 -  
416 -  
417 - // T_ZiyanReturnCode ret = ZiyanPayloadCamera_SendVideoStream(pkt.data, pkt.size);  
418 -  
419 - // 写packet  
420 - ret = av_interleaved_write_frame(ofmt_ctx, &pkt);  
421 - if (ret < 0) {  
422 - fprintf(stderr, "Error muxing packet\n");  
423 - break;  
424 - }  
425 - av_packet_unref(&pkt);  
426 - usleep(1000*34);  
427 - }  
428 -  
429 - // 写文件尾  
430 - av_write_trailer(ofmt_ctx);  
431 -  
432 -end:  
433 - avformat_close_input(&ifmt_ctx);  
434 -  
435 - if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))  
436 - avio_closep(&ofmt_ctx->pb);  
437 -  
438 - avformat_free_context(ofmt_ctx);  
439 - av_freep(&stream_mapping);  
440 -  
441 - if (ret < 0 && ret != AVERROR_EOF) {  
442 - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));  
443 - return 1;  
444 - }  
445 -  
446 - return 0;  
447 -}  
448 -  
449 -  
450 -  
451 -void* push_video_stream1(void* arg)  
452 -{  
453 - const char *input_file = "/home/levi/Videos/test.mp4";  
454 - AVFormatContext *ifmt_ctx = NULL;  
455 - AVPacket pkt;  
456 - int ret;  
457 -  
458 - // 初始化libavformat并注册所有的muxers, demuxers和protocols  
459 - av_register_all();  
460 - avformat_network_init();  
461 -  
462 - // 打开输入文件  
463 - if ((ret = avformat_open_input(&ifmt_ctx, input_file, NULL, NULL)) < 0) {  
464 - fprintf(stderr, "Could not open input file '%s'\n", input_file);  
465 - goto end;  
466 - }  
467 -  
468 - // 获取流信息  
469 - if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) {  
470 - fprintf(stderr, "Failed to retrieve input stream information\n");  
471 - goto end;  
472 - }  
473 -  
474 - // 打印输入文件信息  
475 - av_dump_format(ifmt_ctx, 0, input_file, 0);  
476 -  
477 - // 查找视频流  
478 - int video_stream_index = -1;  
479 - for (int i = 0; i < ifmt_ctx->nb_streams; i++) {  
480 - if (ifmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
481 - video_stream_index = i;  
482 - break;  
483 - }  
484 - }  
485 -  
486 - if (video_stream_index == -1) {  
487 - fprintf(stderr, "No video stream found in input file\n");  
488 - ret = AVERROR_UNKNOWN;  
489 - goto end;  
490 - }  
491 -  
492 - // 读取并发送H.264帧  
493 - while (1) {  
494 - ret = av_read_frame(ifmt_ctx, &pkt);  
495 - if (ret < 0)  
496 - break;  
497 -  
498 - // 只处理视频流  
499 - if (pkt.stream_index == video_stream_index) {  
500 - // 调用发送函数发送H.264帧  
501 - ZiyanPayloadCamera_SendVideoStream(pkt.data, pkt.size);  
502 - }  
503 - usleep(1000*34);  
504 - av_packet_unref(&pkt);  
505 - }  
506 -  
507 -end:  
508 - avformat_close_input(&ifmt_ctx);  
509 -  
510 - if (ret < 0 && ret != AVERROR_EOF) {  
511 - fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));  
512 - return 1;  
513 - }  
514 -  
515 - return 0;  
516 -}  
517 -  
518 -  
519 -  
520 -#include <stdio.h>  
521 -#include <stdlib.h>  
522 -#include <string.h>  
523 -#include <unistd.h>  
524 -#include <arpa/inet.h>  
525 -#include <libavformat/avformat.h>  
526 -#include <libavcodec/avcodec.h>  
527 -#include <libavutil/avutil.h>  
528 -#include <libavutil/opt.h>  
529 -  
530 -// #define DEST_IP "127.0.0.1"  
531 -#define DEST_IP "127.0.0.1"  
532 -#define DEST_PORT 9600  
533 -  
534 -void* push_video_stream2(void* arg)  
535 -{  
536 - const char *input_file = "/home/levi/Videos/test.mp4";  
537 - AVFormatContext *format_ctx = NULL;  
538 - AVCodecContext *codec_ctx = NULL;  
539 - AVStream *video_stream = NULL;  
540 - AVPacket packet;  
541 - int ret, video_stream_index;  
542 -  
543 - // 初始化 FFmpeg 库  
544 - av_register_all();  
545 - avformat_network_init();  
546 -  
547 - // 打开输入文件  
548 - ret = avformat_open_input(&format_ctx, input_file, NULL, NULL);  
549 - if (ret < 0) {  
550 - fprintf(stderr, "Could not open input file '%s'\n", input_file);  
551 - return ret;  
552 - }  
553 -  
554 - // 获取文件信息  
555 - ret = avformat_find_stream_info(format_ctx, NULL);  
556 - if (ret < 0) {  
557 - fprintf(stderr, "Could not find stream information\n");  
558 - return ret;  
559 - }  
560 -  
561 - // 查找视频流  
562 - video_stream_index = -1;  
563 - for (int i = 0; i < format_ctx->nb_streams; i++) {  
564 - if (format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
565 - video_stream_index = i;  
566 - video_stream = format_ctx->streams[i];  
567 - break;  
568 - }  
569 - }  
570 -  
571 - if (video_stream_index == -1) {  
572 - fprintf(stderr, "No video stream found\n");  
573 - return -1;  
574 - }  
575 -  
576 - // 获取视频流的解码器  
577 - AVCodec *codec = avcodec_find_decoder(video_stream->codecpar->codec_id);  
578 - if (!codec) {  
579 - fprintf(stderr, "Codec not found\n");  
580 - return -1;  
581 - }  
582 -  
583 - codec_ctx = avcodec_alloc_context3(codec);  
584 - if (!codec_ctx) {  
585 - fprintf(stderr, "Could not allocate codec context\n");  
586 - return -1;  
587 - }  
588 -  
589 - ret = avcodec_parameters_to_context(codec_ctx, video_stream->codecpar);  
590 - if (ret < 0) {  
591 - fprintf(stderr, "Could not copy codec parameters\n");  
592 - return ret;  
593 - }  
594 -  
595 - ret = avcodec_open2(codec_ctx, codec, NULL);  
596 - if (ret < 0) {  
597 - fprintf(stderr, "Could not open codec\n");  
598 - return ret;  
599 - }  
600 -  
601 - // 设置 UDP socket  
602 - int sockfd = socket(AF_INET, SOCK_DGRAM, 0);  
603 - if (sockfd < 0) {  
604 - perror("Socket creation failed");  
605 - return -1;  
606 - }  
607 -  
608 - struct sockaddr_in dest_addr;  
609 - memset(&dest_addr, 0, sizeof(dest_addr));  
610 - dest_addr.sin_family = AF_INET;  
611 - dest_addr.sin_port = htons(DEST_PORT);  
612 - ret = inet_pton(AF_INET, DEST_IP, &dest_addr.sin_addr);  
613 - if (ret <= 0) {  
614 - fprintf(stderr, "Invalid destination IP address\n");  
615 - return -1;  
616 - }  
617 -  
618 - // 解码并发送数据  
619 - av_init_packet(&packet);  
620 - while (1) {  
621 - ret = av_read_frame(format_ctx, &packet);  
622 - if (ret < 0) {  
623 - break;  
624 - }  
625 -  
626 - if (packet.stream_index == video_stream_index) {  
627 - // 这里发送的是解码后的裸流数据  
628 - ret = sendto(sockfd, packet.data, packet.size, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));  
629 - if (ret < 0) {  
630 - perror("Sendto failed");  
631 - break;  
632 - }  
633 - }  
634 - usleep(1000*34);  
635 - av_packet_unref(&packet);  
636 - }  
637 -  
638 - // 清理资源  
639 - close(sockfd);  
640 - avcodec_free_context(&codec_ctx);  
641 - avformat_close_input(&format_ctx);  
642 -  
643 - return 0;  
644 -}  
645 -  
646 -  
647 -  
648 -#include <stdio.h>  
649 -#include <stdlib.h>  
650 -#include <string.h>  
651 -#include <unistd.h>  
652 -#include <arpa/inet.h>  
653 -#include <libavformat/avformat.h>  
654 -#include <libavcodec/avcodec.h>  
655 -#include <libavutil/avutil.h>  
656 -#include <libavutil/opt.h>  
657 -  
658 -// #define DEST_IP "192.168.3.74"  
659 -// #define DEST_PORT 9600  
660 -  
661 -void* push_video_stream3(void* arg)  
662 -{  
663 - const char *input_file = "/home/levi/Videos/test.mp4";  
664 - AVFormatContext *input_format_ctx = NULL, *output_format_ctx = NULL;  
665 - AVCodecContext *codec_ctx = NULL;  
666 - AVStream *video_stream = NULL;  
667 - AVPacket packet;  
668 - int ret, video_stream_index;  
669 -  
670 - // 初始化 FFmpeg 库  
671 - av_register_all();  
672 - avformat_network_init();  
673 -  
674 - // 打开输入 MP4 文件  
675 - ret = avformat_open_input(&input_format_ctx, input_file, NULL, NULL);  
676 - if (ret < 0) {  
677 - fprintf(stderr, "Could not open input file '%s'\n", input_file);  
678 - return ret;  
679 - }  
680 -  
681 - // 获取文件流信息  
682 - ret = avformat_find_stream_info(input_format_ctx, NULL);  
683 - if (ret < 0) {  
684 - fprintf(stderr, "Could not find stream information\n");  
685 - return ret;  
686 - }  
687 -  
688 - // 查找视频流  
689 - video_stream_index = -1;  
690 - for (int i = 0; i < input_format_ctx->nb_streams; i++) {  
691 - if (input_format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
692 - video_stream_index = i;  
693 - video_stream = input_format_ctx->streams[i];  
694 - break;  
695 - }  
696 - }  
697 -  
698 - if (video_stream_index == -1) {  
699 - fprintf(stderr, "No video stream found\n");  
700 - return -1;  
701 - }  
702 -  
703 - // 获取视频流的解码器  
704 - AVCodec *codec = avcodec_find_decoder(video_stream->codecpar->codec_id);  
705 - if (!codec) {  
706 - fprintf(stderr, "Codec not found\n");  
707 - return -1;  
708 - }  
709 -  
710 - codec_ctx = avcodec_alloc_context3(codec);  
711 - if (!codec_ctx) {  
712 - fprintf(stderr, "Could not allocate codec context\n");  
713 - return -1;  
714 - }  
715 -  
716 - ret = avcodec_parameters_to_context(codec_ctx, video_stream->codecpar);  
717 - if (ret < 0) {  
718 - fprintf(stderr, "Could not copy codec parameters\n");  
719 - return ret;  
720 - }  
721 -  
722 - ret = avcodec_open2(codec_ctx, codec, NULL);  
723 - if (ret < 0) {  
724 - fprintf(stderr, "Could not open codec\n");  
725 - return ret;  
726 - }  
727 -  
728 - // 创建输出格式上下文(MPEG-TS 格式)  
729 - ret = avformat_alloc_output_context2(&output_format_ctx, NULL, "mpegts", "udp://127.0.0.1:9600");  
730 - if (ret < 0 || !output_format_ctx) {  
731 - fprintf(stderr, "Could not create output context\n");  
732 - return ret;  
733 - }  
734 -  
735 - // 创建输出流  
736 - AVStream *out_stream = avformat_new_stream(output_format_ctx, codec);  
737 - if (!out_stream) {  
738 - fprintf(stderr, "Could not create stream\n");  
739 - return AVERROR_UNKNOWN;  
740 - }  
741 -  
742 - // 复制输入流参数到输出流  
743 - ret = avcodec_parameters_copy(out_stream->codecpar, video_stream->codecpar);  
744 - if (ret < 0) {  
745 - fprintf(stderr, "Could not copy codec parameters\n");  
746 - return ret;  
747 - }  
748 -  
749 - // 打开输出文件/流  
750 - if (!(output_format_ctx->oformat->flags & AVFMT_NOFILE)) {  
751 - ret = avio_open(&output_format_ctx->pb, "udp://127.0.0.1:9600", AVIO_FLAG_WRITE);  
752 - if (ret < 0) {  
753 - fprintf(stderr, "Could not open output stream\n");  
754 - return ret;  
755 - }  
756 - }  
757 -  
758 - // 写入 MPEG-TS 文件头  
759 - ret = avformat_write_header(output_format_ctx, NULL);  
760 - if (ret < 0) {  
761 - fprintf(stderr, "Error writing header to output stream\n");  
762 - return ret;  
763 - }  
764 -  
765 - // 创建 UDP socket  
766 - int sockfd = socket(AF_INET, SOCK_DGRAM, 0);  
767 - if (sockfd < 0) {  
768 - perror("Socket creation failed");  
769 - return -1;  
770 - }  
771 -  
772 - struct sockaddr_in dest_addr;  
773 - memset(&dest_addr, 0, sizeof(dest_addr));  
774 - dest_addr.sin_family = AF_INET;  
775 - dest_addr.sin_port = htons(DEST_PORT);  
776 - ret = inet_pton(AF_INET, DEST_IP, &dest_addr.sin_addr);  
777 - if (ret <= 0) {  
778 - fprintf(stderr, "Invalid destination IP address\n");  
779 - return -1;  
780 - }  
781 -  
782 - // 解码并发送视频流  
783 - av_init_packet(&packet);  
784 - while (1) {  
785 - ret = av_read_frame(input_format_ctx, &packet);  
786 - if (ret < 0) {  
787 - break;  
788 - }  
789 -  
790 - if (packet.stream_index == video_stream_index) {  
791 - // 将视频数据包发送到 UDP  
792 - // ret = sendto(sockfd, packet.data, packet.size, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));  
793 - ZiyanPayloadCamera_SendVideoStream(packet.data, packet.size);  
794 - if (ret < 0) {  
795 - perror("Sendto failed");  
796 - break;  
797 - }  
798 - }  
799 -  
800 - usleep(1000 * 34);  
801 - av_packet_unref(&packet);  
802 - }  
803 -  
804 - // 写入文件尾部  
805 - av_write_trailer(output_format_ctx);  
806 -  
807 - // 清理资源  
808 - close(sockfd);  
809 - avcodec_free_context(&codec_ctx);  
810 - avformat_close_input(&input_format_ctx);  
811 - avformat_free_context(output_format_ctx);  
812 -  
813 - return 0;  
814 -}  
815 -  
816 -  
817 -#include <stdio.h>  
818 -#include <stdlib.h>  
819 -#include <string.h>  
820 -#include <unistd.h>  
821 -#include <arpa/inet.h>  
822 -  
823 -#define TARGET_IP "127.0.0.1"  
824 -#define TARGET_PORT 9600  
825 -#define TS_PACKET_SIZE 1314  
826 -  
827 -// 初始化Socket  
828 -int init_socket(const char *ip, int port) {  
829 - int sockfd = socket(AF_INET, SOCK_DGRAM, 0);  
830 - if (sockfd < 0) {  
831 - perror("Socket creation failed");  
832 - exit(EXIT_FAILURE);  
833 - }  
834 -  
835 - struct sockaddr_in server_addr;  
836 - memset(&server_addr, 0, sizeof(server_addr));  
837 - server_addr.sin_family = AF_INET;  
838 - server_addr.sin_port = htons(port);  
839 - inet_pton(AF_INET, ip, &server_addr.sin_addr);  
840 -  
841 - if (connect(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {  
842 - perror("Socket connect failed");  
843 - close(sockfd);  
844 - exit(EXIT_FAILURE);  
845 - }  
846 -  
847 - return sockfd;  
848 -}  
849 -  
850 -// 推送TS包  
851 -void send_ts_packet(int sockfd, uint8_t *packet, int size) {  
852 - if (send(sockfd, packet, size, 0) < 0) {  
853 - perror("Send failed");  
854 - }  
855 -}  
856 -  
857 -void* push_video_stream4(void* arg)  
858 -{  
859 - const char *input_file = "/home/levi/Videos/test.mp4";;  
860 -  
861 - // 初始化FFmpeg  
862 - av_register_all();  
863 - avformat_network_init();  
864 -  
865 - AVFormatContext *input_ctx = NULL;  
866 - if (avformat_open_input(&input_ctx, input_file, NULL, NULL) < 0) {  
867 - fprintf(stderr, "Could not open input file: %s\n", input_file);  
868 - return -1;  
869 - }  
870 -  
871 - if (avformat_find_stream_info(input_ctx, NULL) < 0) {  
872 - fprintf(stderr, "Could not find stream information\n");  
873 - return -1;  
874 - }  
875 -  
876 - // 查找视频流  
877 - int video_stream_index = -1;  
878 - for (int i = 0; i < input_ctx->nb_streams; i++) {  
879 - if (input_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
880 - video_stream_index = i;  
881 - break;  
882 - }  
883 - }  
884 - if (video_stream_index == -1) {  
885 - fprintf(stderr, "No video stream found\n");  
886 - return -1;  
887 - }  
888 -  
889 - // 初始化输出格式上下文(MPEG-TS)  
890 - AVFormatContext *output_ctx = NULL;  
891 - avformat_alloc_output_context2(&output_ctx, NULL, "mpegts", NULL);  
892 - if (!output_ctx) {  
893 - fprintf(stderr, "Could not create output context\n");  
894 - return -1;  
895 - }  
896 -  
897 - // 添加视频流到输出上下文  
898 - AVStream *output_stream = avformat_new_stream(output_ctx, NULL);  
899 - if (!output_stream) {  
900 - fprintf(stderr, "Could not create output stream\n");  
901 - return -1;  
902 - }  
903 - avcodec_parameters_copy(output_stream->codecpar, input_ctx->streams[video_stream_index]->codecpar);  
904 - output_stream->codecpar->codec_tag = 0;  
905 -  
906 - // 初始化Socket  
907 - int sockfd = init_socket(TARGET_IP, TARGET_PORT);  
908 -  
909 - // 写入TS流到Socket  
910 - AVPacket pkt;  
911 - av_init_packet(&pkt);  
912 - pkt.data = NULL;  
913 - pkt.size = 0;  
914 -  
915 - while (av_read_frame(input_ctx, &pkt) >= 0) {  
916 - if (pkt.stream_index == video_stream_index) {  
917 - // 发送TS包  
918 - uint8_t *ts_packet = pkt.data;  
919 - int ts_packet_size = pkt.size;  
920 - while (ts_packet_size > 0) {  
921 - int send_size = (ts_packet_size > TS_PACKET_SIZE) ? TS_PACKET_SIZE : ts_packet_size;  
922 - send_ts_packet(sockfd, ts_packet, send_size);  
923 - ts_packet += send_size;  
924 - ts_packet_size -= send_size;  
925 - }  
926 - }  
927 - usleep(1000 * 34);  
928 - av_packet_unref(&pkt);  
929 - }  
930 -  
931 - // 清理资源  
932 - avformat_close_input(&input_ctx);  
933 - avformat_free_context(output_ctx);  
934 - close(sockfd);  
935 -  
936 - return 0;  
937 -}  
938 -  
939 -  
940 -#include <stdio.h>  
941 -#include <stdlib.h>  
942 -#include <string.h>  
943 -#include <unistd.h>  
944 -#include <libavformat/avformat.h>  
945 -#include <libavcodec/avcodec.h>  
946 -#include <libavutil/opt.h>  
947 -  
948 -#define OUTPUT_UDP "udp://127.0.0.1:9600"  
949 -#define INPUT_FILE "/home/levi/Videos/test.mp4"  
950 -  
951 -void* push_video_stream5(void* arg)  
952 -{  
953 - avformat_network_init();  
954 -  
955 - // 打开输入 MP4 文件  
956 - AVFormatContext *input_fmt_ctx = NULL;  
957 - if (avformat_open_input(&input_fmt_ctx, INPUT_FILE, NULL, NULL) < 0) {  
958 - fprintf(stderr, "Could not open input file '%s'\n", INPUT_FILE);  
959 - return -1;  
960 - }  
961 -  
962 - if (avformat_find_stream_info(input_fmt_ctx, NULL) < 0) {  
963 - fprintf(stderr, "Could not find stream information\n");  
964 - return -1;  
965 - }  
966 -  
967 - // 查找视频流  
968 - int video_stream_index = -1;  
969 - AVCodecContext *video_codec_ctx = NULL;  
970 - for (int i = 0; i < input_fmt_ctx->nb_streams; i++) {  
971 - if (input_fmt_ctx->streams[i]->codecpar->codec_id == AV_CODEC_ID_H264) {  
972 - video_stream_index = i;  
973 - video_codec_ctx = avcodec_alloc_context3(NULL);  
974 - avcodec_parameters_to_context(video_codec_ctx, input_fmt_ctx->streams[i]->codecpar);  
975 - break;  
976 - }  
977 - }  
978 -  
979 - if (video_stream_index == -1) {  
980 - fprintf(stderr, "No H.264 video stream found\n");  
981 - return -1;  
982 - }  
983 -  
984 - // 打开解码器  
985 - AVCodec *video_codec = avcodec_find_decoder(video_codec_ctx->codec_id);  
986 - if (avcodec_open2(video_codec_ctx, video_codec, NULL) < 0) {  
987 - fprintf(stderr, "Could not open codec\n");  
988 - return -1;  
989 - }  
990 -  
991 - // 创建输出 UDP 流  
992 - AVFormatContext *output_fmt_ctx = NULL;  
993 - if (avformat_alloc_output_context2(&output_fmt_ctx, NULL, "mpegts", OUTPUT_UDP) < 0) {  
994 - fprintf(stderr, "Could not create output context\n");  
995 - return -1;  
996 - }  
997 -  
998 - // 创建视频流  
999 - AVStream *out_stream = avformat_new_stream(output_fmt_ctx, video_codec);  
1000 - if (!out_stream) {  
1001 - fprintf(stderr, "Failed to create new stream\n");  
1002 - return -1;  
1003 - }  
1004 -  
1005 - // 使用复制的参数配置输出流  
1006 - if (avcodec_parameters_copy(out_stream->codecpar, input_fmt_ctx->streams[video_stream_index]->codecpar) < 0) {  
1007 - fprintf(stderr, "Failed to copy codec parameters\n");  
1008 - return -1;  
1009 - }  
1010 -  
1011 - // 打开输出流  
1012 - if (!(output_fmt_ctx->oformat->flags & AVFMT_NOFILE)) {  
1013 - if (avio_open(&output_fmt_ctx->pb, OUTPUT_UDP, AVIO_FLAG_WRITE) < 0) {  
1014 - fprintf(stderr, "Could not open output file\n");  
1015 - return -1;  
1016 - }  
1017 - }  
1018 -  
1019 - // 写入文件头  
1020 - if (avformat_write_header(output_fmt_ctx, NULL) < 0) {  
1021 - fprintf(stderr, "Error occurred when opening output file\n");  
1022 - return -1;  
1023 - }  
1024 -  
1025 - // 读取数据包并转发到 UDP  
1026 - AVPacket packet;  
1027 - while (1) {  
1028 - if (av_read_frame(input_fmt_ctx, &packet) < 0) {  
1029 - break; // 读取完毕  
1030 - }  
1031 -  
1032 - // 如果是视频流,直接转发  
1033 - if (packet.stream_index == video_stream_index) {  
1034 - // 复制数据包并推送到 UDP  
1035 - if (av_interleaved_write_frame(output_fmt_ctx, &packet) < 0) {  
1036 - fprintf(stderr, "Error while writing packet\n");  
1037 - break;  
1038 - }  
1039 - usleep(1000 * 34);  
1040 - }  
1041 - //  
1042 - // 释放包内存  
1043 - av_packet_unref(&packet);  
1044 - }  
1045 -  
1046 - // 写入文件尾并关闭  
1047 - av_write_trailer(output_fmt_ctx);  
1048 - avcodec_free_context(&video_codec_ctx);  
1049 - avformat_close_input(&input_fmt_ctx);  
1050 - avformat_free_context(output_fmt_ctx);  
1051 -  
1052 - return 0;  
1053 -}  
1054 -  
1055 -  
1056 -#include <stdio.h>  
1057 -#include <stdlib.h>  
1058 -#include <string.h>  
1059 -#include <unistd.h>  
1060 -#include <arpa/inet.h>  
1061 -#include <libavformat/avformat.h>  
1062 -#include <libavcodec/avcodec.h>  
1063 -#include <libavutil/opt.h>  
1064 -  
1065 -#define MAX_PACKET_SIZE 1316 // UDP 最大数据包大小(1500字节的MTU减去头部)  
1066 -#define PAYLOAD_HEADER_SIZE 4 // 假设我们需要4字节来存储包的序号或其他信息  
1067 -  
1068 -// 发送视频流数据到UDP  
1069 -int SendVideoStream(const uint8_t *data, uint16_t len, int sockfd, struct sockaddr_in *dest_addr) {  
1070 - // 将数据分片并发送  
1071 - int remaining = len;  
1072 - int offset = 0;  
1073 - while (remaining > 0) {  
1074 - int size_to_send = (remaining > (MAX_PACKET_SIZE - PAYLOAD_HEADER_SIZE)) ? (MAX_PACKET_SIZE - PAYLOAD_HEADER_SIZE) : remaining;  
1075 -  
1076 - // 为每个数据包添加头部信息(例如,偏移量)  
1077 - uint8_t *packet_data = malloc(PAYLOAD_HEADER_SIZE + size_to_send);  
1078 - if (!packet_data) {  
1079 - perror("Failed to allocate memory for packet fragment");  
1080 - return -1;  
1081 - }  
1082 -  
1083 - // 在包头附加偏移量或序号(简单示例)  
1084 - *(int*)packet_data = offset; // 偏移量作为示例  
1085 - memcpy(packet_data + PAYLOAD_HEADER_SIZE, data + offset, size_to_send);  
1086 -  
1087 - // 发送数据包  
1088 - ssize_t sent_len = sendto(sockfd, packet_data, PAYLOAD_HEADER_SIZE + size_to_send, 0, (struct sockaddr*)dest_addr, sizeof(*dest_addr));  
1089 - if (sent_len < 0) {  
1090 - perror("Failed to send UDP packet");  
1091 - free(packet_data);  
1092 - return -1;  
1093 - }  
1094 -  
1095 - printf("send len %d\n", sent_len);  
1096 -  
1097 - // 更新状态  
1098 - remaining -= size_to_send;  
1099 - offset += size_to_send;  
1100 - free(packet_data); // 释放已发送的数据包  
1101 - }  
1102 -  
1103 - return 0;  
1104 -}  
1105 -  
1106 -void* push_video_stream6(void* arg)  
1107 -{  
1108 - avformat_network_init();  
1109 -  
1110 - // 打开输入 MP4 文件  
1111 - AVFormatContext *input_fmt_ctx = NULL;  
1112 - if (avformat_open_input(&input_fmt_ctx, INPUT_FILE, NULL, NULL) < 0) {  
1113 - fprintf(stderr, "Could not open input file '%s'\n", INPUT_FILE);  
1114 - return -1;  
1115 - }  
1116 -  
1117 - if (avformat_find_stream_info(input_fmt_ctx, NULL) < 0) {  
1118 - fprintf(stderr, "Could not find stream information\n");  
1119 - return -1;  
1120 - }  
1121 -  
1122 - // 查找视频流  
1123 - int video_stream_index = -1;  
1124 - AVCodecContext *video_codec_ctx = NULL;  
1125 - for (int i = 0; i < input_fmt_ctx->nb_streams; i++) {  
1126 - if (input_fmt_ctx->streams[i]->codecpar->codec_id == AV_CODEC_ID_H264) {  
1127 - video_stream_index = i;  
1128 - video_codec_ctx = avcodec_alloc_context3(NULL);  
1129 - avcodec_parameters_to_context(video_codec_ctx, input_fmt_ctx->streams[i]->codecpar);  
1130 - break;  
1131 - }  
1132 - }  
1133 -  
1134 - if (video_stream_index == -1) {  
1135 - fprintf(stderr, "No H.264 video stream found\n");  
1136 - return -1;  
1137 - }  
1138 -  
1139 - // 打开解码器  
1140 - AVCodec *video_codec = avcodec_find_decoder(video_codec_ctx->codec_id);  
1141 - if (avcodec_open2(video_codec_ctx, video_codec, NULL) < 0) {  
1142 - fprintf(stderr, "Could not open codec\n");  
1143 - return -1;  
1144 - }  
1145 -  
1146 - // 创建 UDP 套接字  
1147 - int sockfd;  
1148 - struct sockaddr_in dest_addr;  
1149 - sockfd = socket(AF_INET, SOCK_DGRAM, 0);  
1150 - if (sockfd < 0) {  
1151 - perror("Socket creation failed");  
1152 - return -1;  
1153 - }  
1154 -  
1155 - memset(&dest_addr, 0, sizeof(dest_addr));  
1156 - dest_addr.sin_family = AF_INET;  
1157 - dest_addr.sin_port = htons(9600); // 目标端口  
1158 - if (inet_pton(AF_INET, "127.0.0.1", &dest_addr.sin_addr) <= 0) {  
1159 - perror("Invalid address");  
1160 - return -1;  
1161 - }  
1162 -  
1163 - // 读取数据包并推送到 UDP  
1164 - AVPacket packet;  
1165 - while (1) {  
1166 - if (av_read_frame(input_fmt_ctx, &packet) < 0) {  
1167 - break; // 读取完毕  
1168 - }  
1169 -  
1170 - // 如果是视频流,推送到 UDP  
1171 - if (packet.stream_index == video_stream_index) {  
1172 - // 使用 ZiyanPayloadCamera_SendVideoStream 发送数据  
1173 - if (SendVideoStream(packet.data, packet.size, sockfd, &dest_addr) < 0) {  
1174 - fprintf(stderr, "Error sending packet\n");  
1175 - break;  
1176 - }  
1177 -  
1178 - usleep(1000 * 33);  
1179 - }  
1180 -  
1181 - // 释放包内存  
1182 - av_packet_unref(&packet);  
1183 - }  
1184 -  
1185 - // 清理  
1186 - close(sockfd);  
1187 - avcodec_free_context(&video_codec_ctx);  
1188 - avformat_close_input(&input_fmt_ctx);  
1189 -  
1190 - return 0;  
1191 -}  
1192 -  
1193 -#include <libavformat/avformat.h>  
1194 -#include <libavcodec/avcodec.h>  
1195 -#include <libavutil/opt.h>  
1196 -#include <libavdevice/avdevice.h>  
1197 -#include <stdio.h>  
1198 -#include <stdlib.h>  
1199 -#include <string.h>  
1200 -#include <unistd.h>  
1201 -#include <netinet/in.h>  
1202 -#include <arpa/inet.h> // 引入该头文件  
1203 -  
1204 -#define STREAM_PORT 9600  
1205 -#define STREAM_ADDR "127.0.0.1"  
1206 -  
1207 -void* push_video_stream7(void* arg)  
1208 -{  
1209 - av_register_all();  
1210 - avformat_network_init();  
1211 -  
1212 - // Input file path  
1213 - char *input_file = "/home/levi/Videos/test.mp4"; // Replace with your input file  
1214 -  
1215 - AVFormatContext *input_format_context = NULL;  
1216 - AVCodecContext *codec_context = NULL;  
1217 - AVCodec *codec = NULL;  
1218 - AVPacket packet;  
1219 -  
1220 - // Open the input MP4 file  
1221 - if (avformat_open_input(&input_format_context, input_file, NULL, NULL) < 0) {  
1222 - fprintf(stderr, "Error opening input file\n");  
1223 - return -1;  
1224 - }  
1225 -  
1226 - if (avformat_find_stream_info(input_format_context, NULL) < 0) {  
1227 - fprintf(stderr, "Error finding stream info\n");  
1228 - return -1;  
1229 - }  
1230 -  
1231 - // Find the video stream  
1232 - int stream_index = -1;  
1233 - for (int i = 0; i < input_format_context->nb_streams; i++) {  
1234 - if (input_format_context->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
1235 - stream_index = i;  
1236 - break;  
1237 - }  
1238 - }  
1239 -  
1240 - if (stream_index == -1) {  
1241 - fprintf(stderr, "No video stream found\n");  
1242 - return -1;  
1243 - }  
1244 -  
1245 - AVStream *video_stream = input_format_context->streams[stream_index];  
1246 - codec = avcodec_find_decoder(video_stream->codecpar->codec_id);  
1247 - if (!codec) {  
1248 - fprintf(stderr, "Codec not found\n");  
1249 - return -1;  
1250 - }  
1251 -  
1252 - codec_context = avcodec_alloc_context3(codec);  
1253 - if (!codec_context) {  
1254 - fprintf(stderr, "Could not allocate codec context\n");  
1255 - return -1;  
1256 - }  
1257 -  
1258 - if (avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) {  
1259 - fprintf(stderr, "Failed to copy codec parameters to context\n");  
1260 - return -1;  
1261 - }  
1262 -  
1263 - if (avcodec_open2(codec_context, codec, NULL) < 0) {  
1264 - fprintf(stderr, "Error opening codec\n");  
1265 - return -1;  
1266 - }  
1267 -  
1268 - // UDP socket setup for RTP  
1269 - int sockfd = socket(AF_INET, SOCK_DGRAM, 0);  
1270 - if (sockfd < 0) {  
1271 - perror("Error opening UDP socket");  
1272 - return -1;  
1273 - }  
1274 -  
1275 - struct sockaddr_in dest_addr;  
1276 - memset(&dest_addr, 0, sizeof(dest_addr));  
1277 - dest_addr.sin_family = AF_INET;  
1278 - dest_addr.sin_port = htons(STREAM_PORT);  
1279 -  
1280 - // 使用 inet_pton 替换 inet_addr  
1281 - if (inet_pton(AF_INET, STREAM_ADDR, &dest_addr.sin_addr) <= 0) {  
1282 - perror("Invalid address/Address not supported");  
1283 - return -1;  
1284 - }  
1285 -  
1286 - // Initialize packet structure  
1287 - av_init_packet(&packet);  
1288 - packet.data = NULL;  
1289 - packet.size = 0;  
1290 -  
1291 - // Start reading and sending packets  
1292 - while (av_read_frame(input_format_context, &packet) >= 0) {  
1293 - if (packet.stream_index == stream_index) {  
1294 - // Send H.264 stream as RTP packet  
1295 - if (sendto(sockfd, packet.data, packet.size, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) < 0) {  
1296 - perror("Error sending RTP packet");  
1297 - return -1;  
1298 - }  
1299 - }  
1300 -  
1301 - av_packet_unref(&packet);  
1302 - }  
1303 -  
1304 - // Clean up and close the socket  
1305 - close(sockfd);  
1306 - avcodec_free_context(&codec_context);  
1307 - avformat_close_input(&input_format_context);  
1308 -  
1309 - return 0;  
1310 -}  
1311 -  
1312 184
  185 +#ifdef FFMPEG_INSTALLED
1313 #include <libavformat/avformat.h> 186 #include <libavformat/avformat.h>
1314 #include <libavcodec/avcodec.h> 187 #include <libavcodec/avcodec.h>
1315 #include <libavutil/opt.h> 188 #include <libavutil/opt.h>
1316 #include <libavutil/avutil.h> 189 #include <libavutil/avutil.h>
1317 -#include <libavdevice/avdevice.h>  
1318 #include <stdio.h> 190 #include <stdio.h>
1319 #include <stdlib.h> 191 #include <stdlib.h>
1320 #include <string.h> 192 #include <string.h>
@@ -1325,15 +197,17 @@ void* push_video_stream7(void* arg) @@ -1325,15 +197,17 @@ void* push_video_stream7(void* arg)
1325 #define STREAM_PORT 9600 197 #define STREAM_PORT 9600
1326 #define STREAM_ADDR "127.0.0.1" 198 #define STREAM_ADDR "127.0.0.1"
1327 #define INPUT_FILE "/home/levi/Videos/test.h264" // Replace with your actual video file path 199 #define INPUT_FILE "/home/levi/Videos/test.h264" // Replace with your actual video file path
  200 +#define INPUT_FILE2 "test.h264"
  201 +
  202 +#endif
1328 203
1329 void* push_video_stream8(void* arg) 204 void* push_video_stream8(void* arg)
1330 { 205 {
1331 -  
1332 - 206 +#if defined(FFMPEG_INSTALLED) && (LIBAVFORMAT_VERSION_MAJOR >= 57)
1333 while(1){ 207 while(1){
1334 208
1335 // Initialize FFmpeg libraries 209 // Initialize FFmpeg libraries
1336 - av_register_all(); 210 + // av_register_all();
1337 avformat_network_init(); 211 avformat_network_init();
1338 212
1339 AVFormatContext *input_format_context = NULL; 213 AVFormatContext *input_format_context = NULL;
@@ -1341,18 +215,34 @@ void* push_video_stream8(void* arg) @@ -1341,18 +215,34 @@ void* push_video_stream8(void* arg)
1341 AVCodec *codec = NULL; 215 AVCodec *codec = NULL;
1342 AVPacket packet; 216 AVPacket packet;
1343 217
1344 - printf("input file: %s\n", INPUT_FILE); 218 + char cwd[256] = {0};
  219 + char file_path[256] = {0};
  220 + getcwd(cwd, sizeof(cwd));
  221 + sprintf(file_path, "%s/%s", cwd, INPUT_FILE2);
  222 +
  223 +
  224 + char input_file[256] = {0};
  225 +
  226 + if (access(file_path, F_OK) == 0) {
  227 + memcpy(input_file, file_path, strlen(file_path));
  228 + USER_LOG_INFO("select: %s", file_path);
  229 + } else {
  230 + memcpy(input_file, INPUT_FILE, strlen(INPUT_FILE));
  231 + USER_LOG_INFO("select: %s", INPUT_FILE);
  232 + }
  233 +
  234 + USER_LOG_INFO("input file: %s", input_file);
1345 235
1346 // Open the input MP4 file 236 // Open the input MP4 file
1347 - if (avformat_open_input(&input_format_context, INPUT_FILE, NULL, NULL) < 0) { 237 + if (avformat_open_input(&input_format_context, input_file, NULL, NULL) < 0) {
1348 fprintf(stderr, "Error opening input file\n"); 238 fprintf(stderr, "Error opening input file\n");
1349 - return -1; 239 + return NULL;
1350 } 240 }
1351 241
1352 // Retrieve stream information 242 // Retrieve stream information
1353 if (avformat_find_stream_info(input_format_context, NULL) < 0) { 243 if (avformat_find_stream_info(input_format_context, NULL) < 0) {
1354 fprintf(stderr, "Error finding stream info\n"); 244 fprintf(stderr, "Error finding stream info\n");
1355 - return -1; 245 + return NULL;
1356 } 246 }
1357 247
1358 // Find the video stream 248 // Find the video stream
@@ -1366,7 +256,7 @@ void* push_video_stream8(void* arg) @@ -1366,7 +256,7 @@ void* push_video_stream8(void* arg)
1366 256
1367 if (video_stream_index == -1) { 257 if (video_stream_index == -1) {
1368 fprintf(stderr, "Video stream not found\n"); 258 fprintf(stderr, "Video stream not found\n");
1369 - return -1; 259 + return NULL;
1370 } 260 }
1371 261
1372 // Find the decoder for the video stream 262 // Find the decoder for the video stream
@@ -1374,23 +264,23 @@ void* push_video_stream8(void* arg) @@ -1374,23 +264,23 @@ void* push_video_stream8(void* arg)
1374 codec = avcodec_find_decoder(video_stream->codecpar->codec_id); 264 codec = avcodec_find_decoder(video_stream->codecpar->codec_id);
1375 if (!codec) { 265 if (!codec) {
1376 fprintf(stderr, "Codec not found\n"); 266 fprintf(stderr, "Codec not found\n");
1377 - return -1; 267 + return NULL;
1378 } 268 }
1379 269
1380 codec_context = avcodec_alloc_context3(codec); 270 codec_context = avcodec_alloc_context3(codec);
1381 if (!codec_context) { 271 if (!codec_context) {
1382 fprintf(stderr, "Could not allocate codec context\n"); 272 fprintf(stderr, "Could not allocate codec context\n");
1383 - return -1; 273 + return NULL;
1384 } 274 }
1385 275
1386 if (avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) { 276 if (avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) {
1387 fprintf(stderr, "Failed to copy codec parameters to context\n"); 277 fprintf(stderr, "Failed to copy codec parameters to context\n");
1388 - return -1; 278 + return NULL;
1389 } 279 }
1390 280
1391 if (avcodec_open2(codec_context, codec, NULL) < 0) { 281 if (avcodec_open2(codec_context, codec, NULL) < 0) {
1392 fprintf(stderr, "Error opening codec\n"); 282 fprintf(stderr, "Error opening codec\n");
1393 - return -1; 283 + return NULL;
1394 } 284 }
1395 285
1396 // Initialize packet structure 286 // Initialize packet structure
@@ -1416,320 +306,11 @@ void* push_video_stream8(void* arg) @@ -1416,320 +306,11 @@ void* push_video_stream8(void* arg)
1416 avformat_close_input(&input_format_context); 306 avformat_close_input(&input_format_context);
1417 } 307 }
1418 308
  309 +#endif
1419 return 0; 310 return 0;
1420 } 311 }
1421 312
1422 313
1423 -#include <libavformat/avformat.h>  
1424 -#include <libavcodec/avcodec.h>  
1425 -#include <libavutil/opt.h>  
1426 -#include <libavutil/avutil.h>  
1427 -#include <libavdevice/avdevice.h>  
1428 -#include <stdio.h>  
1429 -#include <stdlib.h>  
1430 -#include <string.h>  
1431 -#include <unistd.h>  
1432 -#include <netinet/in.h>  
1433 -#include <arpa/inet.h>  
1434 -  
1435 -  
1436 -void* push_video_stream9(void* arg)  
1437 -{  
1438 - // Initialize FFmpeg libraries  
1439 - av_register_all();  
1440 - avformat_network_init();  
1441 -  
1442 - AVFormatContext *input_format_context = NULL;  
1443 - AVCodecContext *codec_context = NULL;  
1444 - AVCodec *codec = NULL;  
1445 - AVPacket packet;  
1446 -  
1447 - printf("input file: %s\n", INPUT_FILE);  
1448 -  
1449 - // Open the input H.264 file  
1450 - if (avformat_open_input(&input_format_context, INPUT_FILE, NULL, NULL) < 0) {  
1451 - fprintf(stderr, "Error opening input file\n");  
1452 - return -1;  
1453 - }  
1454 -  
1455 - // Retrieve stream information  
1456 - if (avformat_find_stream_info(input_format_context, NULL) < 0) {  
1457 - fprintf(stderr, "Error finding stream info\n");  
1458 - return -1;  
1459 - }  
1460 -  
1461 - // Find the video stream  
1462 - int video_stream_index = -1;  
1463 - for (int i = 0; i < input_format_context->nb_streams; i++) {  
1464 - if (input_format_context->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
1465 - video_stream_index = i;  
1466 - break;  
1467 - }  
1468 - }  
1469 -  
1470 - if (video_stream_index == -1) {  
1471 - fprintf(stderr, "Video stream not found\n");  
1472 - return -1;  
1473 - }  
1474 -  
1475 - // Find the decoder for the video stream  
1476 - AVStream *video_stream = input_format_context->streams[video_stream_index];  
1477 - codec = avcodec_find_decoder(video_stream->codecpar->codec_id);  
1478 - if (!codec) {  
1479 - fprintf(stderr, "Codec not found\n");  
1480 - return -1;  
1481 - }  
1482 -  
1483 - codec_context = avcodec_alloc_context3(codec);  
1484 - if (!codec_context) {  
1485 - fprintf(stderr, "Could not allocate codec context\n");  
1486 - return -1;  
1487 - }  
1488 -  
1489 - if (avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) {  
1490 - fprintf(stderr, "Failed to copy codec parameters to context\n");  
1491 - return -1;  
1492 - }  
1493 -  
1494 - if (avcodec_open2(codec_context, codec, NULL) < 0) {  
1495 - fprintf(stderr, "Error opening codec\n");  
1496 - return -1;  
1497 - }  
1498 -  
1499 - // TCP socket setup  
1500 - int sockfd = socket(AF_INET, SOCK_STREAM, 0);  
1501 - if (sockfd < 0) {  
1502 - perror("Error opening TCP socket");  
1503 - return -1;  
1504 - }  
1505 -  
1506 - struct sockaddr_in server_addr;  
1507 - memset(&server_addr, 0, sizeof(server_addr));  
1508 - server_addr.sin_family = AF_INET;  
1509 - server_addr.sin_port = htons(STREAM_PORT);  
1510 - server_addr.sin_addr.s_addr = INADDR_ANY;  
1511 -  
1512 - // Bind the socket to the address and port  
1513 - if (bind(sockfd, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0) {  
1514 - perror("Error binding socket");  
1515 - return -1;  
1516 - }  
1517 -  
1518 - // Listen for incoming connections  
1519 - if (listen(sockfd, 1) < 0) {  
1520 - perror("Error listening for connections");  
1521 - return -1;  
1522 - }  
1523 -  
1524 - printf("Waiting for client connection...\n");  
1525 -  
1526 - // Accept client connection  
1527 - int client_sockfd = accept(sockfd, NULL, NULL);  
1528 - if (client_sockfd < 0) {  
1529 - perror("Error accepting client connection");  
1530 - return -1;  
1531 - }  
1532 -  
1533 - printf("Client connected, sending video stream...\n");  
1534 -  
1535 - // Initialize packet structure  
1536 - av_init_packet(&packet);  
1537 - packet.data = NULL;  
1538 - packet.size = 0;  
1539 -  
1540 - // Start reading frames and send packets  
1541 - while (av_read_frame(input_format_context, &packet) >= 0) {  
1542 - if (packet.stream_index == video_stream_index) {  
1543 - // Send the H.264 encoded packet to the client over TCP  
1544 - if (send(client_sockfd, packet.data, packet.size, 0) < 0) {  
1545 - perror("Error sending TCP packet");  
1546 - return -1;  
1547 - }  
1548 - printf("Sent packet of size %d\n", packet.size);  
1549 - usleep(1000 * 30); // simulate 30fps  
1550 - }  
1551 -  
1552 - // Free the packet after sending  
1553 - av_packet_unref(&packet);  
1554 - }  
1555 -  
1556 - // Clean up and close  
1557 - close(client_sockfd);  
1558 - close(sockfd);  
1559 - avcodec_free_context(&codec_context);  
1560 - avformat_close_input(&input_format_context);  
1561 -  
1562 - return 0;  
1563 -}  
1564 -  
1565 -  
1566 -void* push_video_stream10(void* arg)  
1567 -{  
1568 - // Initialize FFmpeg libraries  
1569 - av_register_all();  
1570 - avformat_network_init();  
1571 -  
1572 - AVFormatContext *input_format_context = NULL;  
1573 - AVCodecContext *codec_context = NULL;  
1574 - AVCodec *codec = NULL;  
1575 - AVPacket packet;  
1576 -  
1577 - printf("input file: %s\n", INPUT_FILE);  
1578 -  
1579 - // Open the input H.264 file  
1580 - if (avformat_open_input(&input_format_context, INPUT_FILE, NULL, NULL) < 0) {  
1581 - fprintf(stderr, "Error opening input file\n");  
1582 - return -1;  
1583 - }  
1584 -  
1585 - // Retrieve stream information  
1586 - if (avformat_find_stream_info(input_format_context, NULL) < 0) {  
1587 - fprintf(stderr, "Error finding stream info\n");  
1588 - return -1;  
1589 - }  
1590 -  
1591 - // Find the video stream  
1592 - int video_stream_index = -1;  
1593 - for (int i = 0; i < input_format_context->nb_streams; i++) {  
1594 - if (input_format_context->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {  
1595 - video_stream_index = i;  
1596 - break;  
1597 - }  
1598 - }  
1599 -  
1600 - if (video_stream_index == -1) {  
1601 - fprintf(stderr, "Video stream not found\n");  
1602 - return -1;  
1603 - }  
1604 -  
1605 - // Find the decoder for the video stream  
1606 - AVStream *video_stream = input_format_context->streams[video_stream_index];  
1607 - codec = avcodec_find_decoder(video_stream->codecpar->codec_id);  
1608 - if (!codec) {  
1609 - fprintf(stderr, "Codec not found\n");  
1610 - return -1;  
1611 - }  
1612 -  
1613 - codec_context = avcodec_alloc_context3(codec);  
1614 - if (!codec_context) {  
1615 - fprintf(stderr, "Could not allocate codec context\n");  
1616 - return -1;  
1617 - }  
1618 -  
1619 - if (avcodec_parameters_to_context(codec_context, video_stream->codecpar) < 0) {  
1620 - fprintf(stderr, "Failed to copy codec parameters to context\n");  
1621 - return -1;  
1622 - }  
1623 -  
1624 - if (avcodec_open2(codec_context, codec, NULL) < 0) {  
1625 - fprintf(stderr, "Error opening codec\n");  
1626 - return -1;  
1627 - }  
1628 -  
1629 - // TCP socket setup  
1630 - T_ZiyanSocketHandle socket_handle = NULL;  
1631 - T_ZiyanReturnCode result = ZiyanPlatform_GetSocketHandler()->Socket(ZIYAN_SOCKET_MODE_TCP, &socket_handle);  
1632 - printf("Socket result: %d\n", result);  
1633 - if (result != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
1634 - perror("Error opening TCP socket");  
1635 - return -1;  
1636 - }  
1637 -  
1638 - // Bind the socket to the address and port  
1639 - if (ZiyanPlatform_GetSocketHandler()->Bind(socket_handle, "0.0.0.0", 9600) != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
1640 - perror("Error binding socket");  
1641 - return -1;  
1642 - }  
1643 -  
1644 - // Listen for incoming connections  
1645 - if (ZiyanPlatform_GetSocketHandler()->TcpListen(socket_handle) != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
1646 - perror("Error listening for connections");  
1647 - return -1;  
1648 - }  
1649 -  
1650 - printf("Waiting for client connection...\n");  
1651 -  
1652 - // Accept client connection  
1653 - char accept_ip[32] = "";  
1654 - uint32_t accept_port = 0;  
1655 - T_ZiyanSocketHandle accept_socket_handle = NULL;  
1656 - if (ZiyanPlatform_GetSocketHandler()->TcpAccept(socket_handle, accept_ip, &accept_port, &accept_socket_handle) != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
1657 - perror("Error accepting client connection");  
1658 - return -1;  
1659 - }  
1660 -  
1661 - printf("Client connected %s:%d, sending video stream...\n", accept_ip, accept_port);  
1662 -  
1663 - // Initialize packet structure  
1664 - av_init_packet(&packet);  
1665 - packet.data = NULL;  
1666 - packet.size = 0;  
1667 -  
1668 - // Start reading frames and send packets  
1669 - while (av_read_frame(input_format_context, &packet) >= 0) {  
1670 - if (packet.stream_index == video_stream_index) {  
1671 - // Send the H.264 encoded packet to the client over TCP  
1672 - uint32_t real_len = 0;  
1673 - if (ZiyanPlatform_GetSocketHandler()->TcpSendData(accept_socket_handle, packet.data, packet.size, &real_len) != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
1674 - perror("Error sending TCP packet");  
1675 - return -1;  
1676 - }  
1677 - printf("Sent packet of size %d : %d\n", packet.size, real_len);  
1678 - usleep(1000 * 30); // simulate 30fps  
1679 - }  
1680 -  
1681 - // Free the packet after sending  
1682 - av_packet_unref(&packet);  
1683 - }  
1684 -  
1685 - // Clean up and close  
1686 - avcodec_free_context(&codec_context);  
1687 - avformat_close_input(&input_format_context);  
1688 -  
1689 - return 0;  
1690 -}  
1691 -  
1692 -  
1693 -  
1694 -  
1695 -  
1696 -  
1697 -  
1698 -  
1699 -  
1700 -  
1701 -  
1702 -  
1703 -  
1704 -#endif  
1705 -  
1706 -  
1707 -/*****************************************************************************/  
1708 -  
1709 -  
1710 -  
1711 -  
1712 -  
1713 -  
1714 -  
1715 -  
1716 -  
1717 -  
1718 -  
1719 -  
1720 -  
1721 -  
1722 -  
1723 -  
1724 -  
1725 -  
1726 -  
1727 -  
1728 -  
1729 -  
1730 -  
1731 -  
1732 -  
1733 314
1734 315
1735 static T_ZiyanReturnCode GetSystemState(T_ZiyanCameraSystemState *systemState) 316 static T_ZiyanReturnCode GetSystemState(T_ZiyanCameraSystemState *systemState)
@@ -2900,23 +1481,20 @@ T_ZiyanReturnCode ZiyanTest_CameraEmuBaseStartService(void) @@ -2900,23 +1481,20 @@ T_ZiyanReturnCode ZiyanTest_CameraEmuBaseStartService(void)
2900 } 1481 }
2901 #endif 1482 #endif
2902 1483
2903 - s_extendHander.GetRangeFinderSwitch = GetRangeFinderSwitch;  
2904 - s_extendHander.SetRangeFinderSwitch = SetRangeFinderSwitch;  
2905 - s_extendHander.GetRangeFinderData = GetRangeFinderData;  
2906 - s_extendHander.GetRangeFinderLocation = GetRangeFinderLocation; 1484 + s_rangeFinderHander.GetRangeFinderSwitch = GetRangeFinderSwitch;
  1485 + s_rangeFinderHander.SetRangeFinderSwitch = SetRangeFinderSwitch;
  1486 + s_rangeFinderHander.GetRangeFinderData = GetRangeFinderData;
  1487 + s_rangeFinderHander.GetRangeFinderLocation = GetRangeFinderLocation;
2907 1488
2908 - returnCode = ZiyanPayloadCamera_RegExtendHandler(&s_extendHander); 1489 + returnCode = ZiyanPayloadCamera_RegRangeFinderHandler(&s_rangeFinderHander);
2909 if (returnCode != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { 1490 if (returnCode != ZIYAN_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
2910 - USER_LOG_ERROR("camera register extend handler error:0x%08llX", returnCode); 1491 + USER_LOG_ERROR("camera register range finder handler error:0x%08llX", returnCode);
2911 return returnCode; 1492 return returnCode;
2912 } 1493 }
2913 -  
2914 1494
2915 - //修改位  
2916 -  
2917 - // T_ZiyanTaskHandle handle_test;  
2918 - // osalHandler->TaskCreate("camera_vedio_task", push_video_stream8,  
2919 - // PAYLOAD_CAMERA_EMU_TASK_STACK_SIZE, NULL, &handle_test); 1495 + T_ZiyanTaskHandle handle_test;
  1496 + osalHandler->TaskCreate("camera_vedio_task", push_video_stream8,
  1497 + PAYLOAD_CAMERA_EMU_TASK_STACK_SIZE, NULL, &handle_test);
2920 1498
2921 /* Create the camera emu taskHandle */ 1499 /* Create the camera emu taskHandle */
2922 if (osalHandler->TaskCreate("user_camera_task", UserCamera_Task, 1500 if (osalHandler->TaskCreate("user_camera_task", UserCamera_Task,