作者 ookk303

独立了tts的滤波选项

@@ -119,7 +119,10 @@ @@ -119,7 +119,10 @@
119 "volumelimit.h": "c", 119 "volumelimit.h": "c",
120 "megaphone_realtimemp2.h": "c", 120 "megaphone_realtimemp2.h": "c",
121 "jzirc_lib.h": "c", 121 "jzirc_lib.h": "c",
122 - "hardwareinfo.h": "c" 122 + "hardwareinfo.h": "c",
  123 + "jzsdk_attributedef.h": "c",
  124 + "msp_types.h": "c",
  125 + "attribute.h": "c"
123 }, 126 },
124 "Codegeex.GenerationPreference": "automatic", 127 "Codegeex.GenerationPreference": "automatic",
125 "C_Cpp.dimInactiveRegions": false 128 "C_Cpp.dimInactiveRegions": false
1 # 编译链的配置 1 # 编译链的配置
2 2
3 #1、编译链与设备类型的选择 3 #1、编译链与设备类型的选择
4 -set(DEVICE_NAME JZ_U3) 4 +set(DEVICE_NAME JZ_H1T)
5 #上一行为禁止修改行 5 #上一行为禁止修改行
6 6
7 message("**************************JZSDK构建编译开始***************************\n") 7 message("**************************JZSDK构建编译开始***************************\n")
@@ -20,9 +20,12 @@ extern "C" { @@ -20,9 +20,12 @@ extern "C" {
20 /* 常亮定义*/ 20 /* 常亮定义*/
21 21
22 #include "./JZsdk_typedef/JZsdk_typedef.h" 22 #include "./JZsdk_typedef/JZsdk_typedef.h"
  23 +#include "./JZsdk_typedef/JZsdk_AttributeDef.h"
  24 +
23 #include "./JZsdk_ReturnCode/JZsdk_ReturnCode.h" 25 #include "./JZsdk_ReturnCode/JZsdk_ReturnCode.h"
24 #include "./JZsdk_Platform/JZsdk_Platform.h" 26 #include "./JZsdk_Platform/JZsdk_Platform.h"
25 27
  28 +
26 #include "./JZsdk_InsCode.h" 29 #include "./JZsdk_InsCode.h"
27 #include "./JZsdk_FLagCode.h" 30 #include "./JZsdk_FLagCode.h"
28 #include "./JZsdk_WidgetCode.h" 31 #include "./JZsdk_WidgetCode.h"
  1 +/**
  2 + ********************************************************************
  3 + * @file JZsdk_AttributeDef.h
  4 + * 用于记录属性的表
  5 + *
  6 + *********************************************************************
  7 + */
  8 +
  9 +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
  10 +#ifndef JZSDK_ATTRIBUTEDEF_H
  11 +#define JZSDK_ATTRIBUTEDEF_H
  12 +
  13 +/* Includes ------------------------------------------------------------------*/
  14 +#include "./JZsdk_typedef.h"
  15 +
  16 +
  17 +#ifdef __cplusplus
  18 +extern "C" {
  19 +#endif
  20 +
  21 +/* Exported constants --------------------------------------------------------*/
  22 +/* 常亮定义*/
  23 +
  24 +
  25 +/* Exported types ------------------------------------------------------------*/
  26 +
  27 +
  28 +
  29 +//GPS时间
  30 +typedef U32_t T_JZsdkAttributeGpsTime;
  31 +
  32 +//GPS日期
  33 +typedef U32_t T_JZsdkAttributeGpsDate;
  34 +
  35 +//gps经度
  36 +typedef T_JZsdkVector3d T_JZsdkAttributeGpsPosition;
  37 +
  38 +/* Exported functions --------------------------------------------------------*/
  39 +
  40 +
  41 +
  42 +#ifdef __cplusplus
  43 +}
  44 +#endif
  45 +
  46 +#endif
@@ -60,6 +60,33 @@ typedef void *T_JZsdkFileHandle; @@ -60,6 +60,33 @@ typedef void *T_JZsdkFileHandle;
60 typedef void *T_JZsdkDirHandle; 60 typedef void *T_JZsdkDirHandle;
61 61
62 62
  63 +
  64 +typedef struct T_JZsdkVector3d
  65 +{
  66 + int x;
  67 + int y;
  68 + int z;
  69 +}T_JZsdkVector3d;
  70 +
  71 +typedef struct T_JZsdkVector3f
  72 +{
  73 + F32_t x;
  74 + F32_t y;
  75 + F32_t z;
  76 +}T_JZsdkVector3f;
  77 +
  78 +typedef struct {
  79 + int pitch; /*!< Specifies int32 value of pitch for attitude. */
  80 + int roll; /*!< Specifies int32 value of roll for attitude */
  81 + int yaw; /*!< Specifies int32 value of yaw for attitude */
  82 +} T_JZsdkAttitude3d;
  83 +
  84 +typedef struct {
  85 + F32_t pitch; /*!< Specifies float value of pitch for attitude. */
  86 + F32_t roll; /*!< Specifies float value of roll for attitude */
  87 + F32_t yaw; /*!< Specifies float value of yaw for attitude */
  88 +} T_JZsdkAttitude3f;
  89 +
63 /* Exported types ------------------------------------------------------------*/ 90 /* Exported types ------------------------------------------------------------*/
64 91
65 92
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
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_U3 10 +#define DEVICE_VERSION JZ_H1T
11 11
12 //禁止修改行 选择是串口程序 还是 psdk程序 12 //禁止修改行 选择是串口程序 还是 psdk程序
13 #define APP_VERSION APP_UART 13 #define APP_VERSION APP_UART
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 #define FILTERING_TYPE HIGH_PASS_FILTERING 25 #define FILTERING_TYPE HIGH_PASS_FILTERING
26 26
27 //禁止修改行固件属地 目前 国内版/海外版 27 //禁止修改行固件属地 目前 国内版/海外版
28 -#define FIRMWARE_ORIGIN OVERSEAS_VERSION 28 +#define FIRMWARE_ORIGIN DOMESTIC_VERSION
29 29
30 //禁止修改行指定特殊固件 30 //禁止修改行指定特殊固件
31 #define SPECIAL_VERSION SPECIAL_NORMAL 31 #define SPECIAL_VERSION SPECIAL_NORMAL
@@ -135,6 +135,7 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, int DataLen, i @@ -135,6 +135,7 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, int DataLen, i
135 { 135 {
136 FrameFlag = 0x00; 136 FrameFlag = 0x00;
137 } 137 }
  138 + break;
138 } 139 }
139 140
140 default: 141 default:
@@ -38,7 +38,7 @@ static int TTS_RecvBufferLen = 0; @@ -38,7 +38,7 @@ static int TTS_RecvBufferLen = 0;
38 38
39 static T_JZsdkReturnCode HalRecv_tpye1_RecvDeal_Set_UartReceiveMode(int Port, int value); 39 static T_JZsdkReturnCode HalRecv_tpye1_RecvDeal_Set_UartReceiveMode(int Port, int value);
40 static T_JZsdkReturnCode HalRecv_tpye1_RecvDeal_UartTransmodeDecide(); 40 static T_JZsdkReturnCode HalRecv_tpye1_RecvDeal_UartTransmodeDecide();
41 - 41 +static T_JZsdkMutexHandle GetMusicList_MutexHandle = NULL;
42 42
43 /******************************************************************************************************** 43 /********************************************************************************************************
44 ********* ********| 44 ********* ********|
@@ -878,6 +878,13 @@ static T_JZsdkReturnCode RecvDeal_audio_NextSong(int Port, char *getbuf) @@ -878,6 +878,13 @@ static T_JZsdkReturnCode RecvDeal_audio_NextSong(int Port, char *getbuf)
878 static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf) 878 static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf)
879 { 879 {
880 T_JZsdkReturnCode ret; 880 T_JZsdkReturnCode ret;
  881 + T_JZsdkOsalHandler *OsalHandler = JZsdk_Platform_GetOsalHandler();
  882 + if (GetMusicList_MutexHandle == NULL)
  883 + {
  884 + OsalHandler->MutexCreate(&GetMusicList_MutexHandle);
  885 + }
  886 +
  887 + OsalHandler->MutexLock(GetMusicList_MutexHandle);
881 888
882 JZSDK_LOG_INFO("%s,获取音乐列表",JZsdk_DefineCode_GetPortName(Port)); 889 JZSDK_LOG_INFO("%s,获取音乐列表",JZsdk_DefineCode_GetPortName(Port));
883 int music_sum = 0; 890 int music_sum = 0;
@@ -888,7 +895,12 @@ static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf) @@ -888,7 +895,12 @@ static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf)
888 #ifdef MEGAPHONE_CONFIG_STATUS_ON 895 #ifdef MEGAPHONE_CONFIG_STATUS_ON
889 896
890 //刷新歌曲列表 897 //刷新歌曲列表
891 - Megaphone_Flush_MusicList(); 898 + ret = Megaphone_Flush_MusicList();
  899 + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
  900 + {
  901 + HalSend_type1Send_Reply_Failure(Port, FrameSequence);
  902 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  903 + }
892 904
893 //解析获取的类型 905 //解析获取的类型
894 int type = getbuf[9]; 906 int type = getbuf[9];
@@ -1009,6 +1021,8 @@ static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf) @@ -1009,6 +1021,8 @@ static T_JZsdkReturnCode RecvDeal_audio_GetMusicList(int Port, char *getbuf)
1009 1021
1010 #endif 1022 #endif
1011 1023
  1024 + OsalHandler->MutexUnlock(GetMusicList_MutexHandle);
  1025 +
1012 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 1026 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
1013 } 1027 }
1014 1028
@@ -3519,9 +3533,9 @@ static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbu @@ -3519,9 +3533,9 @@ static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbu
3519 } 3533 }
3520 3534
3521 // 提取年、月、日 3535 // 提取年、月、日
3522 - int year = tm_info->tm_year + 1900; // 注意:tm_year是从1900年开始的 3536 + int year = tm_info->tm_year + 1980; // 注意:tm_year是从1980年开始的
3523 int month = tm_info->tm_mon + 1; // 注意:tm_mon是从0开始的(0=1月,11=12月) 3537 int month = tm_info->tm_mon + 1; // 注意:tm_mon是从0开始的(0=1月,11=12月)
3524 - int day = tm_info->tm_mday; 3538 + int day = tm_info->tm_mday + 6;
3525 3539
3526 JZSDK_LOG_INFO("获得年份: %d, 月份: %d, 日期: %d", year, month, day); 3540 JZSDK_LOG_INFO("获得年份: %d, 月份: %d, 日期: %d", year, month, day);
3527 3541
@@ -3534,6 +3548,9 @@ static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbu @@ -3534,6 +3548,9 @@ static T_JZsdkReturnCode RecvDeal_ObtainTimeStamp(int Port, unsigned char *getbu
3534 JZSDK_LOG_ERROR("设置系统时间失败"); 3548 JZSDK_LOG_ERROR("设置系统时间失败");
3535 } 3549 }
3536 3550
  3551 + //设置gps时间
  3552 + Attribute_SetGpsTime((T_JZsdkAttributeGpsTime)TimeStamp);
  3553 +
3537 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 3554 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
3538 } 3555 }
3539 3556
@@ -3886,6 +3903,7 @@ static T_JZsdkReturnCode RecvDeal_QuerySecondaryDeviceName(int Port, char *getbu @@ -3886,6 +3903,7 @@ static T_JZsdkReturnCode RecvDeal_QuerySecondaryDeviceName(int Port, char *getbu
3886 3903
3887 //2、获取当前从设备名 3904 //2、获取当前从设备名
3888 int SecondaryName = SecondaryDeviceName; 3905 int SecondaryName = SecondaryDeviceName;
  3906 + JZSDK_LOG_INFO("当前从设备为:%d", SecondaryName);
3889 3907
3890 //3、回复当前从设备名 3908 //3、回复当前从设备名
3891 HalSend_type1Send_Reply_SecondaryDeviceName(Port ,SecondaryName, FrameSequence); 3909 HalSend_type1Send_Reply_SecondaryDeviceName(Port ,SecondaryName, FrameSequence);
@@ -115,8 +115,11 @@ T_JZsdkReturnCode AudioDeal_ResampleRest(unsigned int in_sampleRate, AVChannelLa @@ -115,8 +115,11 @@ T_JZsdkReturnCode AudioDeal_ResampleRest(unsigned int in_sampleRate, AVChannelLa
115 * 115 *
116 * pcm数据接入接口 116 * pcm数据接入接口
117 * 117 *
  118 + * Data Type = 0 为文本pcm
  119 + * Date Type = 1 为语音流pcm
  120 + *
118 * ************/ 121 * ************/
119 -T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, int bytesRead) 122 +T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, int bytesRead, int DataType)
120 { 123 {
121 if (AudioDeakInfo_index == NULL) 124 if (AudioDeakInfo_index == NULL)
122 { 125 {
@@ -136,7 +139,7 @@ T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, @@ -136,7 +139,7 @@ T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer,
136 //Set_AudioDeal_ResampleAndFilterAndPlay_Flag(AudioDeakInfo_index, JZ_FLAGCODE_ON); 139 //Set_AudioDeal_ResampleAndFilterAndPlay_Flag(AudioDeakInfo_index, JZ_FLAGCODE_ON);
137 140
138 //默认数据pcm接入口都是 单声道,16位 141 //默认数据pcm接入口都是 单声道,16位
139 - PCM_PooL_Interface_PcmData(AudioDeakInfo_index, In_Bitrate, (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, AV_SAMPLE_FMT_S16, buffer, bytesRead); 142 + PCM_PooL_Interface_PcmData(AudioDeakInfo_index, In_Bitrate, (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, AV_SAMPLE_FMT_S16, buffer, bytesRead, DataType);
140 //printf("Read %zu bytes from the PCM file.\n", bytesRead); 143 //printf("Read %zu bytes from the PCM file.\n", bytesRead);
141 144
142 //标志音频库已经结束,不过alsa库内有10组缓存,该标志位结束,只能认为重采样和滤波结束 145 //标志音频库已经结束,不过alsa库内有10组缓存,该标志位结束,只能认为重采样和滤波结束
@@ -145,32 +148,32 @@ T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, @@ -145,32 +148,32 @@ T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer,
145 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 148 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
146 } 149 }
147 150
148 -/***************************  
149 - *  
150 - * 无回复接口  
151 - *  
152 - * ************/  
153 -T_JZsdkReturnCode AudioDeal_PcmDataInput_WithoutReply(int In_Bitrate, unsigned char *buffer, int bytesRead)  
154 -{  
155 - if (AudioDeakInfo_index == NULL)  
156 - {  
157 - JZSDK_LOG_ERROR("音频处理器未注册");  
158 - return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;  
159 - }  
160 -  
161 - while (Audiodeal_status != JZ_FLAGCODE_ON)  
162 - {  
163 - delayMs(1);  
164 - }  
165 -  
166 - //1、打开音频库的处理标志位,该标志可以重复打开,只有强制关闭音频时,需要关闭该标志  
167 - AudioDeakInfo_index->AudioDeal_ResampleAndFilter_Execute_Flag = JZ_FLAGCODE_ON;  
168 -  
169 - //默认数据pcm接入口都是 单声道,16位  
170 - PCM_PooL_Interface_PcmData(AudioDeakInfo_index, In_Bitrate, (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, AV_SAMPLE_FMT_S16, buffer, bytesRead);  
171 -  
172 - return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;  
173 -} 151 +// /***************************
  152 +// *
  153 +// * 无回复接口
  154 +// *
  155 +// * ************/
  156 +// T_JZsdkReturnCode AudioDeal_PcmDataInput_WithoutReply(int In_Bitrate, unsigned char *buffer, int bytesRead)
  157 +// {
  158 +// if (AudioDeakInfo_index == NULL)
  159 +// {
  160 +// JZSDK_LOG_ERROR("音频处理器未注册");
  161 +// return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
  162 +// }
  163 +
  164 +// while (Audiodeal_status != JZ_FLAGCODE_ON)
  165 +// {
  166 +// delayMs(1);
  167 +// }
  168 +
  169 +// //1、打开音频库的处理标志位,该标志可以重复打开,只有强制关闭音频时,需要关闭该标志
  170 +// AudioDeakInfo_index->AudioDeal_ResampleAndFilter_Execute_Flag = JZ_FLAGCODE_ON;
  171 +
  172 +// //默认数据pcm接入口都是 单声道,16位
  173 +// PCM_PooL_Interface_PcmData(AudioDeakInfo_index, In_Bitrate, (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, AV_SAMPLE_FMT_S16, buffer, bytesRead);
  174 +
  175 +// return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  176 +// }
174 177
175 178
176 179
@@ -89,7 +89,7 @@ enum AudioDealPlayType @@ -89,7 +89,7 @@ enum AudioDealPlayType
89 89
90 /* Exported functions --------------------------------------------------------*/ 90 /* Exported functions --------------------------------------------------------*/
91 T_JZsdkReturnCode AudioDeal_Init(); 91 T_JZsdkReturnCode AudioDeal_Init();
92 -T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, int bytesRead); 92 +T_JZsdkReturnCode AudioDeal_PcmDataInput(int In_Bitrate, unsigned char *buffer, int bytesRead, int DataType);
93 T_JZsdkReturnCode AudioDeal_StopDeal(); 93 T_JZsdkReturnCode AudioDeal_StopDeal();
94 94
95 T_JZsdkReturnCode AudioDeal_FilePlayInput(unsigned char *FilePath); 95 T_JZsdkReturnCode AudioDeal_FilePlayInput(unsigned char *FilePath);
@@ -26,8 +26,8 @@ extern "C" { @@ -26,8 +26,8 @@ extern "C" {
26 26
27 27
28 /* Exported functions --------------------------------------------------------*/ 28 /* Exported functions --------------------------------------------------------*/
29 -int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize);  
30 -int PCM_PooL_Interface_PcmData_WithoutReply(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize); 29 +int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize, int dataType);
  30 +//int PCM_PooL_Interface_PcmData_WithoutReply(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize);
31 T_JZsdkReturnCode AudioFile_Stream_Interface_PcmData(struct AudioDealInfo *AD_Info, AVFrame *frame); 31 T_JZsdkReturnCode AudioFile_Stream_Interface_PcmData(struct AudioDealInfo *AD_Info, AVFrame *frame);
32 T_JZsdkReturnCode mp3_Stream_Interface_Mp3Data(struct AudioDealInfo *AD_Info, unsigned int in_sampleRate, unsigned char *data, int dataSize); 32 T_JZsdkReturnCode mp3_Stream_Interface_Mp3Data(struct AudioDealInfo *AD_Info, unsigned int in_sampleRate, unsigned char *data, int dataSize);
33 T_JZsdkReturnCode File_Stream_deal_Init(enum AVCodecID id); 33 T_JZsdkReturnCode File_Stream_deal_Init(enum AVCodecID id);
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 * pcm数据池子,pcm数据的接入接口 17 * pcm数据池子,pcm数据的接入接口
18 * 18 *
19 * ************/ 19 * ************/
20 -int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize) 20 +int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sampleRate, AVChannelLayout in_ch_layout, enum AVSampleFormat in_format , unsigned char* data, int dataSize, int dataType)
21 { 21 {
22 T_JZsdkReturnCode ret; 22 T_JZsdkReturnCode ret;
23 23
@@ -38,7 +38,14 @@ int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sam @@ -38,7 +38,14 @@ int PCM_PooL_Interface_PcmData(struct AudioDealInfo *AD_Info,unsigned int in_sam
38 FF_Resample_Reset(AD_Info, in_sampleRate, in_ch_layout, in_format); 38 FF_Resample_Reset(AD_Info, in_sampleRate, in_ch_layout, in_format);
39 39
40 //检查滤波器 40 //检查滤波器
  41 + if (dataType == 0x00)
  42 + {
41 FF_Filter_Init(AD_Info, 0x00); 43 FF_Filter_Init(AD_Info, 0x00);
  44 + }
  45 + else
  46 + {
  47 + FF_Filter_Init(AD_Info, 0x01);
  48 + }
42 49
43 int out_nb_samples = 0; //重采样输出的数据长度 50 int out_nb_samples = 0; //重采样输出的数据长度
44 int UnDeal_DataSize = dataSize; //未处理的数据长度 51 int UnDeal_DataSize = dataSize; //未处理的数据长度
@@ -152,21 +152,21 @@ typedef enum FilterList{ @@ -152,21 +152,21 @@ typedef enum FilterList{
152 152
153 //普通音频滤波参数 153 //普通音频滤波参数
154 #define FILTER_PARAM_NORMAL_AUDIO FILTER_FORMAL_3_AUDIO 154 #define FILTER_PARAM_NORMAL_AUDIO FILTER_FORMAL_3_AUDIO
  155 +
155 //普通TTS滤波参数 156 //普通TTS滤波参数
156 #define FILTER_PARAM_NORMAL_TTS FILTER_FORMAL_3_TTS 157 #define FILTER_PARAM_NORMAL_TTS FILTER_FORMAL_3_TTS
157 158
158 159
159 -  
160 -#define FILTER_PARAM_M30_TTS FILTER_FORMAL_1_M30_TTS  
161 -  
162 //h10t的滤波器跟其他的不一样,所以单独定义 160 //h10t的滤波器跟其他的不一样,所以单独定义
163 #if DEVICE_VERSION == JZ_H10T 161 #if DEVICE_VERSION == JZ_H10T
164 162
165 #define FILTER_PARAM_M30_AUDIO FILTER_FORMAL_1_M30_2 163 #define FILTER_PARAM_M30_AUDIO FILTER_FORMAL_1_M30_2
  164 +#define FILTER_PARAM_M30_TTS FILTER_FORMAL_1_M30_TTS
166 165
167 #else 166 #else
168 167
169 #define FILTER_PARAM_M30_AUDIO FILTER_FORMAL_1_M30_1 168 #define FILTER_PARAM_M30_AUDIO FILTER_FORMAL_1_M30_1
  169 +#define FILTER_PARAM_M30_TTS FILTER_FORMAL_1_M30_TTS
170 170
171 #endif 171 #endif
172 /* Exported types ------------------------------------------------------------*/ 172 /* Exported types ------------------------------------------------------------*/
  1 +#include "JZsdkLib.h"
  2 +#include <sys/time.h> // 对于 settimeofday 可能需要这个头文件
  3 +#include <time.h>
  4 +
  5 +#include "Attribute.h"
  6 +
  7 +static T_JZsdkAttributeGpsTime g_GpsTime = 0;
  8 +static T_JZsdkAttributeGpsDate g_GpsDate = 0;
  9 +static T_JZsdkAttributeGpsPosition g_GpsPositino = {0};
  10 +
  11 +// static int GpsYear = 0;
  12 +// static int GpsMonth = 0;
  13 +// static int GpsDay = 0;
  14 +// static int GpsHour = 0;
  15 +// static int GpsMinute = 0;
  16 +// static int GpsSecond = 0;
  17 +
  18 +T_JZsdkReturnCode Attribute_Init()
  19 +{
  20 +
  21 + int year = 0;
  22 + int month = 0;
  23 + int day = 0;
  24 + int hour = 0;
  25 + int minute = 0;
  26 + int second = 0;
  27 +
  28 + Attribute_GetTime_ByI(&year, &month, &day, &hour, &minute, &second);
  29 +
  30 + JZSDK_LOG_INFO("%d-%d-%d %d:%d:%d", year, month, day, hour, minute, second);
  31 +
  32 + JZSDK_LOG_INFO("Attribute_Init_Complete");
  33 +
  34 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  35 +}
  36 +
  37 +// 函数:获取GPS时间
  38 +// 返回值:T_JZsdkAttributeGpsTime类型的GPS时间
  39 +T_JZsdkAttributeGpsTime Attribute_GetGpsTime()
  40 +{
  41 + // 返回全局变量g_GpsTime的值
  42 + return g_GpsTime;
  43 +}
  44 +
  45 +// 设置GPS时间
  46 +T_JZsdkReturnCode Attribute_SetGpsTime(T_JZsdkAttributeGpsTime GpsTime)
  47 +{
  48 + // 将传入的参数GpsTime赋值给全局变量g_GpsTime
  49 + g_GpsTime = GpsTime;
  50 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  51 +}
  52 +
  53 +/********************************
  54 + *
  55 + * 获取gps的坐标值
  56 + *
  57 + * **************************/
  58 +T_JZsdkAttributeGpsPosition Attribute_GetGpsPosition()
  59 +{
  60 + // 返回全局变量g_GpsPositino的值
  61 + return g_GpsPositino;
  62 +}
  63 +
  64 +/********************************
  65 + *
  66 + * 设置gps的坐标值
  67 + *
  68 + * **************************/
  69 +T_JZsdkReturnCode Attribute_SetGpsPosition(T_JZsdkAttributeGpsPosition GpsPosition)
  70 +{
  71 + // 将传入的参数GpsPosition赋值给全局变量g_GpsPositino
  72 + g_GpsPositino = GpsPosition;
  73 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  74 +}
  75 +
  76 +/***********************
  77 + *
  78 + * 设置gps的日期
  79 + *
  80 + *
  81 + * *******************/
  82 +T_JZsdkReturnCode Attribute_SetGpsDate(T_JZsdkAttributeGpsDate GpsDate)
  83 +{
  84 + // 将传入的参数GpsDate赋值给全局变量g_GpsDate
  85 + g_GpsDate = GpsDate;
  86 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  87 +}
  88 +
  89 +/***********************
  90 + *
  91 + * 获取gps的日期
  92 + *
  93 + *
  94 + * *******************/
  95 +T_JZsdkAttributeGpsDate Attribute_GetGpsDate()
  96 +{
  97 + // 返回全局变量g_GpsDate的值
  98 + return g_GpsDate;
  99 +}
  100 +
  101 +// 函数定义
  102 +void decimal_to_dms(float decimal_degrees, char* dms_string, char direction)
  103 +{
  104 + int degrees = (int)decimal_degrees;
  105 + float decimal_minutes = fabs(decimal_degrees - degrees) * 60;
  106 + int minutes = (int)decimal_minutes;
  107 + float seconds = (decimal_minutes - minutes) * 60;
  108 +
  109 + // 格式化DMS字符串,保留两位小数
  110 + snprintf(dms_string, 50, "%d°%d'%.0f\"%c", abs(degrees), minutes, seconds, direction);
  111 +}
  112 +
  113 +/************************
  114 + *
  115 + * 获取gps显示的xyz值
  116 + *
  117 + *
  118 + * ****************************/
  119 +T_JZsdkReturnCode Attribute_GetGpsXYZ_ByStr(unsigned char *latitude, unsigned char *longitude, float *z)
  120 +{
  121 + float x = g_GpsPositino.x/10000000.0;
  122 + float y = g_GpsPositino.y/10000000.0;
  123 + *z = g_GpsPositino.z/10000000.0;
  124 +
  125 + char dmsX[50];
  126 + char dmsY[50];
  127 +
  128 + memset(dmsX, 0, sizeof(dmsX));
  129 + memset(dmsY, 0, sizeof(dmsY));
  130 +
  131 + // 调用函数将经度转换为DMS格式,并传入正确的方向字符
  132 + decimal_to_dms(x, dmsX, (g_GpsPositino.x >= 0) ? 'E' : 'W');
  133 + // 调用函数将纬度转换为DMS格式,并传入正确的方向字符
  134 + decimal_to_dms(y, dmsY, (g_GpsPositino.y >= 0) ? 'N' : 'S');
  135 +
  136 + // // 打印结果
  137 + // printf("%d %f 经度: %s\n",g_GpsPositino.x, x , dmsX);
  138 + // printf("%d %f 纬度: %s\n",g_GpsPositino.y, y , dmsY);
  139 +
  140 + memcpy(latitude, dmsX, strlen(dmsX));
  141 + memcpy(longitude, dmsY, strlen(dmsY));
  142 +
  143 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  144 +}
  145 +
  146 +
  147 +
  148 +
  149 +/************************
  150 + *
  151 + * 获取gps显示的度分秒值
  152 + *
  153 + *
  154 + * ****************************/
  155 +T_JZsdkReturnCode Attribute_GetGpsXYZ_ByF(float *x, float *y, float *z)
  156 +{
  157 + *x = g_GpsPositino.x/10000000.0;
  158 + *y = g_GpsPositino.y/10000000.0;
  159 + *z = g_GpsPositino.z/10000000.0;
  160 +
  161 + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
  162 +}
  163 +
  164 +/************************
  165 + *
  166 + * 获取显示的时间
  167 + *
  168 + *
  169 + * ***********************/
  170 +T_JZsdkReturnCode Attribute_GetTime_ByI(int *year, int *month, int *day, int *hour, int *minute, int *second)
  171 +{
  172 + // 转换为time_t(注意:这里假设TimeStamp是以秒为单位的Unix时间戳)
  173 + // 如果TimeStamp是以毫秒为单位的,你需要将其除以1000
  174 + time_t time_t_TimeStamp = (time_t)g_GpsTime; // 注意:这里可能会有截断,如果TimeStamp非常大
  175 +
  176 + // 使用localtime将time_t转换为tm结构体
  177 + struct tm *tm_info = localtime(&time_t_TimeStamp);
  178 + if (tm_info == NULL)
  179 + {
  180 + JZSDK_LOG_ERROR("时间转化失败");
  181 + return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
  182 + }
  183 +
  184 + *year = tm_info->tm_year + 1900;
  185 + *month = tm_info->tm_mon + 1;
  186 + *day = tm_info->tm_mday;
  187 +
  188 + *hour = tm_info->tm_hour;
  189 + *minute = tm_info->tm_min;
  190 + *second = tm_info->tm_sec;
  191 +
  192 + //JZSDK_LOG_INFO("获得年份: %d, 月份: %d, 日期: %d, 小时:%d, 分:%d 秒:%d", *year, *month, *day, *hour, *minute, *second);
  193 +}
  1 +/**
  2 + ********************************************************************
  3 + * @file Attribute.h
  4 + * Attribute.h 的头文件
  5 + *
  6 + *********************************************************************
  7 + */
  8 +
  9 +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
  10 +#ifndef ATTRIBUTE_H
  11 +#define ATTRIBUTE_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 types ------------------------------------------------------------*/
  24 +
  25 +/* Exported functions --------------------------------------------------------*/
  26 +T_JZsdkReturnCode Attribute_SetGpsTime(T_JZsdkAttributeGpsTime GpsTime);
  27 +T_JZsdkAttributeGpsTime Attribute_GetGpsTime();
  28 +
  29 +T_JZsdkReturnCode Attribute_SetGpsPosition(T_JZsdkAttributeGpsPosition GpsPosition);
  30 +T_JZsdkAttributeGpsPosition Attribute_GetGpsPosition();
  31 +
  32 +T_JZsdkReturnCode Attribute_SetGpsDate(T_JZsdkAttributeGpsDate GpsDate);
  33 +T_JZsdkAttributeGpsDate Attribute_GetGpsDate();
  34 +
  35 +T_JZsdkReturnCode Attribute_GetGpsXYZ_ByF(float *x, float *y, float *z);
  36 +T_JZsdkReturnCode Attribute_GetTime_ByI(int *year, int *month, int *day, int *hour, int *minute, int *second);
  37 +T_JZsdkReturnCode Attribute_GetGpsXYZ_ByStr(unsigned char *latitude, unsigned char *longitude, float *z);
  38 +
  39 +
  40 +#ifdef __cplusplus
  41 +}
  42 +#endif
  43 +
  44 +#endif
  1 +// /**
  2 +// 方案一:调用该文件中的对外函数输入参数国家码,可能需要更改获取序列号中地区码的部分代码,等待返回值即可,返回值:0 表明国家码与地区码一致。
  3 +// 方案二:调用该文件中的对外函数输入参数国家码、序列号中的地区码,等待返回值即可。
  4 +// */
  5 +// #include "FreeRTOS.h"
  6 +// #include "task.h"
  7 +// #include "Country_Code.h"
  8 +// #include "myflash.h"
  9 +// #include "dji_logger.h"
  10 +
  11 +
  12 +
  13 +// /*____________________________________________________ Country code array module ____________________________________________________*/
  14 +// #if 1 //国家码
  15 +// //4个有效数据
  16 +// uint16_t CN[] = { //中国
  17 +// 156, //中国大陆
  18 +// 344, //香港
  19 +// 446, //澳门
  20 +// 158, //台湾
  21 +// };
  22 +// //37个有效数据(国家码)
  23 +// uint16_t NA[] = { //美洲
  24 +// 3, //0; 国家码的百位为0~2的数据的位置<_*_*_>
  25 +// 17, //1; 国家码的百位为3~5的数据的位置<_*_*_>
  26 +// 32, //2; 国家码的百位为6~8的数据的位置<_*_*_>
  27 +
  28 +// 13, //3; 国家码的百位为0~2的数据的数量<_*_*_>
  29 +// 28, //4; 安提瓜和巴布达
  30 +// 44, //5; 巴哈马
  31 +// 52, //6; 巴巴多斯
  32 +// 60, //7; 百慕大(英国)
  33 +// 84, //8; 伯利兹
  34 +// 92, //9; 英属维尔京群岛
  35 +// 124, //10; 加拿大
  36 +// 136, //11; 开曼群岛(英国)
  37 +// 188, //12; 哥斯达黎加
  38 +// 192, //13; 古巴
  39 +// 212, //14; 多米尼克
  40 +// 214, //15; 多米尼加
  41 +// 222, //16; 萨尔瓦多
  42 +
  43 +// 14, //17; 国家码的百位为3~4的数据的数量<_*_*_>
  44 +// 304, //18; 格陵兰(丹麦)
  45 +// 308, //19; 格林纳达
  46 +// 312, //20; 瓜德罗普(法国)
  47 +// 320, //21; 危地马拉
  48 +// 332, //22; 海地
  49 +// 340, //23; 洪都拉斯
  50 +// 388, //24; 牙买加
  51 +// 474, //25; 马提尼克(法国)
  52 +// 484, //26; 墨西哥
  53 +// 500, //27; 蒙特塞拉特(英国)
  54 +// 530, //28; 荷属安的列斯
  55 +// 533, //29; 阿鲁巴(荷兰)
  56 +// 558, //30; 尼加拉瓜
  57 +// 591, //31; 巴拿马
  58 +
  59 +// 10, //32; 国家码的百位为6~8的数据的数量<_*_*_>
  60 +// 630, //33; 波多黎各(美国)
  61 +// 659, //34; 圣基茨和尼维斯
  62 +// 660, //35; 安圭拉(英国)
  63 +// 662, //36; 圣卢西亚
  64 +// 666, //37; 圣皮埃尔和密克隆(法国)
  65 +// 670, //38; 圣文森特和格林纳丁斯
  66 +// 780, //39; 特立尼达和多巴哥
  67 +// 796, //40; 特克斯和凯科斯群岛(英国)
  68 +// 840, //41; 美国
  69 +// 850, //42; 美属维尔京群岛
  70 +// };
  71 +
  72 +// //45个数据
  73 +// uint16_t EU[] = { //欧洲
  74 +// 3, //0; 国家码的百位为0~2的数据的位置<_*_*_>
  75 +// 19, //1; 国家码的百位为3~5的数据的位置<_*_*_>
  76 +// 36, //2; 国家码的百位为6~8的数据的位置<_*_*_>
  77 +
  78 +// 15, //3; 国家码的百位为0~2的数据的数量<_*_*_>
  79 +// 8, //4; 阿尔巴尼亚
  80 +// 20, //5; 安道尔
  81 +// 40, //6; 奥地利
  82 +// 56, //7; 比利时
  83 +// 100, //8; 保加利亚
  84 +// 112, //9; 白俄罗斯
  85 +// 191, //10; 克罗地亚
  86 +// 203, //11; 捷克
  87 +// 208, //12; 丹麦
  88 +// 233, //13; 爱沙尼亚
  89 +// 234, //14; 法罗群岛(丹麦)
  90 +// 246, //15; 芬兰
  91 +// 250, //16; 法国
  92 +// 276, //17; 德国
  93 +// 292, //18; 直布罗陀
  94 +
  95 +// 16, //19; 国家码的百位为3~5的数据的数量<_*_*_>
  96 +// 300, //20; 希腊
  97 +// 336, //21; 梵蒂冈
  98 +// 348, //22; 匈牙利
  99 +// 352, //23; 冰岛
  100 +// 372, //24; 爱尔兰
  101 +// 380, //25; 意大利
  102 +// 428, //26; 拉脱维亚
  103 +// 438, //27; 列支敦士登
  104 +// 440, //28; 立陶宛
  105 +// 442, //29; 卢森堡
  106 +// 470, //30; 马耳他
  107 +// 492, //31; 摩纳哥
  108 +// 498, //32; 摩尔多瓦
  109 +// 499, //33; 黑山
  110 +// 528, //34; 荷兰
  111 +// 578, //35; 挪威
  112 +
  113 +// 14, //36; 国家码的百位为6~8的数据的数量<_*_*_>
  114 +// 616, //37; 波兰
  115 +// 620, //38; 葡萄牙
  116 +// 642, //39; 罗马尼亚
  117 +// 643, //40; 俄罗斯联邦
  118 +// 674, //41; 圣马力诺
  119 +// 688, //42; 塞尔维亚
  120 +// 703, //43; 斯洛伐克
  121 +// 705, //44; 斯洛文尼亚
  122 +// 724, //45; 西班牙
  123 +// 752, //46; 瑞典
  124 +// 756, //47; 瑞士
  125 +// 792, //48; 土耳其欧洲部分
  126 +// 804, //49; 乌克兰
  127 +// 826, //50; 英国
  128 +// };
  129 +
  130 +// /*
  131 +// uint16_t AF[] = { //非洲
  132 +
  133 +// };
  134 +
  135 +// uint16_t OC[] = { //大洋洲
  136 +
  137 +// };
  138 +// */
  139 +// #endif
  140 +// /*____________________________________________________ Country code array module ____________________________________________________*/
  141 +
  142 +
  143 +
  144 +// //变量定义
  145 +// T_country_code_param country_code_Param[] = {
  146 +// {.name = "CN", .name_address = CN,},
  147 +// {.name = "NA", .name_address = NA,},
  148 +// {.name = "EU", .name_address = EU,},//新增区域时,在此处新增对应的区域名字符串,以及对应的国家码数组
  149 +// };
  150 +
  151 +
  152 +
  153 +// /*____________________________________________________ Country Code func module ____________________________________________________*/
  154 +// #if 1 //国家码比对函数模块
  155 +// /**
  156 +// @brief: 传入国家码结构体,判断是否与传入的国家码一致(返回0),不一致返回1
  157 +// @Param: code 国家码参数结构体
  158 +// @Param: CountryCode 国家码
  159 +// @return:no
  160 +// */
  161 +// static uint8_t IF_Country_Code(T_country_code_param * code , uint16_t CountryCode)
  162 +// {
  163 +// uint8_t i = 0;
  164 +// uint8_t hundred = 0;//存储传进参数的百位的值
  165 +// uint8_t hundred_address = 0;//存储传进参数的百位处在第X个元素的位置
  166 +// uint8_t number = 0;
  167 +
  168 +// hundred = CountryCode / 100;//取传进参数的百位在数组中的位置
  169 +// if(hundred <= 2)
  170 +// {
  171 +// hundred = 0;//存放国家码百位为0~2的数据所在位置的数组的第X个元素
  172 +// }else if(hundred >=3 && hundred <= 5)
  173 +// {
  174 +// hundred = 1;
  175 +// }else if(hundred >=6 && hundred <= 8)
  176 +// {
  177 +// hundred = 2;
  178 +// }
  179 +// hundred_address = code->name_address[hundred];//取国家码百位在X~X+2的数据的位置
  180 +// number = code->name_address[hundred_address];//取国家码百位在X~X+2的数据的数量
  181 +
  182 +// for(i = 0;i<number;i++)
  183 +// {
  184 +// if(CountryCode == code->name_address[hundred_address+(1+i)])//判断这些数据是否与传进参数一致
  185 +// {
  186 +// return 0;//对比成功,数组中存在该元素
  187 +// }else
  188 +// {
  189 +// }
  190 +// }
  191 +// return 1;//对比失败,数组中未存在该元素
  192 +// }
  193 +// /**
  194 +// @brief: 输入的国家码与序列号中的地区码相同即返回0;否返回1
  195 +// @Param: CountryCode 国家码
  196 +// @Param: xarea 序列号中的国家码(地区位)
  197 +// @return:0/1 成功/失败
  198 +// */
  199 +// #if 1 //方案二
  200 +// uint8_t Country_Code_handle(uint16_t CountryCode , char * xarea)
  201 +// {
  202 +// if(strcmp(xarea,country_code_Param[0].name) == 0)//中国地区
  203 +// {
  204 +// if(CountryCode == country_code_Param[0].name_address[0]
  205 +// || CountryCode == country_code_Param[0].name_address[1]
  206 +// || CountryCode == country_code_Param[0].name_address[2]
  207 +// || CountryCode == country_code_Param[0].name_address[3])//if(CountryCode == 156 || CountryCode == 344 || CountryCode == 446 || CountryCode == 158)
  208 +// {
  209 +// return 0;//返回成功
  210 +// }else
  211 +// {
  212 +// return 1;//返回不成功
  213 +// }
  214 +// }
  215 +// else if(strcmp(xarea,country_code_Param[1].name) == 0)//美洲地区
  216 +// {
  217 +// return IF_Country_Code(&country_code_Param[1],CountryCode);
  218 +// }
  219 +// else if(strcmp(xarea,country_code_Param[2].name) == 0)//欧洲地区
  220 +// {
  221 +// return IF_Country_Code(&country_code_Param[2],CountryCode);
  222 +// }
  223 +// else
  224 +// {
  225 +
  226 +// }
  227 +
  228 +// return 1;//返回不成功
  229 +// }
  230 +// #else //方案一
  231 +// uint8_t Country_Code_handle(uint16_t CountryCode)
  232 +// {
  233 +// uint8_t SN_Code[SN_LEN+2] = {0}; //暂时存储序列号
  234 +// char area[3] = {0};//保存序列号中的地区码
  235 +
  236 +// Read_SN_FromFlash(SN_Code,SN_LEN); //获取序列号
  237 +// SN_Code[16] = '\0';
  238 +// area[0] = SN_Code[4];
  239 +// area[1] = SN_Code[5];
  240 +// area[2] = '\0';
  241 +
  242 +// if(strcmp(area,country_code_Param[0].name) == 0)//
  243 +// {
  244 +// if(CountryCode == country_code_Param[0].name_address[0]
  245 +// || CountryCode == country_code_Param[0].name_address[0]
  246 +// || CountryCode == country_code_Param[0].name_address[0]
  247 +// || CountryCode == country_code_Param[0].name_address[0])//if(CountryCode == 156 || CountryCode == 344 || CountryCode == 446 || CountryCode == 158)
  248 +// {
  249 +// return 0;//返回成功
  250 +// }else
  251 +// {
  252 +// return 1;//返回不成功
  253 +// }
  254 +// }
  255 +// else if(strcmp(area,country_code_Param[1].name) == 0)
  256 +// {
  257 +// return IF_Country_Code(&country_code_Param[1],CountryCode);
  258 +// }
  259 +// else if(strcmp(area,country_code_Param[2].name) == 0)
  260 +// {
  261 +// return IF_Country_Code(&country_code_Param[2],CountryCode);
  262 +// }
  263 +// else
  264 +// {
  265 +
  266 +// }
  267 +
  268 +// return 1;//返回不成功
  269 +// }
  270 +// #endif
  271 +// #endif
  272 +// /*____________________________________________________ Country Code func module ____________________________________________________*/
  273 +
  274 +
  275 +
  276 +// /*____________________________________________________ "Country_Code_handle()" External call module ____________________________________________________*/
  277 +// #if 0 //国家码函数调用例子
  278 +// static void Country_Code_init(void)//方案二
  279 +// {
  280 +// uint8_t SN_Code[SN_LEN+2] = {0}; //暂时存储序列号
  281 +// char area[3] = {0};//保存序列号中的地区码
  282 +// uint8_t activate_flag = 0;//激活标志位,该处位局部变量真正工程中需变为全局变量或其它操作
  283 +// uint8_t Country_Code = 156;//假如从飞机获取的国家码是156,真正工程中需变为全局变量或其它操作
  284 +
  285 +// Read_SN_FromFlash(SN_Code,SN_LEN); //获取序列号,需更改为工程的对应的获取序列号的函数
  286 +// SN_Code[16] = '\0';
  287 +// area[0] = SN_Code[4];
  288 +// area[1] = SN_Code[5];
  289 +// area[2] = '\0';
  290 +
  291 +// activate_flag = Get_Active_State(); //获取激活状态,需更改为工程的对应的获取激活状态的函数
  292 +
  293 +// if(activate_flag == 0x01)//激活后才需要判断国家码与序列号的码是否一致,app_activate_flag == 0x01
  294 +// {
  295 +// USER_LOG_INFO("SN = %s,activate = %x,CountryCode = %d,area = %s\r\n",SN_Code,activate_flag,Country_Code,area);//输出序列号,国家码,
  296 +// activate_flag = Country_Code_handle(Country_Code,area);//获取国家码比对结果。
  297 +// USER_LOG_INFO("app_country_flag = %d\r\n",activate_flag);
  298 +// if(activate_flag == 0)//国家码与序列号地区码比对一致
  299 +// {
  300 +
  301 +// }else
  302 +// {
  303 +// activate_flag = 0;//非法地区,禁止使用
  304 +// }
  305 +// }
  306 +// }
  307 +// #endif
  308 +// /*____________________________________________________ "Country_Code_handle()" External call module ____________________________________________________*/
  309 +
  310 +
  311 +
  312 +// /*____________________________________________________ Country code test module ____________________________________________________*/
  313 +// #if COUNTRY_CODE_TEST //测试国家码是否能对应查找以及对比成功
  314 +// /**
  315 +// @brief: 传入国家码结构体,判断是否与传入的国家码一致(返回0),不一致返回1
  316 +// @Param: code 国家码参数结构体
  317 +// @Param: CountryCode 国家码
  318 +// @return:no
  319 +// */
  320 +// uint8_t TEST_IF_Country_Code(T_country_code_param * code , uint16_t CountryCode)
  321 +// {
  322 +// uint8_t i = 0;
  323 +// uint8_t hundred = 0;//存储传进参数的百位的值
  324 +// uint8_t hundred_address = 0;//存储传进参数的百位处在第X个元素的位置
  325 +// uint8_t number = 0;
  326 +// uint8_t state = 1;//返回检查状态
  327 +
  328 +// hundred = CountryCode / 100;//取传进参数的百位在数组中的位置
  329 +// if(hundred <= 2)
  330 +// {
  331 +// hundred = 0;//存放国家码百位为0~2的数据所在位置的数组的第X个元素
  332 +// }else if(hundred >=3 && hundred <= 5)
  333 +// {
  334 +// hundred = 1;
  335 +// }else if(hundred >=6 && hundred <= 8)
  336 +// {
  337 +// hundred = 2;
  338 +// }
  339 +// hundred_address = code->name_address[hundred];//取国家码百位在X~X+2的数据的位置
  340 +// number = code->name_address[hundred_address];//取国家码百位在X~X+2的数据的数量
  341 +
  342 +// for(i = 0;i<number;i++)
  343 +// {
  344 +// if(CountryCode == code->name_address[hundred_address+(1+i)])//判断这些数据是否与传进参数一致
  345 +// {
  346 +// state = 0;
  347 +// }else
  348 +// {
  349 +// USER_LOG_INFO("CountryCode = %d\n",code->name_address[hundred_address+(1+i)]); //输出
  350 +// vTaskDelay(pdMS_TO_TICKS(2));
  351 +// }
  352 +// }
  353 +// return state;//对比成功,数组中存在该元素
  354 +// }
  355 +// /**
  356 +// @brief: 输入的国家码与序列号中的地区码相同即返回0;否返回1
  357 +// @Param: CountryCode 国家码
  358 +// @Param: xarea 序列号中的国家码(地区位)
  359 +// @return:0/1 成功/失败
  360 +// */
  361 +// uint8_t TEST_Country_Code_handle(uint16_t CountryCode , char * xarea)
  362 +// {
  363 +// USER_LOG_INFO("CountryCode = %d,%s\n",CountryCode,xarea); //输出
  364 +
  365 +// if(strcmp(xarea,country_code_Param[0].name) == 0)//
  366 +// {
  367 +// if(CountryCode == 156 || CountryCode == 344 || CountryCode == 446 || CountryCode == 158)
  368 +// {
  369 +// return 0;//返回成功
  370 +// }else
  371 +// {
  372 +// return 1;//返回不成功
  373 +// }
  374 +// }
  375 +// else if(strcmp(xarea,country_code_Param[1].name) == 0)
  376 +// {
  377 +// return TEST_IF_Country_Code(&country_code_Param[1],CountryCode);
  378 +// }
  379 +// else if(strcmp(xarea,country_code_Param[2].name) == 0)
  380 +// {
  381 +// return TEST_IF_Country_Code(&country_code_Param[2],CountryCode);
  382 +// }
  383 +// else
  384 +// {
  385 +
  386 +// }
  387 +
  388 +// return 1;//返回不成功
  389 +// }
  390 +// /**
  391 +// @brief: 测试国家码
  392 +// @Param: no
  393 +// @return:no
  394 +// */
  395 +// void TEST_guojiama(void)
  396 +// {
  397 +// char area[5] = {0};//保存序列号中的地区码
  398 +// uint8_t state = 2;
  399 +
  400 +// area[0] = 'C';
  401 +// area[1] = 'N';
  402 +// area[2] = '\0';
  403 +
  404 +// state = TEST_Country_Code_handle(156,area);
  405 +// USER_LOG_INFO("%d\r\n",state);//国家码比对结果返回
  406 +// vTaskDelay(pdMS_TO_TICKS(500));
  407 +// area[0] = 'N';
  408 +// area[1] = 'A';
  409 +// area[2] = '\0';
  410 +
  411 +// state = TEST_Country_Code_handle(8,area);
  412 +// USER_LOG_INFO("%d\r\n",state);
  413 +// vTaskDelay(pdMS_TO_TICKS(500));
  414 +// area[0] = 'E';
  415 +// area[1] = 'U';
  416 +// area[2] = '\0';
  417 +
  418 +// state = TEST_Country_Code_handle(800,area);
  419 +// USER_LOG_INFO("%d\r\n",state);
  420 +// vTaskDelay(pdMS_TO_TICKS(500));
  421 +// }
  422 +// #endif
  423 +// /*____________________________________________________ Country code test module ____________________________________________________*/
  424 +
  425 +
  426 +
  427 +
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 #include "DeviceInfo/DeviceMessage/DeviceMessage.h" 13 #include "DeviceInfo/DeviceMessage/DeviceMessage.h"
14 #include "SerialNumberProc/SerialProc.h" 14 #include "SerialNumberProc/SerialProc.h"
15 #include "DeviceInfo/HardwareInfo/HardwareInfo.h" 15 #include "DeviceInfo/HardwareInfo/HardwareInfo.h"
  16 +#include "DeviceInfo/Attribute/Attribute.h"
16 17
17 /* Includes ------------------------------------------------------------------*/ 18 /* Includes ------------------------------------------------------------------*/
18 #ifdef __cplusplus 19 #ifdef __cplusplus
@@ -177,7 +177,6 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message) @@ -177,7 +177,6 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message)
177 snprintf(new_message,MESSAGE_MAX_LEN,"气体阈值\n上限:%d\n下限:%d\n",g_temp_GasValueMax , g_temp_GasValueMin); 177 snprintf(new_message,MESSAGE_MAX_LEN,"气体阈值\n上限:%d\n下限:%d\n",g_temp_GasValueMax , g_temp_GasValueMin);
178 snprintf(old_message,MESSAGE_MAX_LEN,"%s",message); 178 snprintf(old_message,MESSAGE_MAX_LEN,"%s",message);
179 snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); 179 snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message);
180 -  
181 } 180 }
182 else 181 else
183 { 182 {
@@ -187,6 +186,52 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message) @@ -187,6 +186,52 @@ static T_JZsdkReturnCode DeviceMessage_Enter_Default(unsigned char *message)
187 snprintf(old_message,MESSAGE_MAX_LEN,"%s",message); 186 snprintf(old_message,MESSAGE_MAX_LEN,"%s",message);
188 snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message); 187 snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message);
189 } 188 }
  189 +
  190 + // float gps_x;
  191 + // float gps_y;
  192 + // float gps_z;
  193 +
  194 + // int gps_year;
  195 + // int gps_month;
  196 + // int gps_day;
  197 + // int gps_hour;
  198 + // int gps_minute;
  199 + // int gps_second;
  200 +
  201 + // Attribute_GetGpsXYZ_ByF(&gps_x,&gps_y,&gps_z);
  202 + // Attribute_GetTime_ByI( &gps_year,&gps_month,&gps_day,&gps_hour,&gps_minute,&gps_second);
  203 +
  204 + // memset(new_message,0,sizeof(new_message));
  205 + // memset(old_message,0,sizeof(old_message));
  206 +
  207 + // snprintf(new_message,MESSAGE_MAX_LEN,"GPS: X:%.2f Y:%.2f Z:%.2f\n%d-%d-%d %d:%d:%d\n",gps_x,gps_y,gps_z,gps_year,gps_month,gps_day,gps_hour,gps_minute,gps_second);
  208 + // snprintf(old_message,MESSAGE_MAX_LEN,"%s",message);
  209 + // snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message);
  210 +
  211 + unsigned char gps_x_str[50];
  212 + unsigned char gps_y_str[50];
  213 + float gps_z;
  214 +
  215 + int gps_year;
  216 + int gps_month;
  217 + int gps_day;
  218 + int gps_hour;
  219 + int gps_minute;
  220 + int gps_second;
  221 +
  222 + memset(gps_x_str,0,sizeof(gps_x_str));
  223 + memset(gps_y_str,0,sizeof(gps_y_str));
  224 +
  225 + Attribute_GetGpsXYZ_ByStr(gps_x_str,gps_y_str,&gps_z);
  226 + Attribute_GetTime_ByI( &gps_year,&gps_month,&gps_day,&gps_hour,&gps_minute,&gps_second);
  227 +
  228 + memset(new_message,0,sizeof(new_message));
  229 + memset(old_message,0,sizeof(old_message));
  230 +
  231 + snprintf(new_message,MESSAGE_MAX_LEN,"GPS:%s %s\n%d-%d-%d %d:%d:%d\n",gps_x_str,gps_y_str,gps_year,gps_month,gps_day,gps_hour,gps_minute,gps_second);
  232 + snprintf(old_message,MESSAGE_MAX_LEN,"%s",message);
  233 + snprintf(message,MESSAGE_MAX_LEN,"%s%s",old_message,new_message);
  234 +
190 #endif 235 #endif
191 236
192 //如果为组合版 237 //如果为组合版
@@ -149,6 +149,9 @@ T_JZsdkReturnCode Gimbal_Set_PitchAngle(int angle) @@ -149,6 +149,9 @@ T_JZsdkReturnCode Gimbal_Set_PitchAngle(int angle)
149 case JZ_MODULE_CONTROL_WAY_TRANSPARENT: 149 case JZ_MODULE_CONTROL_WAY_TRANSPARENT:
150 { 150 {
151 Gimbal_PitchAngle = angle; 151 Gimbal_PitchAngle = angle;
  152 +
  153 + //将云台角度透传出去
  154 + Gimbal_DataDeal_SetRealAngle(Gimbal_PitchAngle);
152 } 155 }
153 break; 156 break;
154 157
@@ -76,9 +76,9 @@ T_JZsdkReturnCode IRC_LowT_CycleCalibration(U16_t *ImageData,struct IRC_param *d @@ -76,9 +76,9 @@ T_JZsdkReturnCode IRC_LowT_CycleCalibration(U16_t *ImageData,struct IRC_param *d
76 76
77 if (dealInfo->LowT_flag > 9) //已经存储了9组数据 77 if (dealInfo->LowT_flag > 9) //已经存储了9组数据
78 { 78 {
79 - for (int i = 0; i < (dealInfo->Width * dealInfo->Height); i++) 79 + for (int i = 0; i < (dealInfo->PixelNum); i++)
80 { 80 {
81 - dealInfo->LowT_NineFrame_Avg[i] = (int)(dealInfo->LowT_NineFrameAdd[i] / 9); 81 + dealInfo->LowT_NineFrame_Avg[i] = (U16_t)(dealInfo->LowT_NineFrameAdd[i] / 9);
82 } 82 }
83 83
84 dealInfo->LowT_flag = JZ_FLAGCODE_OFF; //将标志位归位 84 dealInfo->LowT_flag = JZ_FLAGCODE_OFF; //将标志位归位
@@ -111,14 +111,15 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U16_t *rawData ,unsigned int * @@ -111,14 +111,15 @@ static T_JZsdkReturnCode IRC_data_PreliminaryDeal(U16_t *rawData ,unsigned int *
111 JZsdk_CutBadPixel_U16(rawData, dealInfo->Width, dealInfo->Height, dealInfo->BadPixel, dealInfo->BadPixelNum,dealInfo->BadPixelExtern, 1); 111 JZsdk_CutBadPixel_U16(rawData, dealInfo->Width, dealInfo->Height, dealInfo->BadPixel, dealInfo->BadPixelNum,dealInfo->BadPixelExtern, 1);
112 } 112 }
113 113
114 - // //盲点过后进行数据复查  
115 - // for (int i = 0; i < *rawSize; i++)  
116 - // {  
117 - // if (rawData[i] > dealInfo->ExpectedMax)  
118 - // {  
119 - // rawData[i] = dealInfo->ExpectedMax;  
120 - // }  
121 - // } 114 +/****************************************盲点复查********************************************************************/
  115 +
  116 + for (int i = 0; i < *rawSize; i++)
  117 + {
  118 + if (rawData[i] > dealInfo->ExpectedMax)
  119 + {
  120 + rawData[i] = dealInfo->ExpectedMax;
  121 + }
  122 + }
122 123
123 /*************************************两点纠正部分******************************************************************/ 124 /*************************************两点纠正部分******************************************************************/
124 125
@@ -561,9 +561,7 @@ T_JZsdkReturnCode Megaphone_PlayNextSong() @@ -561,9 +561,7 @@ T_JZsdkReturnCode Megaphone_PlayNextSong()
561 T_JZsdkReturnCode Megaphone_Flush_MusicList() 561 T_JZsdkReturnCode Megaphone_Flush_MusicList()
562 { 562 {
563 //1、刷新列表 563 //1、刷新列表
564 - AudioFile_FlushAudioList();  
565 -  
566 - return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 564 + return AudioFile_FlushAudioList();
567 } 565 }
568 566
569 567
@@ -24,6 +24,8 @@ static struct AudioMange_Node *g_AudioListtail = NULL; // 用于跟踪链表的 @@ -24,6 +24,8 @@ static struct AudioMange_Node *g_AudioListtail = NULL; // 用于跟踪链表的
24 static int g_AudioList_Num = 0; //记录链表中一共有几首歌 24 static int g_AudioList_Num = 0; //记录链表中一共有几首歌
25 static int g_AudioList_CurrentNum = 0; //记录播放当前第几首歌 25 static int g_AudioList_CurrentNum = 0; //记录播放当前第几首歌
26 26
  27 +static g_AudioList_flush_Flag = JZ_FLAGCODE_OFF; //刷新标志位
  28 +
27 //文件播放线程 29 //文件播放线程
28 static void *FilePlay_data_pthread(void *arg) 30 static void *FilePlay_data_pthread(void *arg)
29 { 31 {
@@ -204,6 +206,13 @@ static T_JZsdkReturnCode AudioFile_FreeAudioList() @@ -204,6 +206,13 @@ static T_JZsdkReturnCode AudioFile_FreeAudioList()
204 **********/ 206 **********/
205 T_JZsdkReturnCode AudioFile_FlushAudioList() 207 T_JZsdkReturnCode AudioFile_FlushAudioList()
206 { 208 {
  209 + if (g_AudioList_flush_Flag == JZ_FLAGCODE_ON)
  210 + {
  211 + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
  212 + }
  213 +
  214 + g_AudioList_flush_Flag = JZ_FLAGCODE_ON;
  215 +
207 //读取audio文件夹,并将歌曲名放入音频列表 216 //读取audio文件夹,并将歌曲名放入音频列表
208 DIR *dir; 217 DIR *dir;
209 struct dirent *entry; 218 struct dirent *entry;
@@ -223,6 +232,7 @@ T_JZsdkReturnCode AudioFile_FlushAudioList() @@ -223,6 +232,7 @@ T_JZsdkReturnCode AudioFile_FlushAudioList()
223 if ((dir = opendir(AUDIO_DIR)) == NULL) 232 if ((dir = opendir(AUDIO_DIR)) == NULL)
224 { 233 {
225 JZSDK_LOG_ERROR("音频文件夹获取失败"); 234 JZSDK_LOG_ERROR("音频文件夹获取失败");
  235 + g_AudioList_flush_Flag = JZ_FLAGCODE_OFF;
226 return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER; 236 return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
227 } 237 }
228 238
@@ -272,6 +282,8 @@ T_JZsdkReturnCode AudioFile_FlushAudioList() @@ -272,6 +282,8 @@ T_JZsdkReturnCode AudioFile_FlushAudioList()
272 || JZsdk_strings_suffix_comparison_withLen((const unsigned char *)filename, len, (const unsigned char *)".aac") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS 282 || JZsdk_strings_suffix_comparison_withLen((const unsigned char *)filename, len, (const unsigned char *)".aac") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS
273 || JZsdk_strings_suffix_comparison_withLen((const unsigned char *)filename, len, (const unsigned char *)".AAC") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) 283 || JZsdk_strings_suffix_comparison_withLen((const unsigned char *)filename, len, (const unsigned char *)".AAC") == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
274 { 284 {
  285 + //JZSDK_LOG_INFO("读取到歌曲:%s",filename);
  286 +
275 // 处理文件 287 // 处理文件
276 memset(&audioInfo, 0, sizeof(audioInfo)); // 清除audioInfo结构 288 memset(&audioInfo, 0, sizeof(audioInfo)); // 清除audioInfo结构
277 289
@@ -317,6 +329,8 @@ T_JZsdkReturnCode AudioFile_FlushAudioList() @@ -317,6 +329,8 @@ T_JZsdkReturnCode AudioFile_FlushAudioList()
317 //打印一遍已加载的音乐 329 //打印一遍已加载的音乐
318 JZsdk_PrintfAuidoNode_AudioList(g_AudioList); 330 JZsdk_PrintfAuidoNode_AudioList(g_AudioList);
319 331
  332 + g_AudioList_flush_Flag = JZ_FLAGCODE_OFF;
  333 +
320 JZSDK_LOG_INFO("刷新歌曲列表已完成"); 334 JZSDK_LOG_INFO("刷新歌曲列表已完成");
321 335
322 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 336 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
@@ -46,7 +46,7 @@ static T_JZsdkReturnCode PcmPlay_Interface(t_PcmParam *PcmParam) @@ -46,7 +46,7 @@ static T_JZsdkReturnCode PcmPlay_Interface(t_PcmParam *PcmParam)
46 nbBytes = fread(cbits, 1, 3 * 1276, Pcm_fp); 46 nbBytes = fread(cbits, 1, 3 * 1276, Pcm_fp);
47 if(nbBytes > 0) 47 if(nbBytes > 0)
48 { 48 {
49 - AudioDeal_PcmDataInput(g_opus_sampleRate, (unsigned char *)cbits, nbBytes); 49 + AudioDeal_PcmDataInput(g_opus_sampleRate, (unsigned char *)cbits, nbBytes, 1);
50 } 50 }
51 51
52 int totalSamples = nbBytes / (2); 52 int totalSamples = nbBytes / (2);
@@ -91,7 +91,7 @@ static T_JZsdkReturnCode TTS_Synthesis(const char* src_text, const char* params) @@ -91,7 +91,7 @@ static T_JZsdkReturnCode TTS_Synthesis(const char* src_text, const char* params)
91 91
92 //没将数据放入PCM通道 92 //没将数据放入PCM通道
93 //printf("产生了%d 的数据\n",audio_len); 93 //printf("产生了%d 的数据\n",audio_len);
94 - AudioDeal_PcmDataInput(16000, (unsigned char *)data, audio_len); 94 + AudioDeal_PcmDataInput(16000, (unsigned char *)data, audio_len, 0);
95 } 95 }
96 96
97 if (synth_status == MSP_TTS_FLAG_DATA_END) 97 if (synth_status == MSP_TTS_FLAG_DATA_END)
@@ -35,8 +35,11 @@ extern "C" { @@ -35,8 +35,11 @@ extern "C" {
35 //新班子 116.8 35 //新班子 116.8
36 //95 115.7 36 //95 115.7
37 //90 37 //90
38 - #define MAX_VOLUME 82  
39 - #define MAX_TTS_VOLUME 92 38 + // #define MAX_VOLUME 82
  39 + // #define MAX_TTS_VOLUME 92
  40 + #define MAX_VOLUME 100
  41 + #define MAX_TTS_VOLUME 100
  42 +
40 #elif DEVICE_VERSION == JZ_H10 43 #elif DEVICE_VERSION == JZ_H10
41 #define MAX_VOLUME (65) 44 #define MAX_VOLUME (65)
42 #define MAX_TTS_VOLUME (70) 45 #define MAX_TTS_VOLUME (70)
@@ -100,7 +100,7 @@ static T_JZsdkReturnCode FixedFilePlay() @@ -100,7 +100,7 @@ static T_JZsdkReturnCode FixedFilePlay()
100 nbBytes = fread(cbits, 1, 3 * 1276, PlayFixedFile_pcm_fp); 100 nbBytes = fread(cbits, 1, 3 * 1276, PlayFixedFile_pcm_fp);
101 if(nbBytes > 0) 101 if(nbBytes > 0)
102 { 102 {
103 - AudioDeal_PcmDataInput(g_opus_sampleRate, (unsigned char *)cbits, nbBytes); 103 + AudioDeal_PcmDataInput(g_opus_sampleRate, (unsigned char *)cbits, nbBytes, 1);
104 } 104 }
105 105
106 int totalSamples = nbBytes / (2); 106 int totalSamples = nbBytes / (2);
@@ -408,17 +408,19 @@ T_JZsdkReturnCode OpusFile_DecodeOpus(unsigned char *opusFile) @@ -408,17 +408,19 @@ T_JZsdkReturnCode OpusFile_DecodeOpus(unsigned char *opusFile)
408 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; 408 return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
409 } 409 }
410 410
411 - unsigned char *DecodeFile = OsalHandler->Malloc(strlen(opusFile)); 411 + unsigned char *DecodeFile = OsalHandler->Malloc(strlen(opusFile) + 1);
412 if(DecodeFile == NULL) 412 if(DecodeFile == NULL)
413 { 413 {
414 JZSDK_LOG_ERROR("DecodeFile malloc failed"); 414 JZSDK_LOG_ERROR("DecodeFile malloc failed");
415 return JZ_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED; 415 return JZ_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED;
416 } 416 }
417 - memset(DecodeFile, strlen(opusFile), 0); 417 + memset(DecodeFile, 0, strlen(opusFile) + 1);
418 memcpy(DecodeFile, opusFile, strlen(opusFile)); 418 memcpy(DecodeFile, opusFile, strlen(opusFile));
419 419
420 OsalHandler->TaskCreate("DecodeOpus", DecodeOpus_task, 8192, (void *)DecodeFile, &g_DecodeOpus_task); 420 OsalHandler->TaskCreate("DecodeOpus", DecodeOpus_task, 8192, (void *)DecodeFile, &g_DecodeOpus_task);
421 421
  422 + //JZSDK_LOG_INFO("decode %s %dto %s %d\n", opusFile, strlen(opusFile), DecodeFile, strlen(DecodeFile));
  423 +
422 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 424 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
423 } 425 }
424 426
@@ -485,7 +487,7 @@ T_JZsdkReturnCode OpusFile_DecodeOpusAndSave(int SaveMode, unsigned char *InFile @@ -485,7 +487,7 @@ T_JZsdkReturnCode OpusFile_DecodeOpusAndSave(int SaveMode, unsigned char *InFile
485 return JZ_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED; 487 return JZ_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED;
486 } 488 }
487 489
488 - memset(OpusDecodeFileInfo, sizeof(OpusDecodeFile), 0); 490 + memset(OpusDecodeFileInfo, 0, sizeof(OpusDecodeFile));
489 OpusDecodeFileInfo->saveMode = SaveMode; 491 OpusDecodeFileInfo->saveMode = SaveMode;
490 memcpy(OpusDecodeFileInfo->inputFilePath, InFile, strlen(InFile)); 492 memcpy(OpusDecodeFileInfo->inputFilePath, InFile, strlen(InFile));
491 memcpy(OpusDecodeFileInfo->outputFilePath, OutFile, strlen(OutFile)); 493 memcpy(OpusDecodeFileInfo->outputFilePath, OutFile, strlen(OutFile));
@@ -188,7 +188,7 @@ static T_JZsdkReturnCode Opus_RealTimeVoice_PlayData(unsigned char *data,int len @@ -188,7 +188,7 @@ static T_JZsdkReturnCode Opus_RealTimeVoice_PlayData(unsigned char *data,int len
188 pcm_bytes[2 * i + 1] = (TempPcm[i] >> 8) & 0xFF; 188 pcm_bytes[2 * i + 1] = (TempPcm[i] >> 8) & 0xFF;
189 } 189 }
190 190
191 - AudioDeal_PcmDataInput(RealTimeDecodeRate, pcm_bytes, frame_size*2); 191 + AudioDeal_PcmDataInput(RealTimeDecodeRate, pcm_bytes, frame_size*2, 1);
192 192
193 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; 193 return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
194 } 194 }
@@ -42,13 +42,13 @@ @@ -42,13 +42,13 @@
42 #include "gimbal_emu/test_payload_gimbal_emu.h" 42 #include "gimbal_emu/test_payload_gimbal_emu.h"
43 #include "JZsdkLib.h" 43 #include "JZsdkLib.h"
44 44
  45 +#include "DeviceInfo/Attribute/Attribute.h"
  46 +
45 /* Private constants ---------------------------------------------------------*/ 47 /* Private constants ---------------------------------------------------------*/
46 #define FC_SUBSCRIPTION_TASK_FREQ (1) 48 #define FC_SUBSCRIPTION_TASK_FREQ (1)
47 #define FC_SUBSCRIPTION_TASK_STACK_SIZE (1024) 49 #define FC_SUBSCRIPTION_TASK_STACK_SIZE (1024)
48 50
49 51
50 -#define HEIGHT_VOLUME_LIMIT 0 //高度限制音量开关  
51 -  
52 /* Private types -------------------------------------------------------------*/ 52 /* Private types -------------------------------------------------------------*/
53 53
54 /* Private functions declaration ---------------------------------------------*/ 54 /* Private functions declaration ---------------------------------------------*/
@@ -163,23 +163,21 @@ T_DjiReturnCode DjiTest_FcSubscriptionStartService(void) @@ -163,23 +163,21 @@ T_DjiReturnCode DjiTest_FcSubscriptionStartService(void)
163 } 163 }
164 164
165 165
166 -#if HEIGHT_VOLUME_LIMIT == 1 //如果开启相对高度音量限制功能  
167 166
168 - //m30和m30t有高度锁  
169 - if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T)  
170 - {  
171 - if (osalHandler->TaskCreate("Subscription_Height_Fusion_task", Subscription_Height_Fusion_task,  
172 - FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) !=  
173 - DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {  
174 - USER_LOG_ERROR("Height Fusion task create error.");  
175 - return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;  
176 - }  
177 - else {  
178 - USER_LOG_INFO("开启相对高度音量限制功能");  
179 - }  
180 - } 167 + // //m30和m30t有高度锁
  168 + // if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30 || aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T)
  169 + // {
  170 + // if (osalHandler->TaskCreate("Subscription_Height_Fusion_task", Subscription_Height_Fusion_task,
  171 + // FC_SUBSCRIPTION_TASK_STACK_SIZE, NULL, &s_userFcSubscriptionThread) !=
  172 + // DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
  173 + // USER_LOG_ERROR("Height Fusion task create error.");
  174 + // return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
  175 + // }
  176 + // else {
  177 + // USER_LOG_INFO("开启相对高度音量限制功能");
  178 + // }
  179 + // }
181 180
182 -#endif  
183 181
184 182
185 183
@@ -381,6 +379,21 @@ static void *Subscription_GPS_DealTask(void *arg) @@ -381,6 +379,21 @@ static void *Subscription_GPS_DealTask(void *arg)
381 379
382 //USER_LOG_INFO("gps订阅"); 380 //USER_LOG_INFO("gps订阅");
383 //1s一次 381 //1s一次
  382 +
  383 + T_JZsdkAttributeGpsPosition temp_GpsPosition;
  384 + temp_GpsPosition.x = gpsPosition.x;
  385 + temp_GpsPosition.y = gpsPosition.y;
  386 + temp_GpsPosition.z = gpsPosition.z;
  387 + Attribute_SetGpsPosition(temp_GpsPosition);
  388 +
  389 + T_JZsdkAttributeGpsTime temp_GpsTime;
  390 + temp_GpsTime = gpsTime;
  391 + Attribute_SetGpsTime(temp_GpsTime);
  392 +
  393 + T_JZsdkAttributeGpsDate temp_GpsDate;
  394 + temp_GpsDate = gpsDate;
  395 + Attribute_SetGpsDate(temp_GpsDate);
  396 +
384 osalHandler->TaskSleepMs(1000 / FC_SUBSCRIPTION_TASK_FREQ); 397 osalHandler->TaskSleepMs(1000 / FC_SUBSCRIPTION_TASK_FREQ);
385 398
386 } 399 }
@@ -371,19 +371,6 @@ static void *DjiTest_WidgetTask(void *arg) @@ -371,19 +371,6 @@ static void *DjiTest_WidgetTask(void *arg)
371 371
372 USER_UTIL_UNUSED(arg); 372 USER_UTIL_UNUSED(arg);
373 373
374 -  
375 - //激活功能  
376 - int a=1;  
377 - if (a == 1 && mobileAppInfo.appLanguage == DJI_MOBILE_APP_LANGUAGE_CHINESE)  
378 - {  
379 - USER_LOG_INFO("设备未激活");  
380 - }  
381 - else if (a == 1 && (mobileAppInfo.appLanguage != DJI_MOBILE_APP_LANGUAGE_CHINESE) )  
382 - {  
383 - USER_LOG_INFO("海外设备未激活");  
384 - }  
385 -  
386 -  
387 while (1) { 374 while (1) {
388 char old_message[1024]; 375 char old_message[1024];
389 char new_message[1024]; 376 char new_message[1024];