...
|
...
|
@@ -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 |
...
|
...
|
|