作者 潘浩彬

12更新

要显示太多修改。

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

... ... @@ -13,6 +13,9 @@
"tts_sample.h": "c",
"cn_tts.h": "c",
"intl_tts.h": "c",
"megaphone_music.h": "c"
"megaphone_music.h": "c",
"gimbal_h3_h10.h": "c",
"gimbal_h3_h150st.h": "c",
"uartconnection.h": "c"
}
}
\ No newline at end of file
... ...
... ... @@ -24,7 +24,7 @@ project(JZ_UART_APP)
set(filtering_type high_pass_filtering)
# 海外版本 27行不能改动
set(firewarm_origin OVERSEAS_VERSION)
set(firewarm_origin DOMESTIC_VERSION)
# 指定源文件
... ... @@ -67,10 +67,10 @@ include_directories(./Module/UI_control)
# 库文件路径
if(${filtering_type} STREQUAL "directed_stopband_filtering")
message("Using library for directed stopband filtering")
message("\n滤波库:高通滤波\n")
target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/directed_stopband_filtering/libAudioPlayer.so)
elseif(${filtering_type} STREQUAL "high_pass_filtering")
message("Using library for high pass filtering")
message("\n滤波库:带阻滤波\n")
target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/high_pass_filtering/libAudioPlayer.so)
else()
message(FATAL_ERROR "Invalid filtering type")
... ...
... ... @@ -52,9 +52,9 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
case JZ_INSCODE_5AFRAME_GIMBAL_PITCH_FINETUNING_CONTROL:
{
char sendbuf[13] = {0x5A ,0x5A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x64 ,0x52 ,0x00 ,0x00 ,0x00 ,0x23};
memcpy(str, sendbuf, 13);
*str_len = 13;
char sendbuf[14] = {0x5A ,0x5A ,0x77 ,0x00 ,0x0E ,0x00 ,0x00 ,0x64 ,0x52 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23};
memcpy(str, sendbuf, 14);
*str_len = 14;
}
break;
... ... @@ -166,30 +166,7 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_START:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_TRANS:
{
char sendbuf[12] = {0x5B, 0x5B, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_STOP:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0xff, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_AUDIO_PLAYSTATUS_END:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x53, 0xff, 0x00, 0x00, 0x23};
... ... @@ -256,6 +233,38 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_START:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_TRANS:
{
char sendbuf[12] = {0x5B, 0x5B, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_MUSICLIST_STOP:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0xff, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_CHECKSTATUS_OUTPUTPOWER:
{
char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0C, 0x00, 0x00, 0x5A, 0x02, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 12);
*str_len = 12;
}
break;
case JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY:
{
char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x61, 0x51, 0x00, 0x00, 0x00, 0x23};
... ... @@ -290,9 +299,9 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
case JZ_INSCODE_5BFRAME_GIMBAL_PITCH_FINETUNING:
{
char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x64, 0x52, 0x00, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 13);
*str_len = 13;
char sendbuf[14] = { 0x5b, 0x5b, 0x77, 0x00, 0x0e, 0x00, 0x00, 0x64, 0x52, 0x00, 0x00, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 14);
*str_len = 14;
}
break;
... ... @@ -330,17 +339,28 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
case JZ_INSCODE_5BFRAME_CHECKSTATUS_SERIALNUMBER:
{
char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x69, 0x54, 0x00, 0x00, 0x00, 0x23};
char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x6F, 0x57, 0x00, 0x00, 0x00, 0x23};
memcpy(str, sendbuf, 13);
*str_len = 13;
}
break;
break;
/********************************************************************************************************************************************************
*
* 6A帧
*
********************************************************************************************************************************************************/
case JZ_INSCODE_6AFRAME_SET_GIMBAL_MAXMIN_RANGE:
{
char sendbuf[13] = {0x6A ,0x6A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x69 ,0x52 ,0x00 ,0x00 ,0x00 ,0x23};
memcpy(str, sendbuf, 13);
*str_len = 13;
}
break;
case JZ_INSCODE_6AFRAME_GIMBAL_LINKAGE_CONTROL:
{
char sendbuf[13] = {0x6A ,0x6A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x69 ,0x56 ,0x00 ,0x00 ,0x00 ,0x23};
... ... @@ -364,6 +384,7 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len)
*str_len = 13;
}
break;
/********************************************************************************************************************************************************
*
... ...
... ... @@ -26,7 +26,7 @@ static void *MonitorTask(void *arg)
while (1)
{
delayS(10);
USER_LOG_DEBUG("Monitor");
JZSDK_LOG_INFO("Monitor");
}
}
... ...
... ... @@ -47,13 +47,13 @@ void JZsdk_UserLogOutput(E_JZsdkConsoleLogLevel level, const char *fmt, ...);
T_JZsdkReturnCode JZsdk_LoggerInit();
/* Exported constants --------------------------------------------------------*/
#define USER_LOG_DEBUG(fmt, ...) \
#define JZSDK_LOG_DEBUG(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_LOG_INFO(fmt, ...) \
#define JZSDK_LOG_INFO(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_LOG_WARN(fmt, ...) \
#define JZSDK_LOG_WARN(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
#define USER_LOG_ERROR(fmt, ...) \
#define JZSDK_LOG_ERROR(fmt, ...) \
JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__)
... ...
... ... @@ -2,6 +2,9 @@
#include "JZsdk_FileSystm.h"
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
/*
* 用于运行指令
*
... ... @@ -55,4 +58,45 @@ int JZsdk_RunSystemCmd(char *systemCmd)
int JZsdk_Socket()
{
}
\ No newline at end of file
}
//获取设备序列号
T_JZsdkReturnCode GetSerialNumber(char *SerialNumber)
{
FILE *num_file;
char num_char[15];
num_file = fopen("/root/num", "rb+");
if (num_file == NULL)
{
num_file = fopen("/root/num", "wb+");
if (num_file == NULL)
{
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
}
else
{
int ret = fseek(num_file, 0, SEEK_SET);
if (ret != 0) {
printf("Seek log count file error, ret: %d.\r\n", ret);
}
ret = fread((char *) &num_char,14, sizeof(char), num_file);
if (ret != sizeof(char)) {
printf("Read num file error.\r\n");
}
else{
printf("Read num file=%s\n",&num_char);
}
}
fclose(num_file);
if (SerialNumber != NULL)
{
memcpy(SerialNumber, num_char, 14);
return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@
#define JZSDK_FILESYSTEM_H
/* Includes ------------------------------------------------------------------*/
#include "../JZsdk_Code/JZsdk_Code.h"
#ifdef __cplusplus
extern "C" {
... ... @@ -26,6 +27,7 @@ extern "C" {
/* Exported functions --------------------------------------------------------*/
int JZsdk_RunSystemCmd(char *systemCmd);
//FILE* JZsdk_RunSystemCmd_ReturnFilePointer(char *systemCmd);
T_JZsdkReturnCode GetSerialNumber(char *SerialNumber);
#ifdef __cplusplus
}
... ...
... ... @@ -246,6 +246,16 @@ int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int val
JZsdk_Uart_SendDeal_GimbalLinkageControl(Uartport,FrameSequence,value);
}
/*************
*
* 设置云台最大最小值
*
* **************/
int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value)
{
JZsdk_Uart_SendDeal_SetGimbalRange(Uartport,FrameSequence,value);
}
/*******************************************************************************************************************************
*
* 探照灯部分
... ... @@ -412,6 +422,17 @@ int JZsdk_Uart_Send_SearchLight_Temperature(int Uartport,int LeftTemperature, in
JZsdk_Uart_SendDeal_SearchLight_Temperature(Uartport, LeftTemperature, RightTemperature);
}
/*************
*
* 发送对外供电电源的状态
*
* **************/
int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status)
{
JZsdk_Uart_SendDeal_OutputPowerStatus(Uartport, FrameSequence, status);
}
/*******************************************************************************************************************************
*
* 警灯部分
... ...
... ... @@ -44,6 +44,7 @@ int JZsdk_Uart_Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int
int JZsdk_Uart_Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence);
int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int value);
int JZsdk_Uart_Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence);
int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value);
int JZsdk_Uart_Send_SearchLight_SetFrequency(int Uartport,int Frequency);
int JZsdk_Uart_Send_SearchLight_Control(int Uartport,int mode);
... ... @@ -72,6 +73,7 @@ int JZsdk_Uart_Send_CheckStatus_WarningLightStatus(int Uartport);
int JZsdk_Uart_Send_CheckStatus_WarningLightColor(int Uartport);
int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status);
#ifdef __cplusplus
... ...
... ... @@ -13,14 +13,14 @@
#include "JZsdk_Uart_Send/JZsdk_Uart_Send.h"
#include "UI_control.h"
#include "JZsdkLib.h"
static int SecondaryDeviceName = 0x00; //从设备名,用于多设备相连时通知控制端 从机设备名
static int SecondaryDeviceName = 0x00; // 从设备名,用于多设备相连时通知控制端 从机设备名
/******
*
*
* 开关功放
*
*
* *******/
int JZsdk_Uart_Set_Amplifier(int status)
{
... ... @@ -28,151 +28,147 @@ int JZsdk_Uart_Set_Amplifier(int status)
}
/******
*
*
* 调节音量
*
*
* *******/
T_JZsdkReturnCode JZsdk_Uart_Set_Volume(int DeviceName, int value)
{
return UIcontrol_SetVolume(DeviceName, value);
}
/*********
*
*
* 1、TTS播放
*
*
* *********/
T_JZsdkReturnCode JZsdk_Uart_TTS_Play(int DeviceName, char *data ,int len)
T_JZsdkReturnCode JZsdk_Uart_TTS_Play(int DeviceName, char *data, int len)
{
return UIcontrol_TTS_Play(DeviceName, data, len);
return UIcontrol_TTS_Play(DeviceName, data, len);
}
/*********
*
*
* 2、TTS设置音色
*
*
* *********/
T_JZsdkReturnCode JZsdk_Uart_TTS_SetTone(int DeviceName, int tone)
{
return UIcontrol_Set_TTS_tone(DeviceName, tone);
return UIcontrol_Set_TTS_tone(DeviceName, tone);
}
/*********
*
*
* 3、TTS设置语速
*
*
* *********/
T_JZsdkReturnCode JZsdk_Uart_TTS_SetSpeed(int DeviceName, int speed)
{
return UIcontrol_Set_TTS_speed(DeviceName, speed);
return UIcontrol_Set_TTS_speed(DeviceName, speed);
}
/*********
*
*
* 刷新歌曲列表
*
*
**********/
*
*
**********/
int JZsdk_Uart_Flush_MusicList()
{
Megaphone_Flush_MusicList();
}
/*********
*
*
* 获取音乐总数
*
*
**********/
*
*
**********/
int JZsdk_Uart_get_music_list_sum()
{
return Megaphone_get_music_list_sum();
return Megaphone_get_music_list_sum();
}
/*********
*
*
* 获取音乐名
*
*
**********/
*
*
**********/
int JZsdk_Uart_get_music_list_name(int num, char *music_name, int *music_name_length)
{
return Megaphone_get_music_list_name(num, music_name, music_name_length);
}
/*********
*
*
* 查询音量
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_volume()
{
return Megaphone_get_music_volume();
}
/*********
*
*
* 查询播放状态
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_play()
{
return Megaphone_get_play_status();
}
/*********
*
*
* 查询云台角度
*
*
**********/
int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle)
*
*
**********/
int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle)
{
UIcontrol_CheckStatus_GimbalAngle(PitchAngle, YawAngle);
}
/*********
*
*
* 查询云台微调值
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_GimbalFineTuning(int DeviceName, int FrameSequence)
{
//查询云台微调
// 查询云台微调
printf("查询云台微调值\n");
//1、查询本地云台微调
// 1、查询本地云台微调
int FineTunigPitch, FineTunigYaw;
int ret = UIcontrol_CheckStatus_GimbalPitchFineTuning(&FineTunigPitch, &FineTunigYaw);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
// 回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
return ret;
}
//2、发送本地云台微调
// 2、发送本地云台微调
JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(DeviceName, FrameSequence, FineTunigPitch);
}
/*********
*
*
* 查询播放文件名
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_PlayFileName(char *music_name, int *music_name_len)
{
Megaphone_get_play_FileName(music_name, music_name_len);
}
/*********
*
*
* 查询软件版本号
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersion, char *modifyVersion, char *debugVersion)
{
*majorVersion = MAJOR_VERSION;
... ... @@ -181,47 +177,44 @@ int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersio
*debugVersion = DEBUG_VERSION;
}
/*********
*
*
* 查询是否打开循环
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_LoopPlay()
{
return Megaphone_Get_LoopPlay();
}
/*********
*
*
* 查询音色
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_TTS_tone()
{
return Megaphone_Get_TTS_tone();
}
/*********
*
*
* 查询语速
*
*
**********/
*
*
**********/
int JZsdk_Uart_CheckStatus_TTS_speed()
{
return Megaphone_Get_TTS_speed();
}
/***
*
*
*
*
* 播放歌曲
*
*
* ***/
T_JZsdkReturnCode JZsdk_Uart_PlayMusic(int DeviceName, char *music_name, int datasize)
{
... ... @@ -229,145 +222,141 @@ T_JZsdkReturnCode JZsdk_Uart_PlayMusic(int DeviceName, char *music_name, int dat
}
/*********
*
*
* 音频继续播放
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_PlayContinue(int DeviceName)
{
return UIcontrol_ContinuePlayAudio(DeviceName);
}
/*********
*
*
* 音频暂停播放
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_PlayPause(int DeviceName)
{
return UIcontrol_PausePlayAudio(DeviceName);
}
/*********
*
*
* 音频停止播放
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_PlayStop(int DeviceName)
{
return UIcontrol_StopPlayAudio(DeviceName);
}
/*********
*
*
* 音频上一曲
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_LastSong(int DeviceName)
{
return UIcontrol_LastSong(DeviceName);
}
/*********
*
*
* 音频下一曲
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_NextSong(int DeviceName)
{
return UIcontrol_NextSong(DeviceName);
}
/*********
*
*
* 12、循环播放
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode)
{
return UIcontrol_Set_AudioPlayLoop(DeviceName, mode);
}
/****************************************************************************************************************************************************
*
* 录音opus 接口部分
*
****************************************************************************************************************************************************/
*
* 录音opus 接口部分
*
****************************************************************************************************************************************************/
/*********
*
*
* 播放固定位置的opus音频
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName)
{
return UIcontrol_Opus_PlayFixedFile(DeviceName);
}
/*
*
* 存储opus文件开始
*
*/
*
* 存储opus文件开始
*
*/
int JZsdk_Uart_SaveOpusStart(int decode_rate)
{
Megaphone_SaveOpusStart(decode_rate);
}
/*
*
* 存储opus文件中
*
*/
*
* 存储opus文件中
*
*/
int JZsdk_Uart_SaveOpusTrans(char *SaveData, int size)
{
Megaphone_SaveOpusTrans(SaveData, size);
}
/*
*
* 存储opus文件结束
*
*/
*
* 存储opus文件结束
*
*/
int JZsdk_Uart_SaveOpusStop()
{
Megaphone_SaveOpusStop();
}
/****************************************************************************************************************************************************
*
* 实时喊话opus 接口部分
*
****************************************************************************************************************************************************/
*
* 实时喊话opus 接口部分
*
****************************************************************************************************************************************************/
int JZsdk_Uart_RealTimeVoiceStart(int decode_rate)
{
Megaphone_RealTimeVoice_Start(decode_rate);
}
int JZsdk_Uart_RealTimeVoiceTrans(char *data, int length)
{
Megaphone_RealTimeVoice_Trans(data, length);
}
int JZsdk_Uart_RealTimeVoiceClose()
{
Megaphone_RealTimeVoice_Close();
}
/****************************************************************************************************************************************************
*
* 实时MP2 接口部分
*
****************************************************************************************************************************************************/
*
* 实时MP2 接口部分
*
****************************************************************************************************************************************************/
T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_start(int decode_rate)
{
return Megaphone_RealTimeMP2_start();
... ... @@ -378,134 +367,126 @@ T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Trans(unsigned char *data, int length)
return Megaphone_RealTimeMP2_trans(data, length);
}
T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Close()
{
Megaphone_RealTimeMP2_stop();
}
/****************************************************************************************************************************************************
*
* 云台部分
*
****************************************************************************************************************************************************/
*
* 云台部分
*
****************************************************************************************************************************************************/
/*********
*
*
* 云台俯仰控制
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchControl(int DeviceName, int Gimbal_angle)
{
{
return UIcontrol_Set_GimbalPitchAngle(DeviceName, Gimbal_angle);
}
/*********
*
*
* 云台俯仰微调角度
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchFineTuningControl(int DeviceName, int FrameSequence,int Gimbal_angle)
{
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchFineTuningControl(int DeviceName, int FrameSequence, int Gimbal_angle)
{
T_JZsdkReturnCode ret = UIcontrol_Set_GimbalPitchFineTuning(DeviceName, Gimbal_angle);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
// 回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
}
else
{
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
// 回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
}
}
/****************************************************************************************************************************************************
*
* 探照灯部分
*
****************************************************************************************************************************************************/
*
* 探照灯部分
*
****************************************************************************************************************************************************/
/*********
*
*
* 探照灯爆闪频率控制
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Lighting_SetSearchLightFrequency(int DeviceName, int Frequency)
{
{
return UIcontrol_Set_SearchLightFrequency(DeviceName, Frequency);
}
/*********
*
*
* 灯光模式控制
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_SearchLight_Control(int DeviceName, int mode)
{
return UIcontrol_SearchLightControl(DeviceName, mode);
return UIcontrol_SearchLightControl(DeviceName, mode);
}
/*********
*
*
* 灯光亮度
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_SearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen)
{
return UIcontrol_Set_SearchLightLumen(DeviceName, LeftLumen, RightLumen);
return UIcontrol_Set_SearchLightLumen(DeviceName, LeftLumen, RightLumen);
}
/*********
*
*
* 灯光属性查询
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightLightAttribute(int DeviceName, int FrameSequence)
{
//1、查询灯光属性
// 1、查询灯光属性
int Light_Frequency;
int Light_Mode;
int Light_LeftLumen;
int Light_RightLumen;
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightLightAttribute(&Light_Frequency, &Light_Mode, &Light_LeftLumen, &Light_RightLumen);
//2、回复灯光属性
// 2、回复灯光属性
JZsdk_Uart_SendDeal_SearchLight_Frequency(DeviceName, Light_Frequency);
JZsdk_Uart_SendDeal_SearchLight_Mode(DeviceName, Light_Mode);
JZsdk_Uart_SendDeal_SearchLight_Lumen(DeviceName,Light_LeftLumen, Light_RightLumen);
JZsdk_Uart_SendDeal_SearchLight_Lumen(DeviceName, Light_LeftLumen, Light_RightLumen);
}
/*********
*
*
* 灯光温度查询
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightTemperture(int DeviceName, int FrameSequence)
{
//1、查询灯光温度
// 1、查询灯光温度
int Light_LeftTemperature;
int Light_RightTemperature;
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightTemperture(&Light_LeftTemperature, &Light_RightTemperature);
//2、回复灯光温度
// 2、回复灯光温度
JZsdk_Uart_SendDeal_SearchLight_Temperature(DeviceName, Light_LeftTemperature, Light_RightTemperature);
}
/*********
*
*
* 灯光消息订阅控制
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int value)
{
if (DeviceName == UART_DEV_2)
... ... @@ -516,160 +497,224 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int
{
JZsdk_Uart_SendDeal_MessageSubcription_Control(UART_DEV_2, value);
}
return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/*********
*
*
* 警灯模式控制
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_WarningLight_ModeControl(int DeviceName, int status, int mode)
{
return UIcontrol_Set_WarningLight_ModeControl(DeviceName, status, mode);
}
/*********
*
*
* 警灯颜色控制
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_WarningLight_SetColor(int DeviceName, int color1, int color2)
{
return UIcontrol_Set_WarningLight_Color(DeviceName, color1, color2);
}
/*********
*
*
* 警灯状态查询
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightStatus(int DeviceName, int FrameSequence)
{
//1、查询警灯状态查询
// 1、查询警灯状态查询
int status;
int Mode;
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightStatus(&status, &Mode);
//2、回复警灯状态查询
// 2、回复警灯状态查询
JZsdk_Uart_SendDeal_WarningLight_Status(DeviceName, status, Mode);
}
/*********
*
*
* 警灯颜色查询
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightColor(int DeviceName, int FrameSequence)
{
//1、查询灯光温度
// 1、查询灯光温度
int color1;
int color2;
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightColor(&color1, &color2);
//2、回复警灯颜色
// 2、回复警灯颜色
JZsdk_Uart_SendDeal_WarningLight_Color(DeviceName, color1, color2);
}
/*
*
* 获取本地主设备名
*
*/
*
* 获取本地主设备名
*
*/
int JZsdk_Uart_GetVersionReplay()
{
switch (DEVICE_VERSION)
{
case JZ_H1E:
return 0x11;
break;
case JZ_H150S:
return 0x13;
break;
case JZ_H150T:
return 0x15;
break;
case JZ_H10:
return 0x12;
break;
case JZ_H10T:
return 0x14;
break;
case JZ_H1T:
return 0x16;
break;
case JZ_U3:
return 0x17;
break;
default:
return 0x00;
break;
case JZ_H1E:
return 0x11;
break;
case JZ_H150S:
return 0x13;
break;
case JZ_H150T:
return 0x15;
break;
case JZ_H10:
return 0x12;
break;
case JZ_H10T:
return 0x14;
break;
case JZ_H1T:
return 0x16;
break;
case JZ_U3:
return 0x17;
break;
default:
return 0x00;
break;
};
}
/*
*
* 设置工作模式
*
*/
*
* 设置工作模式
*
*/
int JZsdk_Uart_SetMainWorkMode(int mode)
{
Main_WorkModeSet(mode);
}
/*
*
* 查询序列号
*
*/
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SerialNumber(int UartPort, int FrameSequence)
{
// 1、获取序列号
char SerialNum[14];
T_JZsdkReturnCode ret = GetSerialNumber(SerialNum);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
JZSDK_LOG_ERROR("获取序列号失败");
JZsdk_Uart_SendDeal_Reply_Failure(UartPort, FrameSequence);
return ret;
}
// 2、发送序列号
JZsdk_Uart_SendDeal_SerialNumber(UartPort, FrameSequence, SerialNum);
return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/****************************************************************************************************************************************************
*
* AudioFile 接口部分
*
****************************************************************************************************************************************************/
*
* AudioFile 接口部分
*
****************************************************************************************************************************************************/
/*
1、开始传输的音频文件保存
2、存储音频文件中
3、存储音频文件结束
*/
/*********
*
*
* 1、开始传输的音频文件保存
*
*
**********/
*
*
**********/
T_JZsdkReturnCode JZsdk_Uart_SaveAudioFileStart(char *FileName)
{
return Megaphone_SaveAudioFileStart(FileName);
}
/*
*
* 2、存储音频文件中
*
*/
*
* 2、存储音频文件中
*
*/
int JZsdk_Uart_SaveAudioFileTrans(char *SaveData, int size)
{
Megaphone_SaveAudioFileTrans(SaveData, size);
}
/*
*
* 3、存储音频文件结束
*
*/
*
* 3、存储音频文件结束
*
*/
int JZsdk_Uart_SaveAudioFileStop()
{
Megaphone_SaveAudioFileStop();
}
/****************************************************************************************************************************************************
*
* 对外供电部分
*
****************************************************************************************************************************************************/
/*********
*
* 对外供电开关
*
**********/
T_JZsdkReturnCode JZsdk_Uart_OutPutPower_Control(int DeviceName, int FrameSequence, int Value)
{
//1、设置本地的值
T_JZsdkReturnCode ret = UIcontrol_Set_OutPutPower_Control(DeviceName, Value);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
}
//2、回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
}
/*********
*
* 对外电源查询
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Checkstatus_OutPutPower(int DeviceName, int FrameSequence)
{
int OutPutPowerValue = JZ_FLAGCODE_OFF;
//1、获取电源值
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_OutPutPowerValue(&OutPutPowerValue);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
}
//2、发送电源值
JZsdk_Uart_SendDeal_OutputPowerStatus(DeviceName, FrameSequence, OutPutPowerValue);
}
/********************************************************************************************************
********* ********|
********* ********|
... ... @@ -685,128 +730,124 @@ int JZsdk_Uart_SaveAudioFileStop()
*********************************************************************************************************/
/*******************************************************************************************************************************
*
*
* 灯光部分
*
*
* *****************************************************************************************************************************/
/*********
*
*
* 收到灯光频率
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Frequency(int DeviceName, int Frequency)
{
UIcontrol_ObtainSearchLight_Frequency(DeviceName, Frequency);
}
}
/*********
*
*
* 收到灯光模式
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Mode(int DeviceName, int mode)
{
UIcontrol_ObtainSearchLight_Mode(DeviceName, mode);
}
}
/*********
*
*
* 收到灯光亮度
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen)
{
UIcontrol_ObtainSearchLight_Lumen(DeviceName, LeftLumen, RightLumen);
}
}
/*********
*
*
* 收到探照灯温度
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Temperature(int DeviceName, int LeftTemperature, int RightTemperature)
{
UIcontrol_ObtainSearchLight_Temperature(DeviceName, LeftTemperature, RightTemperature);
}
/*******************************************************************************************************************************
*
*
* 云台部分
*
*
* *****************************************************************************************************************************/
/*********
*
*
* 收到云台俯仰
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Pitch(int DeviceName, int pitch)
{
UIcontrol_ObtainGimbal_Pitch(DeviceName, pitch);
}
/*********
*
*
* 收到云台航向
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Yaw(int DeviceName, int yaw)
{
}
/*********
*
*
* 收到云台俯仰微调值
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int FrameSequence,int pitch)
*
**********/
T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int FrameSequence, int pitch)
{
printf("收到云台俯仰微调值\n");
//2、发送到本地处理
UIcontrol_Obtain_GimbalPitchFineTuninng(DeviceName, pitch);
// 2、发送到本地处理
UIcontrol_Obtain_GimbalPitchFineTuninng(DeviceName, pitch);
//3、回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
// 3、回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
}
/*******************************************************************************************************************************
*
*
* 警灯部分
*
*
* *****************************************************************************************************************************/
/*********
*
*
* 收到警灯状态
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Status(int DeviceName, int status, int mode)
{
UIcontrol_ObtainWarningLight_Status(DeviceName, status, mode);
}
/*********
*
*
* 收到警灯颜色
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Color(int DeviceName, int color1, int color2)
{
UIcontrol_ObtainWarningLight_Color(DeviceName, color1, color2);
}
/*********
*
*
* 收到产品序列号
*
**********/
*
**********/
T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int SerialNumber)
{
}
/********************************************************************************************************
********* ********|
********* ********|
... ... @@ -822,41 +863,41 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int Ser
*********************************************************************************************************/
/*********
*
*
* 设置云台最大值最小值
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_SetGimbalRange(int DeviceName, int value)
{
return UIcontrol_SetGimbalRange(DeviceName, value);
}
/*********
*
*
* 设置云台联动
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_GimbalLinkageControl(int DeviceName, int FrameSequence, int value)
{
//1、设置本地的云台联动
// 1、设置本地的云台联动
int ret = UIcontrol_Set_GimbalLinkageControl(DeviceName, value);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
// 回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence);
}
else
{
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
// 回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
}
}
/*********
*
*
* 查询云台联动
*
**********/
*
**********/
T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int FrameSequence)
{
int LinkageValue;
... ... @@ -864,40 +905,38 @@ T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int Frame
T_JZsdkReturnCode ret = UIcontrol_CheckStatus_GimbalLinkage(&LinkageValue);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
// 回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence);
}
//成功则发送云台联动值
// 成功则发送云台联动值
JZsdk_Uart_SendDeal_GimbalLinkageControl(DeviceName, FrameSequence, LinkageValue);
}
/*
*
* 设置本地从设备名
*
*/
*
* 设置本地从设备名
*
*/
T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName)
{
printf("设置本地从设备名%x\n",DeviceName);
printf("设置本地从设备名%x\n", DeviceName);
SecondaryDeviceName = DeviceName;
return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
}
/*
*
* 获取本地从设备名
*
*/
*
* 获取本地从设备名
*
*/
int JZsdk_Uart_GetSecondaryDeviceName()
{
return SecondaryDeviceName;
}
/********************************************************************************************************
********* ********|
********* ********|
... ... @@ -913,32 +952,32 @@ int JZsdk_Uart_GetSecondaryDeviceName()
*********************************************************************************************************/
/**
*
*
* 查询从设备名
*
*/
*
*/
int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence)
{
//1、发送查询一遍从设备名, 通常位于 串口1
// 1、发送查询一遍从设备名, 通常位于 串口1
JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(UART_DEV_1, FrameSequence);
}
/*********
*
*
* 收到云台联动值
*
**********/
T_JZsdkReturnCode JZsdk_Uart_ObtainGimbalLinkage(int DeviceName,int FrameSequence, int value)
*
**********/
T_JZsdkReturnCode JZsdk_Uart_ObtainGimbalLinkage(int DeviceName, int FrameSequence, int value)
{
T_JZsdkReturnCode ret = UIcontrol_Obtain_GimbalLinkage(DeviceName, value);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
// 回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
}
else
{
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence);
// 回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence);
}
}
\ No newline at end of file
... ...
... ... @@ -62,6 +62,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode);
T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName);
T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SerialNumber(int UartPort, int FrameSequence);
... ... @@ -132,6 +133,10 @@ int JZsdk_Uart_GetSecondaryDeviceName();
T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName);
int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence);
T_JZsdkReturnCode JZsdk_Uart_OutPutPower_Control(int DeviceName, int FrameSequence, int Value);
T_JZsdkReturnCode JZsdk_Uart_Checkstatus_OutPutPower(int DeviceName, int FrameSequence);
#ifdef __cplusplus
}
#endif
... ...
... ... @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value);
**********/
static int Uart_4G_RecvDeal_AskForConnect(char *getbuf)
{
USER_LOG_INFO("串口设备4G,连接成功");
JZSDK_LOG_INFO("串口设备4g,连接成功");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -50,7 +50,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf)
JZsdk_Uart_SendDeal_Send_Connect(UART_4G, Device_name);
//1、将串口程序设置为连接模式
//JZsdk_Uart_SetMainWorkMode(JZ_FLAGCODE_ON);
//JZsdk_Uart_SetMainWorkMode(JZ_FLAGCODE_ON);s
}
/*******************************************************************************************************************************
... ... @@ -67,7 +67,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf)
**********/
static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf)
{
USER_LOG_INFO("开启MP2实时喊话功能\n");
JZSDK_LOG_INFO("开启MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -111,7 +111,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf)
**********/
static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
{
USER_LOG_INFO("MP2实时喊话传输中\n");
JZSDK_LOG_INFO("MP2实时喊话传输中\n");
T_JZsdkReturnCode ret;
//传输数据接口
... ... @@ -126,7 +126,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
**********/
static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf)
{
USER_LOG_INFO("关闭MP2实时喊话功能\n");
JZSDK_LOG_INFO("关闭MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -157,7 +157,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -168,7 +168,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
char FileName[1024];
memset(FileName,0,1024);
memcpy(FileName, &getbuf[9], FileNameLen);
USER_LOG_INFO("保存的文件名为%s",FileName);
JZSDK_LOG_INFO("保存的文件名为%s",FileName);
T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -192,7 +192,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
**********/
static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len)
{
USER_LOG_INFO("传输音频文件中\n");
JZSDK_LOG_INFO("传输音频文件中\n");
JZsdk_Uart_SaveAudioFileTrans(getdata, len);
}
/*********
... ... @@ -203,7 +203,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int l
**********/
static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -223,7 +223,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf)
{
T_JZsdkReturnCode ret;
USER_LOG_INFO("播放指定音频\n");
JZSDK_LOG_INFO("播放指定音频\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -238,7 +238,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf)
memset(music_name, 0, 256);
memcpy(music_name, &getbuf[9], datasize);
USER_LOG_INFO("播放指定音频:%s\n",music_name);
JZSDK_LOG_INFO("播放指定音频:%s\n",music_name);
ret = JZsdk_Uart_PlayMusic(UART_4G, music_name, datasize);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -260,7 +260,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf)
{
USER_LOG_INFO("音频继续播放\n");
JZSDK_LOG_INFO("音频继续播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -277,7 +277,7 @@ static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf)
{
USER_LOG_INFO("音频暂停播放\n");
JZSDK_LOG_INFO("音频暂停播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -294,7 +294,7 @@ static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf)
{
USER_LOG_INFO("音频停止播放\n");
JZSDK_LOG_INFO("音频停止播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -312,7 +312,7 @@ static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf)
{
USER_LOG_INFO("音频上一曲\n");
JZSDK_LOG_INFO("音频上一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -330,7 +330,7 @@ static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf)
{
USER_LOG_INFO("音频下一曲\n");
JZSDK_LOG_INFO("音频下一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -348,7 +348,7 @@ static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf)
**********/
static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf)
{
USER_LOG_INFO("获取音乐列表\n");
JZSDK_LOG_INFO("获取音乐列表\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -390,7 +390,7 @@ static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -408,7 +408,7 @@ static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Amplifier_open(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -437,7 +437,7 @@ static int Uart_4G_RecvDeal_Amplifier_auto()
**********/
static int Uart_4G_RecvDeal_SetVolume(char *getbuf)
{
USER_LOG_INFO("调节音量\n");
JZSDK_LOG_INFO("调节音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -456,7 +456,7 @@ static int Uart_4G_RecvDeal_SetVolume(char *getbuf)
**********/
static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf)
{
USER_LOG_INFO("查询音量\n");
JZSDK_LOG_INFO("查询音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -479,7 +479,7 @@ static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf)
{
//查询播放状态
USER_LOG_INFO("查询播放状态\n");
JZSDK_LOG_INFO("查询播放状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -504,7 +504,7 @@ static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf)
{
//查询云台角度
USER_LOG_INFO("查询云台角度\n");
JZSDK_LOG_INFO("查询云台角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -514,9 +514,6 @@ static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf)
JZsdk_Uart_CheckStatus_gimbal(&PitchAngle, &YawAngle);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence);
//2、发送本地云台值
JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(UART_4G, PitchAngle);
}
... ... @@ -543,7 +540,7 @@ static int Uart_4G_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
{
//查询播放文件名
USER_LOG_INFO("查询播放文件名\n");
JZSDK_LOG_INFO("查询播放文件名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -552,7 +549,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
int MusicName_Len;
JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len);
USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence);
... ... @@ -569,7 +566,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
{
//查询软件版本号
USER_LOG_INFO("查询软件版本号\n");
JZSDK_LOG_INFO("查询软件版本号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -580,7 +577,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
//1、获取版本号
JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion);
USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence);
... ... @@ -597,7 +594,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
{
//查询是否打开循环
USER_LOG_INFO("查询是否打开循环\n");
JZSDK_LOG_INFO("查询是否打开循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -605,7 +602,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay();
if (LoopStatus < 0)
{
USER_LOG_INFO("循环状态获取失败");
JZSDK_LOG_INFO("循环状态获取失败");
return -1;
}
... ... @@ -624,7 +621,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
{
//查询音色
USER_LOG_INFO("查询音色\n");
JZSDK_LOG_INFO("查询音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -632,7 +629,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone();
if (TTS_tone < 0)
{
USER_LOG_INFO("音色获取失败");
JZSDK_LOG_INFO("音色获取失败");
return -1;
}
... ... @@ -652,7 +649,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
{
//查询语速
USER_LOG_INFO("查询语速\n");
JZSDK_LOG_INFO("查询语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -660,7 +657,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed();
if (TTS_speed < 0)
{
USER_LOG_INFO("语速获取失败");
JZSDK_LOG_INFO("语速获取失败");
return -1;
}
... ... @@ -681,7 +678,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
**********/
static int Uart_4G_RecvDeal_PlayLoop(char *getbuf)
{
USER_LOG_INFO("开启关闭循环\n");
JZSDK_LOG_INFO("开启关闭循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -711,7 +708,7 @@ static int Uart_4G_RecvDeal_PlayLoop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf)
{
USER_LOG_INFO("删除音频操作\n");
JZSDK_LOG_INFO("删除音频操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -744,7 +741,7 @@ static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Delete_VoiceRecord(char *getbuf)
{
USER_LOG_INFO("删除录音操作\n");
JZSDK_LOG_INFO("删除录音操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -786,7 +783,7 @@ static int Uart_4G_RecvDeal_Delete_VideoRecord()
**********/
static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf)
{
USER_LOG_INFO("tts设置音色\n");
JZSDK_LOG_INFO("tts设置音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -814,16 +811,16 @@ static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf)
**********/
static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf)
{
USER_LOG_INFO("设置语速\n");
JZSDK_LOG_INFO("设置语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、从帧数据从获取语速
int speed = (int)getbuf[9];
USER_LOG_INFO("获取的语速为:%d",speed);
JZSDK_LOG_INFO("获取的语速为:%d",speed);
if (speed > 100 || speed < 0)
{
USER_LOG_INFO("语速超出范围\n");
JZSDK_LOG_INFO("语速超出范围\n");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence);
... ... @@ -854,12 +851,12 @@ static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf)
// 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送
static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf)
{
USER_LOG_INFO("tts开始传输");
JZSDK_LOG_INFO("tts开始传输");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、重置缓冲区
memset(TTS_Recv_buffer, '\0', 1009);
memset(TTS_Recv_buffer, 0, 1009);
//2、重置缓冲区长度
TTS_Recv_buffer_length = 0;
... ... @@ -878,7 +875,7 @@ static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf)
**********/
static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
{
USER_LOG_INFO("tts传输中");
JZSDK_LOG_INFO("tts传输中");
if (TTS_Recv_buffer_length+len < 1000)
{
... ... @@ -890,9 +887,10 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
}
else
{
USER_LOG_ERROR("TTS字数超出1000字");
JZSDK_LOG_ERROR("TTS字数超出1000字节");
}
}
/*********
*
* tts传输结束
... ... @@ -901,12 +899,13 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
**********/
static int Uart_4G_RecvDeal_TTS_Trans_stop(char *getbuf)
{
USER_LOG_INFO("tts传输结束");
JZSDK_LOG_INFO("tts传输结束");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、打印一次TTS文本
USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
//2、播放TTS
JZsdk_Uart_TTS_Play(UART_4G, TTS_Recv_buffer, TTS_Recv_buffer_length);
... ... @@ -924,7 +923,7 @@ static int Uart_4G_RecvDeal_TTS_Trans_stop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf)
{
USER_LOG_INFO("打开opus传输\n");
JZSDK_LOG_INFO("打开opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -941,7 +940,7 @@ static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf)
//3、修改接收模式为传输opus
JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION);
USER_LOG_INFO("已完成打开opus传输处理\n");
JZSDK_LOG_INFO("已完成打开opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence);
... ... @@ -956,7 +955,7 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
{
JZsdk_Uart_SaveOpusTrans(SaveData,size);
USER_LOG_INFO("已完成opus传输保存处理\n");
JZSDK_LOG_INFO("已完成opus传输保存处理\n");
}
/*********
*
... ... @@ -966,13 +965,13 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
**********/
static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf)
{
USER_LOG_INFO("结束opus传输\n");
JZSDK_LOG_INFO("结束opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_SaveOpusStop();
USER_LOG_INFO("结束opus传输处理\n");
JZSDK_LOG_INFO("结束opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence);
... ... @@ -985,7 +984,7 @@ static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_OpusPlay(char *getbuf)
{
USER_LOG_INFO("opus播放\n");
JZSDK_LOG_INFO("opus播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1005,7 +1004,7 @@ static int Uart_4G_RecvDeal_OpusPlay(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
{
USER_LOG_INFO("开启opus实时喊话功能\n");
JZSDK_LOG_INFO("开启opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1040,7 +1039,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len)
{
USER_LOG_INFO("opus语音传输中\n");
JZSDK_LOG_INFO("opus语音传输中\n");
JZsdk_Uart_RealTimeVoiceTrans(getdata, len);
}
... ... @@ -1052,7 +1051,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int l
**********/
static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
{
USER_LOG_INFO("关闭opus实时喊话功能\n");
JZSDK_LOG_INFO("关闭opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1082,7 +1081,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰控制\n");
JZSDK_LOG_INFO("云台俯仰控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1103,13 +1102,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台输入角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_4G, Gimbal_angle);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -1132,7 +1131,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰微调角度\n");
JZSDK_LOG_INFO("云台俯仰微调角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1140,7 +1139,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
int Gimbal_signal = getbuf[9];
//2、通过云台控制帧 获取云台角度绝对值
int Gimbal_angle = ((int)getbuf[10]) ;
int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (Gimbal_signal == 0x00)
... ... @@ -1153,13 +1152,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_4G, FrameSequence ,Gimbal_angle);
... ... @@ -1180,7 +1179,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf)
{
USER_LOG_INFO("设置爆闪频率\n");
JZSDK_LOG_INFO("设置爆闪频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1207,7 +1206,7 @@ static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf)
{
USER_LOG_INFO("设置灯光控制\n");
JZSDK_LOG_INFO("设置灯光控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1234,7 +1233,7 @@ static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("设置灯光亮度\n");
JZSDK_LOG_INFO("设置灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1262,7 +1261,7 @@ static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf)
**********/
static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf)
{
USER_LOG_INFO("灯光属性查询\n");
JZSDK_LOG_INFO("灯光属性查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1278,7 +1277,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf)
**********/
static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
{
USER_LOG_INFO("探照灯温度查询\n");
JZSDK_LOG_INFO("探照灯温度查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1293,7 +1292,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
{
USER_LOG_INFO("消息订阅控制\n");
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1313,6 +1312,55 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
}
}
/*********
*
* 查询产品序列号
*
**********/
static int Uart_4G_RecvDeal_CheckStatus_SerialNumber(char *getbuf)
{
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_CheckStatus_SerialNumber(UART_4G, FrameSequence);
}
/*********
*
* 对外供电开关
*
**********/
static int Uart_4G_RecvDeal_OutPutPower_Control(char *getbuf)
{
printf("对外电源控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取控制值
int Value = getbuf[9];
//控制
JZsdk_Uart_OutPutPower_Control(UART_4G, FrameSequence, Value);
}
/*********
*
* 对外电源查询
*
**********/
static int Uart_4G_RecvDeal_Checkstatus_OutPutPower(char *getbuf)
{
printf("对外电源查询\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取本地数值
JZsdk_Uart_Checkstatus_OutPutPower(UART_4G, FrameSequence);
}
/*******************************************************************************************************************************
*
* 警灯部分
... ... @@ -1325,7 +1373,7 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
**********/
static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf)
{
USER_LOG_INFO("警灯模式控制\n");
JZSDK_LOG_INFO("警灯模式控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1353,7 +1401,7 @@ static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf)
**********/
static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色选择\n");
JZSDK_LOG_INFO("警灯颜色选择\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1381,7 +1429,7 @@ static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf)
**********/
static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
{
USER_LOG_INFO("警灯状态查询\n");
JZSDK_LOG_INFO("警灯状态查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1397,7 +1445,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
**********/
static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色查询\n");
JZSDK_LOG_INFO("警灯颜色查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1436,7 +1484,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
{
USER_LOG_INFO("收到灯光频率\n");
JZSDK_LOG_INFO("收到灯光频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1454,7 +1502,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
{
USER_LOG_INFO("收到灯光模式\n");
JZSDK_LOG_INFO("收到灯光模式\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1472,7 +1520,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("收到灯光亮度\n");
JZSDK_LOG_INFO("收到灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1491,7 +1539,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
{
USER_LOG_INFO("收到探照灯温度\n");
JZSDK_LOG_INFO("收到探照灯温度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1510,7 +1558,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
{
USER_LOG_INFO("收到云台俯仰\n");
JZSDK_LOG_INFO("收到云台俯仰\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1541,7 +1589,7 @@ static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainGimbal_Yaw(char *getbuf)
{
USER_LOG_INFO("收到云台航向\n");
JZSDK_LOG_INFO("收到云台航向\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1579,7 +1627,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
int signal = getbuf[9];
//2、获取云台角度绝对值
int pitch = (int)getbuf[10] ;
int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (signal == 0x00)
... ... @@ -1601,7 +1649,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf)
{
USER_LOG_INFO("收到警灯状态\n");
JZSDK_LOG_INFO("收到警灯状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1620,7 +1668,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf)
{
USER_LOG_INFO("收到警灯颜色\n");
JZSDK_LOG_INFO("收到警灯颜色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1639,7 +1687,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf)
{
USER_LOG_INFO("收到产品序列号\n");
JZSDK_LOG_INFO("收到产品序列号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1670,7 +1718,7 @@ static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf)
**********/
static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("查询当前从设备名\n");
JZSDK_LOG_INFO("查询当前从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1699,7 +1747,7 @@ static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
**********/
static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf)
{
USER_LOG_INFO("设置云台最大值最小值\n");
JZSDK_LOG_INFO("设置云台最大值最小值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1726,7 +1774,7 @@ static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf)
**********/
static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf)
{
USER_LOG_INFO("设置云台联动\n");
JZSDK_LOG_INFO("设置云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1746,7 +1794,7 @@ static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf)
**********/
static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到查询是否开启云台联动\n");
JZSDK_LOG_INFO("收到查询是否开启云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1780,7 +1828,7 @@ static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("收到从设备名\n");
JZSDK_LOG_INFO("收到从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1812,7 +1860,7 @@ static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
**********/
static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到云台联动值\n");
JZSDK_LOG_INFO("收到云台联动值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1847,7 +1895,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf)
**********/
static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf)
{
USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
//无法正常获取帧的序列号
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, 0x00);
... ... @@ -1862,7 +1910,7 @@ static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf)
**********/
static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf)
{
USER_LOG_INFO("接受到操作成功\n");
JZSDK_LOG_INFO("接受到操作成功\n");
}
/*********
... ... @@ -1873,7 +1921,7 @@ static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf)
**********/
static int Uart_4G_RecvDeal_OperationFailed(char *getbuf)
{
USER_LOG_INFO("接受到操作失败\n");
JZSDK_LOG_INFO("接受到操作失败\n");
}
/********************************************************************************************************
********* ********|
... ... @@ -1890,7 +1938,7 @@ static int Uart_4G_RecvDeal_OperationFailed(char *getbuf)
*********************************************************************************************************/
int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len)
{
USER_LOG_INFO("串口设备4G,接受到的模式为:%x",Receive_mode);
JZSDK_LOG_INFO("串口设备4g,接受到的模式为:%x",Receive_mode);
switch (Receive_mode)
{
/*******************************************************************************************************************************
... ... @@ -2198,9 +2246,20 @@ int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len)
//序列号查询
case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER:
Uart_4G_RecvDeal_CheckStatus_SerialNumber(getdata);
break;
//向外供电开关
case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL:
Uart_4G_RecvDeal_OutPutPower_Control(getdata);
break;
//查询向外供电情况
case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER:
Uart_4G_RecvDeal_Checkstatus_OutPutPower(getdata);
break;
/*******************************************************************************************************************************
*
... ... @@ -2589,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_4G(unsigned char *getbuf, int len)
* ****************/
int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value)
{
USER_LOG_INFO("串口设备4G,二次修改接收模式%x\n",value);
JZSDK_LOG_INFO("串口设备4g,二次修改接收模式%x\n",value);
UART_4G_Receive_mode = value;
return 0;
}
\ No newline at end of file
... ...
... ... @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value);
**********/
static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf)
{
USER_LOG_INFO("串口设备1号,连接成功");
JZSDK_LOG_INFO("串口设备1号,连接成功");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -67,7 +67,7 @@ static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf)
{
USER_LOG_INFO("开启MP2实时喊话功能\n");
JZSDK_LOG_INFO("开启MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -111,7 +111,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
{
USER_LOG_INFO("MP2实时喊话传输中\n");
JZSDK_LOG_INFO("MP2实时喊话传输中\n");
T_JZsdkReturnCode ret;
//传输数据接口
... ... @@ -126,7 +126,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
**********/
static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf)
{
USER_LOG_INFO("关闭MP2实时喊话功能\n");
JZSDK_LOG_INFO("关闭MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -157,7 +157,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -168,7 +168,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
char FileName[1024];
memset(FileName,0,1024);
memcpy(FileName, &getbuf[9], FileNameLen);
USER_LOG_INFO("保存的文件名为%s",FileName);
JZSDK_LOG_INFO("保存的文件名为%s",FileName);
T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -192,7 +192,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
**********/
static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len)
{
USER_LOG_INFO("传输音频文件中\n");
JZSDK_LOG_INFO("传输音频文件中\n");
JZsdk_Uart_SaveAudioFileTrans(getdata, len);
}
/*********
... ... @@ -203,7 +203,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int
**********/
static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -223,7 +223,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf)
{
T_JZsdkReturnCode ret;
USER_LOG_INFO("播放指定音频\n");
JZSDK_LOG_INFO("播放指定音频\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -238,7 +238,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf)
memset(music_name, 0, 256);
memcpy(music_name, &getbuf[9], datasize);
USER_LOG_INFO("播放指定音频:%s\n",music_name);
JZSDK_LOG_INFO("播放指定音频:%s\n",music_name);
ret = JZsdk_Uart_PlayMusic(UART_DEV_1, music_name, datasize);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -260,7 +260,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf)
{
USER_LOG_INFO("音频继续播放\n");
JZSDK_LOG_INFO("音频继续播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -277,7 +277,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf)
{
USER_LOG_INFO("音频暂停播放\n");
JZSDK_LOG_INFO("音频暂停播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -294,7 +294,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf)
{
USER_LOG_INFO("音频停止播放\n");
JZSDK_LOG_INFO("音频停止播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -312,7 +312,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf)
{
USER_LOG_INFO("音频上一曲\n");
JZSDK_LOG_INFO("音频上一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -330,7 +330,7 @@ static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf)
{
USER_LOG_INFO("音频下一曲\n");
JZSDK_LOG_INFO("音频下一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -348,7 +348,7 @@ static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf)
{
USER_LOG_INFO("获取音乐列表\n");
JZSDK_LOG_INFO("获取音乐列表\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -390,7 +390,7 @@ static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -408,7 +408,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Amplifier_open(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -437,7 +437,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_auto()
**********/
static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf)
{
USER_LOG_INFO("调节音量\n");
JZSDK_LOG_INFO("调节音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -456,7 +456,7 @@ static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf)
{
USER_LOG_INFO("查询音量\n");
JZSDK_LOG_INFO("查询音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -479,7 +479,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf)
{
//查询播放状态
USER_LOG_INFO("查询播放状态\n");
JZSDK_LOG_INFO("查询播放状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -504,7 +504,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_gimbal(char *getbuf)
{
//查询云台角度
USER_LOG_INFO("查询云台角度\n");
JZSDK_LOG_INFO("查询云台角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -540,7 +540,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
{
//查询播放文件名
USER_LOG_INFO("查询播放文件名\n");
JZSDK_LOG_INFO("查询播放文件名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -549,7 +549,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
int MusicName_Len;
JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len);
USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
... ... @@ -566,7 +566,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
{
//查询软件版本号
USER_LOG_INFO("查询软件版本号\n");
JZSDK_LOG_INFO("查询软件版本号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -577,7 +577,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
//1、获取版本号
JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion);
USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
... ... @@ -594,7 +594,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
{
//查询是否打开循环
USER_LOG_INFO("查询是否打开循环\n");
JZSDK_LOG_INFO("查询是否打开循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -602,7 +602,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay();
if (LoopStatus < 0)
{
USER_LOG_INFO("循环状态获取失败");
JZSDK_LOG_INFO("循环状态获取失败");
return -1;
}
... ... @@ -621,7 +621,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
{
//查询音色
USER_LOG_INFO("查询音色\n");
JZSDK_LOG_INFO("查询音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -629,7 +629,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone();
if (TTS_tone < 0)
{
USER_LOG_INFO("音色获取失败");
JZSDK_LOG_INFO("音色获取失败");
return -1;
}
... ... @@ -649,7 +649,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
{
//查询语速
USER_LOG_INFO("查询语速\n");
JZSDK_LOG_INFO("查询语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -657,7 +657,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed();
if (TTS_speed < 0)
{
USER_LOG_INFO("语速获取失败");
JZSDK_LOG_INFO("语速获取失败");
return -1;
}
... ... @@ -678,7 +678,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf)
{
USER_LOG_INFO("开启关闭循环\n");
JZSDK_LOG_INFO("开启关闭循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -708,7 +708,7 @@ static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf)
{
USER_LOG_INFO("删除音频操作\n");
JZSDK_LOG_INFO("删除音频操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -741,7 +741,7 @@ static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Delete_VoiceRecord(char *getbuf)
{
USER_LOG_INFO("删除录音操作\n");
JZSDK_LOG_INFO("删除录音操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -783,7 +783,7 @@ static int Uart_DEV1_RecvDeal_Delete_VideoRecord()
**********/
static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf)
{
USER_LOG_INFO("tts设置音色\n");
JZSDK_LOG_INFO("tts设置音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -811,16 +811,16 @@ static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf)
{
USER_LOG_INFO("设置语速\n");
JZSDK_LOG_INFO("设置语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、从帧数据从获取语速
int speed = (int)getbuf[9];
USER_LOG_INFO("获取的语速为:%d",speed);
JZSDK_LOG_INFO("获取的语速为:%d",speed);
if (speed > 100 || speed < 0)
{
USER_LOG_INFO("语速超出范围\n");
JZSDK_LOG_INFO("语速超出范围\n");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence);
... ... @@ -851,7 +851,7 @@ static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf)
// 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送
static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf)
{
USER_LOG_INFO("tts开始传输");
JZSDK_LOG_INFO("tts开始传输");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -875,7 +875,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
{
USER_LOG_INFO("tts传输中");
JZSDK_LOG_INFO("tts传输中");
if (TTS_Recv_buffer_length+len < 1000)
{
... ... @@ -887,7 +887,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
}
else
{
USER_LOG_ERROR("TTS字数超出1000字节");
JZSDK_LOG_ERROR("TTS字数超出1000字节");
}
}
... ... @@ -899,13 +899,13 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
**********/
static int Uart_DEV1_RecvDeal_TTS_Trans_stop(char *getbuf)
{
USER_LOG_INFO("tts传输结束");
JZSDK_LOG_INFO("tts传输结束");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、打印一次TTS文本
USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
//2、播放TTS
JZsdk_Uart_TTS_Play(UART_DEV_1, TTS_Recv_buffer, TTS_Recv_buffer_length);
... ... @@ -923,7 +923,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_stop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf)
{
USER_LOG_INFO("打开opus传输\n");
JZSDK_LOG_INFO("打开opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -940,7 +940,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf)
//3、修改接收模式为传输opus
JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION);
USER_LOG_INFO("已完成打开opus传输处理\n");
JZSDK_LOG_INFO("已完成打开opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
... ... @@ -955,7 +955,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
{
JZsdk_Uart_SaveOpusTrans(SaveData,size);
USER_LOG_INFO("已完成opus传输保存处理\n");
JZSDK_LOG_INFO("已完成opus传输保存处理\n");
}
/*********
*
... ... @@ -965,13 +965,13 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
**********/
static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf)
{
USER_LOG_INFO("结束opus传输\n");
JZSDK_LOG_INFO("结束opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_SaveOpusStop();
USER_LOG_INFO("结束opus传输处理\n");
JZSDK_LOG_INFO("结束opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence);
... ... @@ -984,7 +984,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf)
{
USER_LOG_INFO("opus播放\n");
JZSDK_LOG_INFO("opus播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1004,7 +1004,7 @@ static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
{
USER_LOG_INFO("开启opus实时喊话功能\n");
JZSDK_LOG_INFO("开启opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1039,7 +1039,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len)
{
USER_LOG_INFO("opus语音传输中\n");
JZSDK_LOG_INFO("opus语音传输中\n");
JZsdk_Uart_RealTimeVoiceTrans(getdata, len);
}
... ... @@ -1051,7 +1051,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int
**********/
static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
{
USER_LOG_INFO("关闭opus实时喊话功能\n");
JZSDK_LOG_INFO("关闭opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1081,7 +1081,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰控制\n");
JZSDK_LOG_INFO("云台俯仰控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1102,13 +1102,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台输入角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_1, Gimbal_angle);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -1131,7 +1131,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰微调角度\n");
JZSDK_LOG_INFO("云台俯仰微调角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1139,7 +1139,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
int Gimbal_signal = getbuf[9];
//2、通过云台控制帧 获取云台角度绝对值
int Gimbal_angle = ((int)getbuf[10]) ;
int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (Gimbal_signal == 0x00)
... ... @@ -1152,13 +1152,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_1, FrameSequence ,Gimbal_angle);
... ... @@ -1179,7 +1179,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf)
{
USER_LOG_INFO("设置爆闪频率\n");
JZSDK_LOG_INFO("设置爆闪频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1206,7 +1206,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf)
{
USER_LOG_INFO("设置灯光控制\n");
JZSDK_LOG_INFO("设置灯光控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1233,7 +1233,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("设置灯光亮度\n");
JZSDK_LOG_INFO("设置灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1261,7 +1261,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf)
{
USER_LOG_INFO("灯光属性查询\n");
JZSDK_LOG_INFO("灯光属性查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1277,7 +1277,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
{
USER_LOG_INFO("探照灯温度查询\n");
JZSDK_LOG_INFO("探照灯温度查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1292,7 +1292,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
{
USER_LOG_INFO("消息订阅控制\n");
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1312,6 +1312,55 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
}
}
/*********
*
* 查询产品序列号
*
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_SerialNumber(char *getbuf)
{
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_CheckStatus_SerialNumber(UART_DEV_1, FrameSequence);
}
/*********
*
* 对外供电开关
*
**********/
static int Uart_DEV1_RecvDeal_OutPutPower_Control(char *getbuf)
{
printf("对外电源控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取控制值
int Value = getbuf[9];
//控制
JZsdk_Uart_OutPutPower_Control(UART_DEV_1, FrameSequence, Value);
}
/*********
*
* 对外电源查询
*
**********/
static int Uart_DEV1_RecvDeal_Checkstatus_OutPutPower(char *getbuf)
{
printf("对外电源查询\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取本地数值
JZsdk_Uart_Checkstatus_OutPutPower(UART_DEV_1, FrameSequence);
}
/*******************************************************************************************************************************
*
* 警灯部分
... ... @@ -1324,7 +1373,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf)
{
USER_LOG_INFO("警灯模式控制\n");
JZSDK_LOG_INFO("警灯模式控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1352,7 +1401,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色选择\n");
JZSDK_LOG_INFO("警灯颜色选择\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1380,7 +1429,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
{
USER_LOG_INFO("警灯状态查询\n");
JZSDK_LOG_INFO("警灯状态查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1396,7 +1445,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色查询\n");
JZSDK_LOG_INFO("警灯颜色查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1435,7 +1484,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
{
USER_LOG_INFO("收到灯光频率\n");
JZSDK_LOG_INFO("收到灯光频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1453,7 +1502,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
{
USER_LOG_INFO("收到灯光模式\n");
JZSDK_LOG_INFO("收到灯光模式\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1471,7 +1520,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("收到灯光亮度\n");
JZSDK_LOG_INFO("收到灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1490,7 +1539,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
{
USER_LOG_INFO("收到探照灯温度\n");
JZSDK_LOG_INFO("收到探照灯温度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1509,7 +1558,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
{
USER_LOG_INFO("收到云台俯仰\n");
JZSDK_LOG_INFO("收到云台俯仰\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1540,7 +1589,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainGimbal_Yaw(char *getbuf)
{
USER_LOG_INFO("收到云台航向\n");
JZSDK_LOG_INFO("收到云台航向\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1578,7 +1627,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
int signal = getbuf[9];
//2、获取云台角度绝对值
int pitch = (int)getbuf[10] ;
int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (signal == 0x00)
... ... @@ -1600,7 +1649,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf)
{
USER_LOG_INFO("收到警灯状态\n");
JZSDK_LOG_INFO("收到警灯状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1619,7 +1668,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf)
{
USER_LOG_INFO("收到警灯颜色\n");
JZSDK_LOG_INFO("收到警灯颜色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1638,7 +1687,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf)
{
USER_LOG_INFO("收到产品序列号\n");
JZSDK_LOG_INFO("收到产品序列号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1669,7 +1718,7 @@ static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("查询当前从设备名\n");
JZSDK_LOG_INFO("查询当前从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1698,7 +1747,7 @@ static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf)
{
USER_LOG_INFO("设置云台最大值最小值\n");
JZSDK_LOG_INFO("设置云台最大值最小值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1725,7 +1774,7 @@ static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf)
{
USER_LOG_INFO("设置云台联动\n");
JZSDK_LOG_INFO("设置云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1745,7 +1794,7 @@ static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到查询是否开启云台联动\n");
JZSDK_LOG_INFO("收到查询是否开启云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1779,7 +1828,7 @@ static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("收到从设备名\n");
JZSDK_LOG_INFO("收到从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1811,7 +1860,7 @@ static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到云台联动值\n");
JZSDK_LOG_INFO("收到云台联动值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1846,7 +1895,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf)
{
USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
//无法正常获取帧的序列号
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, 0x00);
... ... @@ -1861,7 +1910,7 @@ static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf)
{
USER_LOG_INFO("接受到操作成功\n");
JZSDK_LOG_INFO("接受到操作成功\n");
}
/*********
... ... @@ -1872,7 +1921,7 @@ static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf)
**********/
static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf)
{
USER_LOG_INFO("接受到操作失败\n");
JZSDK_LOG_INFO("接受到操作失败\n");
}
/********************************************************************************************************
********* ********|
... ... @@ -1889,7 +1938,7 @@ static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf)
*********************************************************************************************************/
int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len)
{
USER_LOG_INFO("串口设备1号,接受到的模式为:%x",Receive_mode);
JZSDK_LOG_INFO("串口设备1号,接受到的模式为:%x",Receive_mode);
switch (Receive_mode)
{
/*******************************************************************************************************************************
... ... @@ -2197,10 +2246,21 @@ int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le
//序列号查询
case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER:
Uart_DEV1_RecvDeal_CheckStatus_SerialNumber(getdata);
break;
//向外供电开关
case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL:
Uart_DEV1_RecvDeal_OutPutPower_Control(getdata);
break;
//查询向外供电情况
case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER:
Uart_DEV1_RecvDeal_Checkstatus_OutPutPower(getdata);
break;
/*******************************************************************************************************************************
*
* 5B类部分
... ... @@ -2588,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV1(unsigned char *getbuf, int len)
* ****************/
int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value)
{
USER_LOG_INFO("串口设备1号,二次修改接收模式%x\n",value);
JZSDK_LOG_INFO("串口设备1号,二次修改接收模式%x\n",value);
UART_DEV1_Receive_mode = value;
return 0;
}
\ No newline at end of file
... ...
... ... @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value);
**********/
static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf)
{
USER_LOG_INFO("串口设备2号,连接成功");
JZSDK_LOG_INFO("串口设备2号,连接成功");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -67,7 +67,7 @@ static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf)
{
USER_LOG_INFO("开启MP2实时喊话功能\n");
JZSDK_LOG_INFO("开启MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -111,7 +111,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
{
USER_LOG_INFO("MP2实时喊话传输中\n");
JZSDK_LOG_INFO("MP2实时喊话传输中\n");
T_JZsdkReturnCode ret;
//传输数据接口
... ... @@ -126,7 +126,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len)
**********/
static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf)
{
USER_LOG_INFO("关闭MP2实时喊话功能\n");
JZSDK_LOG_INFO("关闭MP2实时喊话功能\n");
T_JZsdkReturnCode ret;
//获取帧的序列号
... ... @@ -157,7 +157,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -168,7 +168,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
char FileName[1024];
memset(FileName,0,1024);
memcpy(FileName, &getbuf[9], FileNameLen);
USER_LOG_INFO("保存的文件名为%s",FileName);
JZSDK_LOG_INFO("保存的文件名为%s",FileName);
T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName);
if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -192,7 +192,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len)
**********/
static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len)
{
USER_LOG_INFO("传输音频文件中\n");
JZSDK_LOG_INFO("传输音频文件中\n");
JZsdk_Uart_SaveAudioFileTrans(getdata, len);
}
/*********
... ... @@ -203,7 +203,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int
**********/
static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
{
USER_LOG_INFO("开始传输的音频文件保存\n");
JZSDK_LOG_INFO("开始传输的音频文件保存\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -223,7 +223,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf)
static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf)
{
T_JZsdkReturnCode ret;
USER_LOG_INFO("播放指定音频\n");
JZSDK_LOG_INFO("播放指定音频\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -238,7 +238,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf)
memset(music_name, 0, 256);
memcpy(music_name, &getbuf[9], datasize);
USER_LOG_INFO("播放指定音频:%s\n",music_name);
JZSDK_LOG_INFO("播放指定音频:%s\n",music_name);
ret = JZsdk_Uart_PlayMusic(UART_DEV_2, music_name, datasize);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -260,7 +260,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf)
{
USER_LOG_INFO("音频继续播放\n");
JZSDK_LOG_INFO("音频继续播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -277,7 +277,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf)
{
USER_LOG_INFO("音频暂停播放\n");
JZSDK_LOG_INFO("音频暂停播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -294,7 +294,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf)
{
USER_LOG_INFO("音频停止播放\n");
JZSDK_LOG_INFO("音频停止播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -312,7 +312,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf)
{
USER_LOG_INFO("音频上一曲\n");
JZSDK_LOG_INFO("音频上一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -330,7 +330,7 @@ static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf)
{
USER_LOG_INFO("音频下一曲\n");
JZSDK_LOG_INFO("音频下一曲\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -348,7 +348,7 @@ static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf)
{
USER_LOG_INFO("获取音乐列表\n");
JZSDK_LOG_INFO("获取音乐列表\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -390,7 +390,7 @@ static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -408,7 +408,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Amplifier_open(char *getbuf)
{
USER_LOG_INFO("强制关闭功放\n");
JZSDK_LOG_INFO("强制关闭功放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -437,7 +437,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_auto()
**********/
static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf)
{
USER_LOG_INFO("调节音量\n");
JZSDK_LOG_INFO("调节音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -456,7 +456,7 @@ static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf)
{
USER_LOG_INFO("查询音量\n");
JZSDK_LOG_INFO("查询音量\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -479,7 +479,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf)
{
//查询播放状态
USER_LOG_INFO("查询播放状态\n");
JZSDK_LOG_INFO("查询播放状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -504,7 +504,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_gimbal(char *getbuf)
{
//查询云台角度
USER_LOG_INFO("查询云台角度\n");
JZSDK_LOG_INFO("查询云台角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -540,7 +540,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
{
//查询播放文件名
USER_LOG_INFO("查询播放文件名\n");
JZSDK_LOG_INFO("查询播放文件名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -549,7 +549,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
int MusicName_Len;
JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len);
USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence);
... ... @@ -566,7 +566,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
{
//查询软件版本号
USER_LOG_INFO("查询软件版本号\n");
JZSDK_LOG_INFO("查询软件版本号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -577,7 +577,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
//1、获取版本号
JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion);
USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion);
//回复操作成功
//JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence);
... ... @@ -594,7 +594,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
{
//查询是否打开循环
USER_LOG_INFO("查询是否打开循环\n");
JZSDK_LOG_INFO("查询是否打开循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -602,7 +602,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay();
if (LoopStatus < 0)
{
USER_LOG_INFO("循环状态获取失败");
JZSDK_LOG_INFO("循环状态获取失败");
return -1;
}
... ... @@ -621,7 +621,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
{
//查询音色
USER_LOG_INFO("查询音色\n");
JZSDK_LOG_INFO("查询音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -629,7 +629,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone();
if (TTS_tone < 0)
{
USER_LOG_INFO("音色获取失败");
JZSDK_LOG_INFO("音色获取失败");
return -1;
}
... ... @@ -649,7 +649,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf)
static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
{
//查询语速
USER_LOG_INFO("查询语速\n");
JZSDK_LOG_INFO("查询语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -657,7 +657,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed();
if (TTS_speed < 0)
{
USER_LOG_INFO("语速获取失败");
JZSDK_LOG_INFO("语速获取失败");
return -1;
}
... ... @@ -678,7 +678,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf)
{
USER_LOG_INFO("开启关闭循环\n");
JZSDK_LOG_INFO("开启关闭循环\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -708,7 +708,7 @@ static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf)
{
USER_LOG_INFO("删除音频操作\n");
JZSDK_LOG_INFO("删除音频操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -741,7 +741,7 @@ static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Delete_VoiceRecord(char *getbuf)
{
USER_LOG_INFO("删除录音操作\n");
JZSDK_LOG_INFO("删除录音操作\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -783,7 +783,7 @@ static int Uart_DEV2_RecvDeal_Delete_VideoRecord()
**********/
static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf)
{
USER_LOG_INFO("tts设置音色\n");
JZSDK_LOG_INFO("tts设置音色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -811,16 +811,16 @@ static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf)
{
USER_LOG_INFO("设置语速\n");
JZSDK_LOG_INFO("设置语速\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、从帧数据从获取语速
int speed = (int)getbuf[9];
USER_LOG_INFO("获取的语速为:%d",speed);
JZSDK_LOG_INFO("获取的语速为:%d",speed);
if (speed > 100 || speed < 0)
{
USER_LOG_INFO("语速超出范围\n");
JZSDK_LOG_INFO("语速超出范围\n");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence);
... ... @@ -851,12 +851,12 @@ static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf)
// 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送
static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf)
{
USER_LOG_INFO("tts开始传输");
JZSDK_LOG_INFO("tts开始传输");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、重置缓冲区
memset(TTS_Recv_buffer, '\0', 1009);
memset(TTS_Recv_buffer, 0, 1009);
//2、重置缓冲区长度
TTS_Recv_buffer_length = 0;
... ... @@ -875,7 +875,7 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
{
USER_LOG_INFO("tts传输中");
JZSDK_LOG_INFO("tts传输中");
if (TTS_Recv_buffer_length+len < 1000)
{
... ... @@ -887,9 +887,10 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
}
else
{
USER_LOG_ERROR("TTS字数超出1000字");
JZSDK_LOG_ERROR("TTS字数超出1000字节");
}
}
/*********
*
* tts传输结束
... ... @@ -898,12 +899,13 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len)
**********/
static int Uart_DEV2_RecvDeal_TTS_Trans_stop(char *getbuf)
{
USER_LOG_INFO("tts传输结束");
JZSDK_LOG_INFO("tts传输结束");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//1、打印一次TTS文本
USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer);
//2、播放TTS
JZsdk_Uart_TTS_Play(UART_DEV_2, TTS_Recv_buffer, TTS_Recv_buffer_length);
... ... @@ -921,7 +923,7 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_stop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf)
{
USER_LOG_INFO("打开opus传输\n");
JZSDK_LOG_INFO("打开opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -938,7 +940,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf)
//3、修改接收模式为传输opus
JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION);
USER_LOG_INFO("已完成打开opus传输处理\n");
JZSDK_LOG_INFO("已完成打开opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence);
... ... @@ -953,7 +955,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
{
JZsdk_Uart_SaveOpusTrans(SaveData,size);
USER_LOG_INFO("已完成opus传输保存处理\n");
JZSDK_LOG_INFO("已完成opus传输保存处理\n");
}
/*********
*
... ... @@ -963,13 +965,13 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size)
**********/
static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf)
{
USER_LOG_INFO("结束opus传输\n");
JZSDK_LOG_INFO("结束opus传输\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_SaveOpusStop();
USER_LOG_INFO("结束opus传输处理\n");
JZSDK_LOG_INFO("结束opus传输处理\n");
//回复操作成功
JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence);
... ... @@ -982,7 +984,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf)
{
USER_LOG_INFO("opus播放\n");
JZSDK_LOG_INFO("opus播放\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1002,7 +1004,7 @@ static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
{
USER_LOG_INFO("开启opus实时喊话功能\n");
JZSDK_LOG_INFO("开启opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1037,7 +1039,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len)
{
USER_LOG_INFO("opus语音传输中\n");
JZSDK_LOG_INFO("opus语音传输中\n");
JZsdk_Uart_RealTimeVoiceTrans(getdata, len);
}
... ... @@ -1049,7 +1051,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int
**********/
static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
{
USER_LOG_INFO("关闭opus实时喊话功能\n");
JZSDK_LOG_INFO("关闭opus实时喊话功能\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1079,7 +1081,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰控制\n");
JZSDK_LOG_INFO("云台俯仰控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1100,13 +1102,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台输入角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle);
T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_2, Gimbal_angle);
if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
... ... @@ -1129,7 +1131,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
{
USER_LOG_INFO("云台俯仰微调角度\n");
JZSDK_LOG_INFO("云台俯仰微调角度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1137,7 +1139,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
int Gimbal_signal = getbuf[9];
//2、通过云台控制帧 获取云台角度绝对值
int Gimbal_angle = ((int)getbuf[10]) ;
int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (Gimbal_signal == 0x00)
... ... @@ -1150,13 +1152,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
}
else
{
USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制");
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence);
return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE;
}
USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle);
JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_2, FrameSequence ,Gimbal_angle);
... ... @@ -1177,7 +1179,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf)
{
USER_LOG_INFO("设置爆闪频率\n");
JZSDK_LOG_INFO("设置爆闪频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1204,7 +1206,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf)
{
USER_LOG_INFO("设置灯光控制\n");
JZSDK_LOG_INFO("设置灯光控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1231,7 +1233,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("设置灯光亮度\n");
JZSDK_LOG_INFO("设置灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1259,7 +1261,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf)
{
USER_LOG_INFO("灯光属性查询\n");
JZSDK_LOG_INFO("灯光属性查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1275,7 +1277,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
{
USER_LOG_INFO("探照灯温度查询\n");
JZSDK_LOG_INFO("探照灯温度查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1290,7 +1292,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
{
USER_LOG_INFO("消息订阅控制\n");
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1310,6 +1312,55 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
}
}
/*********
*
* 查询产品序列号
*
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_SerialNumber(char *getbuf)
{
JZSDK_LOG_INFO("消息订阅控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
JZsdk_Uart_CheckStatus_SerialNumber(UART_DEV_2, FrameSequence);
}
/*********
*
* 对外供电开关
*
**********/
static int Uart_DEV2_RecvDeal_OutPutPower_Control(char *getbuf)
{
printf("对外电源控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取控制值
int Value = getbuf[9];
//控制
JZsdk_Uart_OutPutPower_Control(UART_DEV_2, FrameSequence, Value);
}
/*********
*
* 对外电源查询
*
**********/
static int Uart_DEV2_RecvDeal_Checkstatus_OutPutPower(char *getbuf)
{
printf("对外电源查询\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
//获取本地数值
JZsdk_Uart_Checkstatus_OutPutPower(UART_DEV_2, FrameSequence);
}
/*******************************************************************************************************************************
*
* 警灯部分
... ... @@ -1322,7 +1373,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf)
{
USER_LOG_INFO("警灯模式控制\n");
JZSDK_LOG_INFO("警灯模式控制\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1350,7 +1401,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色选择\n");
JZSDK_LOG_INFO("警灯颜色选择\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1378,7 +1429,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
{
USER_LOG_INFO("警灯状态查询\n");
JZSDK_LOG_INFO("警灯状态查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1394,7 +1445,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
{
USER_LOG_INFO("警灯颜色查询\n");
JZSDK_LOG_INFO("警灯颜色查询\n");
//1、获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1433,7 +1484,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
{
USER_LOG_INFO("收到灯光频率\n");
JZSDK_LOG_INFO("收到灯光频率\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1451,7 +1502,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
{
USER_LOG_INFO("收到灯光模式\n");
JZSDK_LOG_INFO("收到灯光模式\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1469,7 +1520,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
{
USER_LOG_INFO("收到灯光亮度\n");
JZSDK_LOG_INFO("收到灯光亮度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1488,7 +1539,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
{
USER_LOG_INFO("收到探照灯温度\n");
JZSDK_LOG_INFO("收到探照灯温度\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1507,7 +1558,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
{
USER_LOG_INFO("收到云台俯仰\n");
JZSDK_LOG_INFO("收到云台俯仰\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1538,7 +1589,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainGimbal_Yaw(char *getbuf)
{
USER_LOG_INFO("收到云台航向\n");
JZSDK_LOG_INFO("收到云台航向\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1576,7 +1627,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
int signal = getbuf[9];
//2、获取云台角度绝对值
int pitch = (int)getbuf[10] ;
int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11];
//3、拼接得到云台值
if (signal == 0x00)
... ... @@ -1598,7 +1649,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf)
{
USER_LOG_INFO("收到警灯状态\n");
JZSDK_LOG_INFO("收到警灯状态\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1617,7 +1668,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf)
{
USER_LOG_INFO("收到警灯颜色\n");
JZSDK_LOG_INFO("收到警灯颜色\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1636,7 +1687,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf)
{
USER_LOG_INFO("收到产品序列号\n");
JZSDK_LOG_INFO("收到产品序列号\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1667,7 +1718,7 @@ static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("查询当前从设备名\n");
JZSDK_LOG_INFO("查询当前从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1696,7 +1747,7 @@ static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf)
{
USER_LOG_INFO("设置云台最大值最小值\n");
JZSDK_LOG_INFO("设置云台最大值最小值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1723,7 +1774,7 @@ static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf)
{
USER_LOG_INFO("设置云台联动\n");
JZSDK_LOG_INFO("设置云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1743,7 +1794,7 @@ static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到查询是否开启云台联动\n");
JZSDK_LOG_INFO("收到查询是否开启云台联动\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1777,7 +1828,7 @@ static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
{
USER_LOG_INFO("收到从设备名\n");
JZSDK_LOG_INFO("收到从设备名\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1809,7 +1860,7 @@ static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf)
{
USER_LOG_INFO("收到云台联动值\n");
JZSDK_LOG_INFO("收到云台联动值\n");
//获取帧的序列号
int FrameSequence = JZsdk_Get_FrameSequence(getbuf);
... ... @@ -1844,7 +1895,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf)
{
USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n");
//无法正常获取帧的序列号
//回复操作失败
JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, 0x00);
... ... @@ -1859,7 +1910,7 @@ static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf)
{
USER_LOG_INFO("接受到操作成功\n");
JZSDK_LOG_INFO("接受到操作成功\n");
}
/*********
... ... @@ -1870,7 +1921,7 @@ static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf)
**********/
static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf)
{
USER_LOG_INFO("接受到操作失败\n");
JZSDK_LOG_INFO("接受到操作失败\n");
}
/********************************************************************************************************
********* ********|
... ... @@ -1887,7 +1938,7 @@ static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf)
*********************************************************************************************************/
int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len)
{
USER_LOG_INFO("串口设备2号,接受到的模式为:%x",Receive_mode);
JZSDK_LOG_INFO("串口设备2号,接受到的模式为:%x",Receive_mode);
switch (Receive_mode)
{
/*******************************************************************************************************************************
... ... @@ -2195,9 +2246,20 @@ int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le
//序列号查询
case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER:
Uart_DEV2_RecvDeal_CheckStatus_SerialNumber(getdata);
break;
//向外供电开关
case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL:
Uart_DEV2_RecvDeal_OutPutPower_Control(getdata);
break;
//查询向外供电情况
case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER:
Uart_DEV2_RecvDeal_Checkstatus_OutPutPower(getdata);
break;
/*******************************************************************************************************************************
*
... ... @@ -2586,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV2(unsigned char *getbuf, int len)
* ****************/
int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value)
{
USER_LOG_INFO("串口设备2号,二次修改接收模式%x\n",value);
JZSDK_LOG_INFO("串口设备2号,二次修改接收模式%x\n",value);
UART_DEV2_Receive_mode = value;
return 0;
}
\ No newline at end of file
... ...
... ... @@ -96,7 +96,30 @@ int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
}
//发送当前设备序列号
int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber)
{
char sendbuf[256];
int send_buf_len;
//1、获取帧样板
JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_SERIALNUMBER , sendbuf, &send_buf_len);
//2、写入数据
sendbuf[6] = FrameSequence; //帧序列
for (int i = 0; i < 14; i++)
{
sendbuf[9+i] = SerialNumber[i];
}
sendbuf[21] = 0x00;
sendbuf[22] = 0x23;
sendbuf[4] = 0x17;
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(UartPort ,sendbuf, send_buf_len);
}
//发送歌曲名字
... ... @@ -423,7 +446,8 @@ int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTun
sendbuf[9] = 0x00;
}
sendbuf[10] = (PitchFineTuning & 0xff);
sendbuf[10] = ((PitchFineTuning>>8) & 0xff);
sendbuf[11] = (PitchFineTuning & 0xff);
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
... ... @@ -467,7 +491,8 @@ int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSeque
sendbuf[9] = 0x00;
}
sendbuf[10] = (FineTunigPitch & 0xff);
sendbuf[10] = ((FineTunigPitch>>8) & 0xff);
sendbuf[11] = (FineTunigPitch & 0xff);
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
... ... @@ -526,6 +551,24 @@ int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
}
//发送云台最大最小值帧
int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value)
{
printf("发送云台最大最小值帧\n");
char sendbuf[256];
int send_buf_len;
//1、获取帧样板
JZsdk_GetFrameTemplate(JZ_INSCODE_6AFRAME_SET_GIMBAL_MAXMIN_RANGE, sendbuf, &send_buf_len);
//2、写入数据
sendbuf[6] = FrameSequence; //帧序列
sendbuf[10] = value;
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
}
/****************************************************************************************************************************************************
*
* 探照灯部分
... ... @@ -902,4 +945,26 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2)
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
}
/*************
*
* 发送对外电源状态
*
* **************/
int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status)
{
printf("发送对外电源状态帧\n");
char sendbuf[256];
int send_buf_len;
//1、获取帧样板
JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_OUTPUTPOWER, sendbuf, &send_buf_len);
//2、写入数据
sendbuf[9] = status;
//3、发送帧
JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len);
}
\ No newline at end of file
... ...
... ... @@ -47,6 +47,7 @@ int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence,
int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence);
int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int value);
int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence);
int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value);
int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion);
... ... @@ -62,6 +63,8 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value);
int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mode);
int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int color2);
int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber);
... ... @@ -86,6 +89,8 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2)
int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport);
int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport);
int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status);
/* Exported functions --------------------------------------------------------*/
... ...