正在显示
22 个修改的文件
包含
1099 行增加
和
626 行删除
| @@ -13,6 +13,9 @@ | @@ -13,6 +13,9 @@ | ||
| 13 | "tts_sample.h": "c", | 13 | "tts_sample.h": "c", |
| 14 | "cn_tts.h": "c", | 14 | "cn_tts.h": "c", |
| 15 | "intl_tts.h": "c", | 15 | "intl_tts.h": "c", |
| 16 | - "megaphone_music.h": "c" | 16 | + "megaphone_music.h": "c", |
| 17 | + "gimbal_h3_h10.h": "c", | ||
| 18 | + "gimbal_h3_h150st.h": "c", | ||
| 19 | + "uartconnection.h": "c" | ||
| 17 | } | 20 | } |
| 18 | } | 21 | } |
| @@ -24,7 +24,7 @@ project(JZ_UART_APP) | @@ -24,7 +24,7 @@ project(JZ_UART_APP) | ||
| 24 | set(filtering_type high_pass_filtering) | 24 | set(filtering_type high_pass_filtering) |
| 25 | 25 | ||
| 26 | # 海外版本 27行不能改动 | 26 | # 海外版本 27行不能改动 |
| 27 | -set(firewarm_origin OVERSEAS_VERSION) | 27 | +set(firewarm_origin DOMESTIC_VERSION) |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | # 指定源文件 | 30 | # 指定源文件 |
| @@ -67,10 +67,10 @@ include_directories(./Module/UI_control) | @@ -67,10 +67,10 @@ include_directories(./Module/UI_control) | ||
| 67 | 67 | ||
| 68 | # 库文件路径 | 68 | # 库文件路径 |
| 69 | if(${filtering_type} STREQUAL "directed_stopband_filtering") | 69 | if(${filtering_type} STREQUAL "directed_stopband_filtering") |
| 70 | - message("Using library for directed stopband filtering") | 70 | + message("\n滤波库:高通滤波\n") |
| 71 | target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/directed_stopband_filtering/libAudioPlayer.so) | 71 | target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/directed_stopband_filtering/libAudioPlayer.so) |
| 72 | elseif(${filtering_type} STREQUAL "high_pass_filtering") | 72 | elseif(${filtering_type} STREQUAL "high_pass_filtering") |
| 73 | - message("Using library for high pass filtering") | 73 | + message("\n滤波库:带阻滤波\n") |
| 74 | target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/high_pass_filtering/libAudioPlayer.so) | 74 | target_link_libraries(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModuleLib/music/high_pass_filtering/libAudioPlayer.so) |
| 75 | else() | 75 | else() |
| 76 | message(FATAL_ERROR "Invalid filtering type") | 76 | message(FATAL_ERROR "Invalid filtering type") |
| @@ -52,9 +52,9 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -52,9 +52,9 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 52 | 52 | ||
| 53 | case JZ_INSCODE_5AFRAME_GIMBAL_PITCH_FINETUNING_CONTROL: | 53 | case JZ_INSCODE_5AFRAME_GIMBAL_PITCH_FINETUNING_CONTROL: |
| 54 | { | 54 | { |
| 55 | - char sendbuf[13] = {0x5A ,0x5A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x64 ,0x52 ,0x00 ,0x00 ,0x00 ,0x23}; | ||
| 56 | - memcpy(str, sendbuf, 13); | ||
| 57 | - *str_len = 13; | 55 | + char sendbuf[14] = {0x5A ,0x5A ,0x77 ,0x00 ,0x0E ,0x00 ,0x00 ,0x64 ,0x52 ,0x00 ,0x00 ,0x00 ,0x00 ,0x23}; |
| 56 | + memcpy(str, sendbuf, 14); | ||
| 57 | + *str_len = 14; | ||
| 58 | } | 58 | } |
| 59 | break; | 59 | break; |
| 60 | 60 | ||
| @@ -166,29 +166,6 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -166,29 +166,6 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 166 | } | 166 | } |
| 167 | break; | 167 | break; |
| 168 | 168 | ||
| 169 | - case JZ_INSCODE_5BFRAME_MUSICLIST_START: | ||
| 170 | - { | ||
| 171 | - char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x23}; | ||
| 172 | - memcpy(str, sendbuf, 12); | ||
| 173 | - *str_len = 12; | ||
| 174 | - } | ||
| 175 | - break; | ||
| 176 | - | ||
| 177 | - case JZ_INSCODE_5BFRAME_MUSICLIST_TRANS: | ||
| 178 | - { | ||
| 179 | - char sendbuf[12] = {0x5B, 0x5B, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x23}; | ||
| 180 | - memcpy(str, sendbuf, 12); | ||
| 181 | - *str_len = 12; | ||
| 182 | - } | ||
| 183 | - break; | ||
| 184 | - | ||
| 185 | - case JZ_INSCODE_5BFRAME_MUSICLIST_STOP: | ||
| 186 | - { | ||
| 187 | - char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0xff, 0x00, 0x00, 0x23}; | ||
| 188 | - memcpy(str, sendbuf, 12); | ||
| 189 | - *str_len = 12; | ||
| 190 | - } | ||
| 191 | - break; | ||
| 192 | 169 | ||
| 193 | case JZ_INSCODE_5BFRAME_AUDIO_PLAYSTATUS_END: | 170 | case JZ_INSCODE_5BFRAME_AUDIO_PLAYSTATUS_END: |
| 194 | { | 171 | { |
| @@ -256,6 +233,38 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -256,6 +233,38 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 256 | } | 233 | } |
| 257 | break; | 234 | break; |
| 258 | 235 | ||
| 236 | + case JZ_INSCODE_5BFRAME_MUSICLIST_START: | ||
| 237 | + { | ||
| 238 | + char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x23}; | ||
| 239 | + memcpy(str, sendbuf, 12); | ||
| 240 | + *str_len = 12; | ||
| 241 | + } | ||
| 242 | + break; | ||
| 243 | + | ||
| 244 | + case JZ_INSCODE_5BFRAME_MUSICLIST_TRANS: | ||
| 245 | + { | ||
| 246 | + char sendbuf[12] = {0x5B, 0x5B, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x23}; | ||
| 247 | + memcpy(str, sendbuf, 12); | ||
| 248 | + *str_len = 12; | ||
| 249 | + } | ||
| 250 | + break; | ||
| 251 | + | ||
| 252 | + case JZ_INSCODE_5BFRAME_MUSICLIST_STOP: | ||
| 253 | + { | ||
| 254 | + char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0c, 0x00, 0x00, 0x58, 0xff, 0x00, 0x00, 0x23}; | ||
| 255 | + memcpy(str, sendbuf, 12); | ||
| 256 | + *str_len = 12; | ||
| 257 | + } | ||
| 258 | + break; | ||
| 259 | + | ||
| 260 | + case JZ_INSCODE_5BFRAME_CHECKSTATUS_OUTPUTPOWER: | ||
| 261 | + { | ||
| 262 | + char sendbuf[12] = { 0x5b, 0x5b, 0x77, 0x00, 0x0C, 0x00, 0x00, 0x5A, 0x02, 0x00, 0x00, 0x23}; | ||
| 263 | + memcpy(str, sendbuf, 12); | ||
| 264 | + *str_len = 12; | ||
| 265 | + } | ||
| 266 | + break; | ||
| 267 | + | ||
| 259 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY: | 268 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY: |
| 260 | { | 269 | { |
| 261 | char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x61, 0x51, 0x00, 0x00, 0x00, 0x23}; | 270 | 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) | @@ -290,9 +299,9 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 290 | 299 | ||
| 291 | case JZ_INSCODE_5BFRAME_GIMBAL_PITCH_FINETUNING: | 300 | case JZ_INSCODE_5BFRAME_GIMBAL_PITCH_FINETUNING: |
| 292 | { | 301 | { |
| 293 | - char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x64, 0x52, 0x00, 0x00, 0x00, 0x23}; | ||
| 294 | - memcpy(str, sendbuf, 13); | ||
| 295 | - *str_len = 13; | 302 | + char sendbuf[14] = { 0x5b, 0x5b, 0x77, 0x00, 0x0e, 0x00, 0x00, 0x64, 0x52, 0x00, 0x00, 0x00, 0x00, 0x23}; |
| 303 | + memcpy(str, sendbuf, 14); | ||
| 304 | + *str_len = 14; | ||
| 296 | } | 305 | } |
| 297 | break; | 306 | break; |
| 298 | 307 | ||
| @@ -330,17 +339,28 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -330,17 +339,28 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 330 | 339 | ||
| 331 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SERIALNUMBER: | 340 | case JZ_INSCODE_5BFRAME_CHECKSTATUS_SERIALNUMBER: |
| 332 | { | 341 | { |
| 333 | - char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x69, 0x54, 0x00, 0x00, 0x00, 0x23}; | 342 | + char sendbuf[13] = { 0x5b, 0x5b, 0x77, 0x00, 0x0D, 0x00, 0x00, 0x6F, 0x57, 0x00, 0x00, 0x00, 0x23}; |
| 334 | memcpy(str, sendbuf, 13); | 343 | memcpy(str, sendbuf, 13); |
| 335 | *str_len = 13; | 344 | *str_len = 13; |
| 336 | } | 345 | } |
| 337 | break; | 346 | break; |
| 338 | 347 | ||
| 348 | + | ||
| 349 | + | ||
| 339 | /******************************************************************************************************************************************************** | 350 | /******************************************************************************************************************************************************** |
| 340 | * | 351 | * |
| 341 | * 6A帧 | 352 | * 6A帧 |
| 342 | * | 353 | * |
| 343 | ********************************************************************************************************************************************************/ | 354 | ********************************************************************************************************************************************************/ |
| 355 | + | ||
| 356 | + case JZ_INSCODE_6AFRAME_SET_GIMBAL_MAXMIN_RANGE: | ||
| 357 | + { | ||
| 358 | + char sendbuf[13] = {0x6A ,0x6A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x69 ,0x52 ,0x00 ,0x00 ,0x00 ,0x23}; | ||
| 359 | + memcpy(str, sendbuf, 13); | ||
| 360 | + *str_len = 13; | ||
| 361 | + } | ||
| 362 | + break; | ||
| 363 | + | ||
| 344 | case JZ_INSCODE_6AFRAME_GIMBAL_LINKAGE_CONTROL: | 364 | case JZ_INSCODE_6AFRAME_GIMBAL_LINKAGE_CONTROL: |
| 345 | { | 365 | { |
| 346 | char sendbuf[13] = {0x6A ,0x6A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x69 ,0x56 ,0x00 ,0x00 ,0x00 ,0x23}; | 366 | char sendbuf[13] = {0x6A ,0x6A ,0x77 ,0x00 ,0x0D ,0x00 ,0x00 ,0x69 ,0x56 ,0x00 ,0x00 ,0x00 ,0x23}; |
| @@ -365,6 +385,7 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | @@ -365,6 +385,7 @@ int JZsdk_GetFrameTemplate(int InsCode ,char *str, int *str_len) | ||
| 365 | } | 385 | } |
| 366 | break; | 386 | break; |
| 367 | 387 | ||
| 388 | + | ||
| 368 | /******************************************************************************************************************************************************** | 389 | /******************************************************************************************************************************************************** |
| 369 | * | 390 | * |
| 370 | * 6B帧 | 391 | * 6B帧 |
| @@ -47,13 +47,13 @@ void JZsdk_UserLogOutput(E_JZsdkConsoleLogLevel level, const char *fmt, ...); | @@ -47,13 +47,13 @@ void JZsdk_UserLogOutput(E_JZsdkConsoleLogLevel level, const char *fmt, ...); | ||
| 47 | T_JZsdkReturnCode JZsdk_LoggerInit(); | 47 | T_JZsdkReturnCode JZsdk_LoggerInit(); |
| 48 | 48 | ||
| 49 | /* Exported constants --------------------------------------------------------*/ | 49 | /* Exported constants --------------------------------------------------------*/ |
| 50 | -#define USER_LOG_DEBUG(fmt, ...) \ | 50 | +#define JZSDK_LOG_DEBUG(fmt, ...) \ |
| 51 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) | 51 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_DEBUG, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) |
| 52 | -#define USER_LOG_INFO(fmt, ...) \ | 52 | +#define JZSDK_LOG_INFO(fmt, ...) \ |
| 53 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) | 53 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_INFO, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) |
| 54 | -#define USER_LOG_WARN(fmt, ...) \ | 54 | +#define JZSDK_LOG_WARN(fmt, ...) \ |
| 55 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) | 55 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_WARN, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) |
| 56 | -#define USER_LOG_ERROR(fmt, ...) \ | 56 | +#define JZSDK_LOG_ERROR(fmt, ...) \ |
| 57 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) | 57 | JZsdk_UserLogOutput(JZSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR, "[%s:%d) " fmt, __FUNCTION__, __LINE__ , ##__VA_ARGS__) |
| 58 | 58 | ||
| 59 | 59 |
| @@ -2,6 +2,9 @@ | @@ -2,6 +2,9 @@ | ||
| 2 | #include "JZsdk_FileSystm.h" | 2 | #include "JZsdk_FileSystm.h" |
| 3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
| 5 | +#include <string.h> | ||
| 6 | + | ||
| 7 | + | ||
| 5 | /* | 8 | /* |
| 6 | * 用于运行指令 | 9 | * 用于运行指令 |
| 7 | * | 10 | * |
| @@ -56,3 +59,44 @@ int JZsdk_Socket() | @@ -56,3 +59,44 @@ int JZsdk_Socket() | ||
| 56 | { | 59 | { |
| 57 | 60 | ||
| 58 | } | 61 | } |
| 62 | + | ||
| 63 | +//获取设备序列号 | ||
| 64 | +T_JZsdkReturnCode GetSerialNumber(char *SerialNumber) | ||
| 65 | +{ | ||
| 66 | + FILE *num_file; | ||
| 67 | + char num_char[15]; | ||
| 68 | + | ||
| 69 | + num_file = fopen("/root/num", "rb+"); | ||
| 70 | + if (num_file == NULL) | ||
| 71 | + { | ||
| 72 | + num_file = fopen("/root/num", "wb+"); | ||
| 73 | + if (num_file == NULL) | ||
| 74 | + { | ||
| 75 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + else | ||
| 79 | + { | ||
| 80 | + int ret = fseek(num_file, 0, SEEK_SET); | ||
| 81 | + if (ret != 0) { | ||
| 82 | + printf("Seek log count file error, ret: %d.\r\n", ret); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + ret = fread((char *) &num_char,14, sizeof(char), num_file); | ||
| 86 | + if (ret != sizeof(char)) { | ||
| 87 | + printf("Read num file error.\r\n"); | ||
| 88 | + } | ||
| 89 | + else{ | ||
| 90 | + printf("Read num file=%s\n",&num_char); | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + fclose(num_file); | ||
| 94 | + | ||
| 95 | + if (SerialNumber != NULL) | ||
| 96 | + { | ||
| 97 | + memcpy(SerialNumber, num_char, 14); | ||
| 98 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 102 | +} |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | #define JZSDK_FILESYSTEM_H | 11 | #define JZSDK_FILESYSTEM_H |
| 12 | 12 | ||
| 13 | /* Includes ------------------------------------------------------------------*/ | 13 | /* Includes ------------------------------------------------------------------*/ |
| 14 | +#include "../JZsdk_Code/JZsdk_Code.h" | ||
| 14 | 15 | ||
| 15 | #ifdef __cplusplus | 16 | #ifdef __cplusplus |
| 16 | extern "C" { | 17 | extern "C" { |
| @@ -26,6 +27,7 @@ extern "C" { | @@ -26,6 +27,7 @@ extern "C" { | ||
| 26 | /* Exported functions --------------------------------------------------------*/ | 27 | /* Exported functions --------------------------------------------------------*/ |
| 27 | int JZsdk_RunSystemCmd(char *systemCmd); | 28 | int JZsdk_RunSystemCmd(char *systemCmd); |
| 28 | //FILE* JZsdk_RunSystemCmd_ReturnFilePointer(char *systemCmd); | 29 | //FILE* JZsdk_RunSystemCmd_ReturnFilePointer(char *systemCmd); |
| 30 | +T_JZsdkReturnCode GetSerialNumber(char *SerialNumber); | ||
| 29 | 31 | ||
| 30 | #ifdef __cplusplus | 32 | #ifdef __cplusplus |
| 31 | } | 33 | } |
| @@ -246,6 +246,16 @@ int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int val | @@ -246,6 +246,16 @@ int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int val | ||
| 246 | JZsdk_Uart_SendDeal_GimbalLinkageControl(Uartport,FrameSequence,value); | 246 | JZsdk_Uart_SendDeal_GimbalLinkageControl(Uartport,FrameSequence,value); |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | +/************* | ||
| 250 | + * | ||
| 251 | + * 设置云台最大最小值 | ||
| 252 | + * | ||
| 253 | + * **************/ | ||
| 254 | +int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value) | ||
| 255 | +{ | ||
| 256 | + JZsdk_Uart_SendDeal_SetGimbalRange(Uartport,FrameSequence,value); | ||
| 257 | +} | ||
| 258 | + | ||
| 249 | /******************************************************************************************************************************* | 259 | /******************************************************************************************************************************* |
| 250 | * | 260 | * |
| 251 | * 探照灯部分 | 261 | * 探照灯部分 |
| @@ -412,6 +422,17 @@ int JZsdk_Uart_Send_SearchLight_Temperature(int Uartport,int LeftTemperature, in | @@ -412,6 +422,17 @@ int JZsdk_Uart_Send_SearchLight_Temperature(int Uartport,int LeftTemperature, in | ||
| 412 | JZsdk_Uart_SendDeal_SearchLight_Temperature(Uartport, LeftTemperature, RightTemperature); | 422 | JZsdk_Uart_SendDeal_SearchLight_Temperature(Uartport, LeftTemperature, RightTemperature); |
| 413 | } | 423 | } |
| 414 | 424 | ||
| 425 | + | ||
| 426 | +/************* | ||
| 427 | + * | ||
| 428 | + * 发送对外供电电源的状态 | ||
| 429 | + * | ||
| 430 | + * **************/ | ||
| 431 | +int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status) | ||
| 432 | +{ | ||
| 433 | + JZsdk_Uart_SendDeal_OutputPowerStatus(Uartport, FrameSequence, status); | ||
| 434 | +} | ||
| 435 | + | ||
| 415 | /******************************************************************************************************************************* | 436 | /******************************************************************************************************************************* |
| 416 | * | 437 | * |
| 417 | * 警灯部分 | 438 | * 警灯部分 |
| @@ -44,6 +44,7 @@ int JZsdk_Uart_Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int | @@ -44,6 +44,7 @@ int JZsdk_Uart_Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int | ||
| 44 | int JZsdk_Uart_Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); | 44 | int JZsdk_Uart_Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); |
| 45 | int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int value); | 45 | int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int value); |
| 46 | int JZsdk_Uart_Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); | 46 | int JZsdk_Uart_Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); |
| 47 | +int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value); | ||
| 47 | 48 | ||
| 48 | int JZsdk_Uart_Send_SearchLight_SetFrequency(int Uartport,int Frequency); | 49 | int JZsdk_Uart_Send_SearchLight_SetFrequency(int Uartport,int Frequency); |
| 49 | int JZsdk_Uart_Send_SearchLight_Control(int Uartport,int mode); | 50 | int JZsdk_Uart_Send_SearchLight_Control(int Uartport,int mode); |
| @@ -72,6 +73,7 @@ int JZsdk_Uart_Send_CheckStatus_WarningLightStatus(int Uartport); | @@ -72,6 +73,7 @@ int JZsdk_Uart_Send_CheckStatus_WarningLightStatus(int Uartport); | ||
| 72 | int JZsdk_Uart_Send_CheckStatus_WarningLightColor(int Uartport); | 73 | int JZsdk_Uart_Send_CheckStatus_WarningLightColor(int Uartport); |
| 73 | 74 | ||
| 74 | 75 | ||
| 76 | +int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status); | ||
| 75 | 77 | ||
| 76 | 78 | ||
| 77 | #ifdef __cplusplus | 79 | #ifdef __cplusplus |
| @@ -13,9 +13,9 @@ | @@ -13,9 +13,9 @@ | ||
| 13 | #include "JZsdk_Uart_Send/JZsdk_Uart_Send.h" | 13 | #include "JZsdk_Uart_Send/JZsdk_Uart_Send.h" |
| 14 | 14 | ||
| 15 | #include "UI_control.h" | 15 | #include "UI_control.h" |
| 16 | +#include "JZsdkLib.h" | ||
| 16 | 17 | ||
| 17 | -static int SecondaryDeviceName = 0x00; //从设备名,用于多设备相连时通知控制端 从机设备名 | ||
| 18 | - | 18 | +static int SecondaryDeviceName = 0x00; // 从设备名,用于多设备相连时通知控制端 从机设备名 |
| 19 | 19 | ||
| 20 | /****** | 20 | /****** |
| 21 | * | 21 | * |
| @@ -37,13 +37,12 @@ T_JZsdkReturnCode JZsdk_Uart_Set_Volume(int DeviceName, int value) | @@ -37,13 +37,12 @@ T_JZsdkReturnCode JZsdk_Uart_Set_Volume(int DeviceName, int value) | ||
| 37 | return UIcontrol_SetVolume(DeviceName, value); | 37 | return UIcontrol_SetVolume(DeviceName, value); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - | ||
| 41 | /********* | 40 | /********* |
| 42 | * | 41 | * |
| 43 | * 1、TTS播放 | 42 | * 1、TTS播放 |
| 44 | * | 43 | * |
| 45 | * *********/ | 44 | * *********/ |
| 46 | -T_JZsdkReturnCode JZsdk_Uart_TTS_Play(int DeviceName, char *data ,int len) | 45 | +T_JZsdkReturnCode JZsdk_Uart_TTS_Play(int DeviceName, char *data, int len) |
| 47 | { | 46 | { |
| 48 | return UIcontrol_TTS_Play(DeviceName, data, len); | 47 | return UIcontrol_TTS_Play(DeviceName, data, len); |
| 49 | } | 48 | } |
| @@ -68,13 +67,12 @@ T_JZsdkReturnCode JZsdk_Uart_TTS_SetSpeed(int DeviceName, int speed) | @@ -68,13 +67,12 @@ T_JZsdkReturnCode JZsdk_Uart_TTS_SetSpeed(int DeviceName, int speed) | ||
| 68 | return UIcontrol_Set_TTS_speed(DeviceName, speed); | 67 | return UIcontrol_Set_TTS_speed(DeviceName, speed); |
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | - | ||
| 72 | /********* | 70 | /********* |
| 73 | * | 71 | * |
| 74 | * 刷新歌曲列表 | 72 | * 刷新歌曲列表 |
| 75 | * | 73 | * |
| 76 | * | 74 | * |
| 77 | -**********/ | 75 | + **********/ |
| 78 | int JZsdk_Uart_Flush_MusicList() | 76 | int JZsdk_Uart_Flush_MusicList() |
| 79 | { | 77 | { |
| 80 | Megaphone_Flush_MusicList(); | 78 | Megaphone_Flush_MusicList(); |
| @@ -84,7 +82,7 @@ int JZsdk_Uart_Flush_MusicList() | @@ -84,7 +82,7 @@ int JZsdk_Uart_Flush_MusicList() | ||
| 84 | * 获取音乐总数 | 82 | * 获取音乐总数 |
| 85 | * | 83 | * |
| 86 | * | 84 | * |
| 87 | -**********/ | 85 | + **********/ |
| 88 | int JZsdk_Uart_get_music_list_sum() | 86 | int JZsdk_Uart_get_music_list_sum() |
| 89 | { | 87 | { |
| 90 | return Megaphone_get_music_list_sum(); | 88 | return Megaphone_get_music_list_sum(); |
| @@ -94,19 +92,18 @@ int JZsdk_Uart_get_music_list_sum() | @@ -94,19 +92,18 @@ int JZsdk_Uart_get_music_list_sum() | ||
| 94 | * 获取音乐名 | 92 | * 获取音乐名 |
| 95 | * | 93 | * |
| 96 | * | 94 | * |
| 97 | -**********/ | 95 | + **********/ |
| 98 | int JZsdk_Uart_get_music_list_name(int num, char *music_name, int *music_name_length) | 96 | int JZsdk_Uart_get_music_list_name(int num, char *music_name, int *music_name_length) |
| 99 | { | 97 | { |
| 100 | return Megaphone_get_music_list_name(num, music_name, music_name_length); | 98 | return Megaphone_get_music_list_name(num, music_name, music_name_length); |
| 101 | } | 99 | } |
| 102 | 100 | ||
| 103 | - | ||
| 104 | /********* | 101 | /********* |
| 105 | * | 102 | * |
| 106 | * 查询音量 | 103 | * 查询音量 |
| 107 | * | 104 | * |
| 108 | * | 105 | * |
| 109 | -**********/ | 106 | + **********/ |
| 110 | int JZsdk_Uart_CheckStatus_volume() | 107 | int JZsdk_Uart_CheckStatus_volume() |
| 111 | { | 108 | { |
| 112 | return Megaphone_get_music_volume(); | 109 | return Megaphone_get_music_volume(); |
| @@ -116,7 +113,7 @@ int JZsdk_Uart_CheckStatus_volume() | @@ -116,7 +113,7 @@ int JZsdk_Uart_CheckStatus_volume() | ||
| 116 | * 查询播放状态 | 113 | * 查询播放状态 |
| 117 | * | 114 | * |
| 118 | * | 115 | * |
| 119 | -**********/ | 116 | + **********/ |
| 120 | int JZsdk_Uart_CheckStatus_play() | 117 | int JZsdk_Uart_CheckStatus_play() |
| 121 | { | 118 | { |
| 122 | return Megaphone_get_play_status(); | 119 | return Megaphone_get_play_status(); |
| @@ -126,7 +123,7 @@ int JZsdk_Uart_CheckStatus_play() | @@ -126,7 +123,7 @@ int JZsdk_Uart_CheckStatus_play() | ||
| 126 | * 查询云台角度 | 123 | * 查询云台角度 |
| 127 | * | 124 | * |
| 128 | * | 125 | * |
| 129 | -**********/ | 126 | + **********/ |
| 130 | int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle) | 127 | int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle) |
| 131 | { | 128 | { |
| 132 | UIcontrol_CheckStatus_GimbalAngle(PitchAngle, YawAngle); | 129 | UIcontrol_CheckStatus_GimbalAngle(PitchAngle, YawAngle); |
| @@ -136,33 +133,32 @@ int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle) | @@ -136,33 +133,32 @@ int JZsdk_Uart_CheckStatus_gimbal(int *PitchAngle, int *YawAngle) | ||
| 136 | * 查询云台微调值 | 133 | * 查询云台微调值 |
| 137 | * | 134 | * |
| 138 | * | 135 | * |
| 139 | -**********/ | 136 | + **********/ |
| 140 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_GimbalFineTuning(int DeviceName, int FrameSequence) | 137 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_GimbalFineTuning(int DeviceName, int FrameSequence) |
| 141 | { | 138 | { |
| 142 | - //查询云台微调 | 139 | + // 查询云台微调 |
| 143 | printf("查询云台微调值\n"); | 140 | printf("查询云台微调值\n"); |
| 144 | 141 | ||
| 145 | - //1、查询本地云台微调 | 142 | + // 1、查询本地云台微调 |
| 146 | int FineTunigPitch, FineTunigYaw; | 143 | int FineTunigPitch, FineTunigYaw; |
| 147 | int ret = UIcontrol_CheckStatus_GimbalPitchFineTuning(&FineTunigPitch, &FineTunigYaw); | 144 | int ret = UIcontrol_CheckStatus_GimbalPitchFineTuning(&FineTunigPitch, &FineTunigYaw); |
| 148 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 145 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| 149 | { | 146 | { |
| 150 | - //回复操作失败 | 147 | + // 回复操作失败 |
| 151 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | 148 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); |
| 152 | return ret; | 149 | return ret; |
| 153 | } | 150 | } |
| 154 | 151 | ||
| 155 | - //2、发送本地云台微调 | 152 | + // 2、发送本地云台微调 |
| 156 | JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(DeviceName, FrameSequence, FineTunigPitch); | 153 | JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(DeviceName, FrameSequence, FineTunigPitch); |
| 157 | } | 154 | } |
| 158 | 155 | ||
| 159 | - | ||
| 160 | /********* | 156 | /********* |
| 161 | * | 157 | * |
| 162 | * 查询播放文件名 | 158 | * 查询播放文件名 |
| 163 | * | 159 | * |
| 164 | * | 160 | * |
| 165 | -**********/ | 161 | + **********/ |
| 166 | int JZsdk_Uart_CheckStatus_PlayFileName(char *music_name, int *music_name_len) | 162 | int JZsdk_Uart_CheckStatus_PlayFileName(char *music_name, int *music_name_len) |
| 167 | { | 163 | { |
| 168 | Megaphone_get_play_FileName(music_name, music_name_len); | 164 | Megaphone_get_play_FileName(music_name, music_name_len); |
| @@ -172,7 +168,7 @@ int JZsdk_Uart_CheckStatus_PlayFileName(char *music_name, int *music_name_len) | @@ -172,7 +168,7 @@ int JZsdk_Uart_CheckStatus_PlayFileName(char *music_name, int *music_name_len) | ||
| 172 | * 查询软件版本号 | 168 | * 查询软件版本号 |
| 173 | * | 169 | * |
| 174 | * | 170 | * |
| 175 | -**********/ | 171 | + **********/ |
| 176 | int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersion, char *modifyVersion, char *debugVersion) | 172 | int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersion, char *modifyVersion, char *debugVersion) |
| 177 | { | 173 | { |
| 178 | *majorVersion = MAJOR_VERSION; | 174 | *majorVersion = MAJOR_VERSION; |
| @@ -185,36 +181,33 @@ int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersio | @@ -185,36 +181,33 @@ int JZsdk_Uart_CheckStatus_SoftwareVersion(char *majorVersion, char *minorVersio | ||
| 185 | * 查询是否打开循环 | 181 | * 查询是否打开循环 |
| 186 | * | 182 | * |
| 187 | * | 183 | * |
| 188 | -**********/ | 184 | + **********/ |
| 189 | int JZsdk_Uart_CheckStatus_LoopPlay() | 185 | int JZsdk_Uart_CheckStatus_LoopPlay() |
| 190 | { | 186 | { |
| 191 | 187 | ||
| 192 | return Megaphone_Get_LoopPlay(); | 188 | return Megaphone_Get_LoopPlay(); |
| 193 | - | ||
| 194 | } | 189 | } |
| 195 | /********* | 190 | /********* |
| 196 | * | 191 | * |
| 197 | * 查询音色 | 192 | * 查询音色 |
| 198 | * | 193 | * |
| 199 | * | 194 | * |
| 200 | -**********/ | 195 | + **********/ |
| 201 | int JZsdk_Uart_CheckStatus_TTS_tone() | 196 | int JZsdk_Uart_CheckStatus_TTS_tone() |
| 202 | { | 197 | { |
| 203 | 198 | ||
| 204 | return Megaphone_Get_TTS_tone(); | 199 | return Megaphone_Get_TTS_tone(); |
| 205 | - | ||
| 206 | } | 200 | } |
| 207 | /********* | 201 | /********* |
| 208 | * | 202 | * |
| 209 | * 查询语速 | 203 | * 查询语速 |
| 210 | * | 204 | * |
| 211 | * | 205 | * |
| 212 | -**********/ | 206 | + **********/ |
| 213 | int JZsdk_Uart_CheckStatus_TTS_speed() | 207 | int JZsdk_Uart_CheckStatus_TTS_speed() |
| 214 | { | 208 | { |
| 215 | 209 | ||
| 216 | return Megaphone_Get_TTS_speed(); | 210 | return Megaphone_Get_TTS_speed(); |
| 217 | - | ||
| 218 | } | 211 | } |
| 219 | 212 | ||
| 220 | /*** | 213 | /*** |
| @@ -233,7 +226,7 @@ T_JZsdkReturnCode JZsdk_Uart_PlayMusic(int DeviceName, char *music_name, int dat | @@ -233,7 +226,7 @@ T_JZsdkReturnCode JZsdk_Uart_PlayMusic(int DeviceName, char *music_name, int dat | ||
| 233 | * 音频继续播放 | 226 | * 音频继续播放 |
| 234 | * | 227 | * |
| 235 | * | 228 | * |
| 236 | -**********/ | 229 | + **********/ |
| 237 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayContinue(int DeviceName) | 230 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayContinue(int DeviceName) |
| 238 | { | 231 | { |
| 239 | return UIcontrol_ContinuePlayAudio(DeviceName); | 232 | return UIcontrol_ContinuePlayAudio(DeviceName); |
| @@ -243,7 +236,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayContinue(int DeviceName) | @@ -243,7 +236,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayContinue(int DeviceName) | ||
| 243 | * 音频暂停播放 | 236 | * 音频暂停播放 |
| 244 | * | 237 | * |
| 245 | * | 238 | * |
| 246 | -**********/ | 239 | + **********/ |
| 247 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayPause(int DeviceName) | 240 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayPause(int DeviceName) |
| 248 | { | 241 | { |
| 249 | return UIcontrol_PausePlayAudio(DeviceName); | 242 | return UIcontrol_PausePlayAudio(DeviceName); |
| @@ -253,7 +246,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayPause(int DeviceName) | @@ -253,7 +246,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayPause(int DeviceName) | ||
| 253 | * 音频停止播放 | 246 | * 音频停止播放 |
| 254 | * | 247 | * |
| 255 | * | 248 | * |
| 256 | -**********/ | 249 | + **********/ |
| 257 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayStop(int DeviceName) | 250 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayStop(int DeviceName) |
| 258 | { | 251 | { |
| 259 | return UIcontrol_StopPlayAudio(DeviceName); | 252 | return UIcontrol_StopPlayAudio(DeviceName); |
| @@ -264,7 +257,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayStop(int DeviceName) | @@ -264,7 +257,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayStop(int DeviceName) | ||
| 264 | * 音频上一曲 | 257 | * 音频上一曲 |
| 265 | * | 258 | * |
| 266 | * | 259 | * |
| 267 | -**********/ | 260 | + **********/ |
| 268 | T_JZsdkReturnCode JZsdk_Uart_audio_LastSong(int DeviceName) | 261 | T_JZsdkReturnCode JZsdk_Uart_audio_LastSong(int DeviceName) |
| 269 | { | 262 | { |
| 270 | return UIcontrol_LastSong(DeviceName); | 263 | return UIcontrol_LastSong(DeviceName); |
| @@ -275,7 +268,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_LastSong(int DeviceName) | @@ -275,7 +268,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_LastSong(int DeviceName) | ||
| 275 | * 音频下一曲 | 268 | * 音频下一曲 |
| 276 | * | 269 | * |
| 277 | * | 270 | * |
| 278 | -**********/ | 271 | + **********/ |
| 279 | T_JZsdkReturnCode JZsdk_Uart_audio_NextSong(int DeviceName) | 272 | T_JZsdkReturnCode JZsdk_Uart_audio_NextSong(int DeviceName) |
| 280 | { | 273 | { |
| 281 | return UIcontrol_NextSong(DeviceName); | 274 | return UIcontrol_NextSong(DeviceName); |
| @@ -286,88 +279,84 @@ T_JZsdkReturnCode JZsdk_Uart_audio_NextSong(int DeviceName) | @@ -286,88 +279,84 @@ T_JZsdkReturnCode JZsdk_Uart_audio_NextSong(int DeviceName) | ||
| 286 | * 12、循环播放 | 279 | * 12、循环播放 |
| 287 | * | 280 | * |
| 288 | * | 281 | * |
| 289 | -**********/ | 282 | + **********/ |
| 290 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode) | 283 | T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode) |
| 291 | { | 284 | { |
| 292 | return UIcontrol_Set_AudioPlayLoop(DeviceName, mode); | 285 | return UIcontrol_Set_AudioPlayLoop(DeviceName, mode); |
| 293 | } | 286 | } |
| 294 | 287 | ||
| 295 | /**************************************************************************************************************************************************** | 288 | /**************************************************************************************************************************************************** |
| 296 | -* | ||
| 297 | -* 录音opus 接口部分 | ||
| 298 | -* | ||
| 299 | -****************************************************************************************************************************************************/ | 289 | + * |
| 290 | + * 录音opus 接口部分 | ||
| 291 | + * | ||
| 292 | + ****************************************************************************************************************************************************/ | ||
| 300 | 293 | ||
| 301 | /********* | 294 | /********* |
| 302 | * | 295 | * |
| 303 | * 播放固定位置的opus音频 | 296 | * 播放固定位置的opus音频 |
| 304 | * | 297 | * |
| 305 | * | 298 | * |
| 306 | -**********/ | 299 | + **********/ |
| 307 | T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName) | 300 | T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName) |
| 308 | { | 301 | { |
| 309 | return UIcontrol_Opus_PlayFixedFile(DeviceName); | 302 | return UIcontrol_Opus_PlayFixedFile(DeviceName); |
| 310 | } | 303 | } |
| 311 | 304 | ||
| 312 | - | ||
| 313 | /* | 305 | /* |
| 314 | -* | ||
| 315 | -* 存储opus文件开始 | ||
| 316 | -* | ||
| 317 | -*/ | 306 | + * |
| 307 | + * 存储opus文件开始 | ||
| 308 | + * | ||
| 309 | + */ | ||
| 318 | int JZsdk_Uart_SaveOpusStart(int decode_rate) | 310 | int JZsdk_Uart_SaveOpusStart(int decode_rate) |
| 319 | { | 311 | { |
| 320 | Megaphone_SaveOpusStart(decode_rate); | 312 | Megaphone_SaveOpusStart(decode_rate); |
| 321 | } | 313 | } |
| 322 | 314 | ||
| 323 | /* | 315 | /* |
| 324 | -* | ||
| 325 | -* 存储opus文件中 | ||
| 326 | -* | ||
| 327 | -*/ | 316 | + * |
| 317 | + * 存储opus文件中 | ||
| 318 | + * | ||
| 319 | + */ | ||
| 328 | int JZsdk_Uart_SaveOpusTrans(char *SaveData, int size) | 320 | int JZsdk_Uart_SaveOpusTrans(char *SaveData, int size) |
| 329 | { | 321 | { |
| 330 | Megaphone_SaveOpusTrans(SaveData, size); | 322 | Megaphone_SaveOpusTrans(SaveData, size); |
| 331 | } | 323 | } |
| 332 | 324 | ||
| 333 | /* | 325 | /* |
| 334 | -* | ||
| 335 | -* 存储opus文件结束 | ||
| 336 | -* | ||
| 337 | -*/ | 326 | + * |
| 327 | + * 存储opus文件结束 | ||
| 328 | + * | ||
| 329 | + */ | ||
| 338 | int JZsdk_Uart_SaveOpusStop() | 330 | int JZsdk_Uart_SaveOpusStop() |
| 339 | { | 331 | { |
| 340 | Megaphone_SaveOpusStop(); | 332 | Megaphone_SaveOpusStop(); |
| 341 | } | 333 | } |
| 342 | 334 | ||
| 343 | - | ||
| 344 | /**************************************************************************************************************************************************** | 335 | /**************************************************************************************************************************************************** |
| 345 | -* | ||
| 346 | -* 实时喊话opus 接口部分 | ||
| 347 | -* | ||
| 348 | -****************************************************************************************************************************************************/ | 336 | + * |
| 337 | + * 实时喊话opus 接口部分 | ||
| 338 | + * | ||
| 339 | + ****************************************************************************************************************************************************/ | ||
| 349 | int JZsdk_Uart_RealTimeVoiceStart(int decode_rate) | 340 | int JZsdk_Uart_RealTimeVoiceStart(int decode_rate) |
| 350 | { | 341 | { |
| 351 | Megaphone_RealTimeVoice_Start(decode_rate); | 342 | Megaphone_RealTimeVoice_Start(decode_rate); |
| 352 | } | 343 | } |
| 353 | 344 | ||
| 354 | - | ||
| 355 | int JZsdk_Uart_RealTimeVoiceTrans(char *data, int length) | 345 | int JZsdk_Uart_RealTimeVoiceTrans(char *data, int length) |
| 356 | { | 346 | { |
| 357 | Megaphone_RealTimeVoice_Trans(data, length); | 347 | Megaphone_RealTimeVoice_Trans(data, length); |
| 358 | } | 348 | } |
| 359 | 349 | ||
| 360 | - | ||
| 361 | int JZsdk_Uart_RealTimeVoiceClose() | 350 | int JZsdk_Uart_RealTimeVoiceClose() |
| 362 | { | 351 | { |
| 363 | Megaphone_RealTimeVoice_Close(); | 352 | Megaphone_RealTimeVoice_Close(); |
| 364 | } | 353 | } |
| 365 | 354 | ||
| 366 | /**************************************************************************************************************************************************** | 355 | /**************************************************************************************************************************************************** |
| 367 | -* | ||
| 368 | -* 实时MP2 接口部分 | ||
| 369 | -* | ||
| 370 | -****************************************************************************************************************************************************/ | 356 | + * |
| 357 | + * 实时MP2 接口部分 | ||
| 358 | + * | ||
| 359 | + ****************************************************************************************************************************************************/ | ||
| 371 | T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_start(int decode_rate) | 360 | T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_start(int decode_rate) |
| 372 | { | 361 | { |
| 373 | return Megaphone_RealTimeMP2_start(); | 362 | return Megaphone_RealTimeMP2_start(); |
| @@ -378,29 +367,23 @@ T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Trans(unsigned char *data, int length) | @@ -378,29 +367,23 @@ T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Trans(unsigned char *data, int length) | ||
| 378 | return Megaphone_RealTimeMP2_trans(data, length); | 367 | return Megaphone_RealTimeMP2_trans(data, length); |
| 379 | } | 368 | } |
| 380 | 369 | ||
| 381 | - | ||
| 382 | T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Close() | 370 | T_JZsdkReturnCode JZsdk_Uart_RealTimeMP2_Close() |
| 383 | { | 371 | { |
| 384 | Megaphone_RealTimeMP2_stop(); | 372 | Megaphone_RealTimeMP2_stop(); |
| 385 | } | 373 | } |
| 386 | 374 | ||
| 387 | - | ||
| 388 | - | ||
| 389 | - | ||
| 390 | - | ||
| 391 | - | ||
| 392 | /**************************************************************************************************************************************************** | 375 | /**************************************************************************************************************************************************** |
| 393 | -* | ||
| 394 | -* 云台部分 | ||
| 395 | -* | ||
| 396 | -****************************************************************************************************************************************************/ | 376 | + * |
| 377 | + * 云台部分 | ||
| 378 | + * | ||
| 379 | + ****************************************************************************************************************************************************/ | ||
| 397 | 380 | ||
| 398 | /********* | 381 | /********* |
| 399 | * | 382 | * |
| 400 | * 云台俯仰控制 | 383 | * 云台俯仰控制 |
| 401 | * | 384 | * |
| 402 | * | 385 | * |
| 403 | -**********/ | 386 | + **********/ |
| 404 | T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchControl(int DeviceName, int Gimbal_angle) | 387 | T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchControl(int DeviceName, int Gimbal_angle) |
| 405 | { | 388 | { |
| 406 | return UIcontrol_Set_GimbalPitchAngle(DeviceName, Gimbal_angle); | 389 | return UIcontrol_Set_GimbalPitchAngle(DeviceName, Gimbal_angle); |
| @@ -411,34 +394,33 @@ T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchControl(int DeviceName, int Gimbal_angl | @@ -411,34 +394,33 @@ T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchControl(int DeviceName, int Gimbal_angl | ||
| 411 | * 云台俯仰微调角度 | 394 | * 云台俯仰微调角度 |
| 412 | * | 395 | * |
| 413 | * | 396 | * |
| 414 | -**********/ | ||
| 415 | -T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchFineTuningControl(int DeviceName, int FrameSequence,int Gimbal_angle) | 397 | + **********/ |
| 398 | +T_JZsdkReturnCode JZsdk_Uart_Gimbal_PitchFineTuningControl(int DeviceName, int FrameSequence, int Gimbal_angle) | ||
| 416 | { | 399 | { |
| 417 | T_JZsdkReturnCode ret = UIcontrol_Set_GimbalPitchFineTuning(DeviceName, Gimbal_angle); | 400 | T_JZsdkReturnCode ret = UIcontrol_Set_GimbalPitchFineTuning(DeviceName, Gimbal_angle); |
| 418 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 401 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| 419 | { | 402 | { |
| 420 | - //回复操作成功 | 403 | + // 回复操作成功 |
| 421 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); | 404 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); |
| 422 | } | 405 | } |
| 423 | else | 406 | else |
| 424 | { | 407 | { |
| 425 | - //回复操作失败 | 408 | + // 回复操作失败 |
| 426 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | 409 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); |
| 427 | } | 410 | } |
| 428 | } | 411 | } |
| 429 | 412 | ||
| 430 | - | ||
| 431 | /**************************************************************************************************************************************************** | 413 | /**************************************************************************************************************************************************** |
| 432 | -* | ||
| 433 | -* 探照灯部分 | ||
| 434 | -* | ||
| 435 | -****************************************************************************************************************************************************/ | 414 | + * |
| 415 | + * 探照灯部分 | ||
| 416 | + * | ||
| 417 | + ****************************************************************************************************************************************************/ | ||
| 436 | /********* | 418 | /********* |
| 437 | * | 419 | * |
| 438 | * 探照灯爆闪频率控制 | 420 | * 探照灯爆闪频率控制 |
| 439 | * | 421 | * |
| 440 | * | 422 | * |
| 441 | -**********/ | 423 | + **********/ |
| 442 | T_JZsdkReturnCode JZsdk_Uart_Lighting_SetSearchLightFrequency(int DeviceName, int Frequency) | 424 | T_JZsdkReturnCode JZsdk_Uart_Lighting_SetSearchLightFrequency(int DeviceName, int Frequency) |
| 443 | { | 425 | { |
| 444 | return UIcontrol_Set_SearchLightFrequency(DeviceName, Frequency); | 426 | return UIcontrol_Set_SearchLightFrequency(DeviceName, Frequency); |
| @@ -448,7 +430,7 @@ T_JZsdkReturnCode JZsdk_Uart_Lighting_SetSearchLightFrequency(int DeviceName, in | @@ -448,7 +430,7 @@ T_JZsdkReturnCode JZsdk_Uart_Lighting_SetSearchLightFrequency(int DeviceName, in | ||
| 448 | * | 430 | * |
| 449 | * 灯光模式控制 | 431 | * 灯光模式控制 |
| 450 | * | 432 | * |
| 451 | -**********/ | 433 | + **********/ |
| 452 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_Control(int DeviceName, int mode) | 434 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_Control(int DeviceName, int mode) |
| 453 | { | 435 | { |
| 454 | return UIcontrol_SearchLightControl(DeviceName, mode); | 436 | return UIcontrol_SearchLightControl(DeviceName, mode); |
| @@ -458,7 +440,7 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_Control(int DeviceName, int mode) | @@ -458,7 +440,7 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_Control(int DeviceName, int mode) | ||
| 458 | * | 440 | * |
| 459 | * 灯光亮度 | 441 | * 灯光亮度 |
| 460 | * | 442 | * |
| 461 | -**********/ | 443 | + **********/ |
| 462 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen) | 444 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen) |
| 463 | { | 445 | { |
| 464 | return UIcontrol_Set_SearchLightLumen(DeviceName, LeftLumen, RightLumen); | 446 | return UIcontrol_Set_SearchLightLumen(DeviceName, LeftLumen, RightLumen); |
| @@ -468,44 +450,43 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_Lumen(int DeviceName, int LeftLumen, in | @@ -468,44 +450,43 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_Lumen(int DeviceName, int LeftLumen, in | ||
| 468 | * | 450 | * |
| 469 | * 灯光属性查询 | 451 | * 灯光属性查询 |
| 470 | * | 452 | * |
| 471 | -**********/ | 453 | + **********/ |
| 472 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightLightAttribute(int DeviceName, int FrameSequence) | 454 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightLightAttribute(int DeviceName, int FrameSequence) |
| 473 | { | 455 | { |
| 474 | - //1、查询灯光属性 | 456 | + // 1、查询灯光属性 |
| 475 | int Light_Frequency; | 457 | int Light_Frequency; |
| 476 | int Light_Mode; | 458 | int Light_Mode; |
| 477 | int Light_LeftLumen; | 459 | int Light_LeftLumen; |
| 478 | int Light_RightLumen; | 460 | int Light_RightLumen; |
| 479 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightLightAttribute(&Light_Frequency, &Light_Mode, &Light_LeftLumen, &Light_RightLumen); | 461 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightLightAttribute(&Light_Frequency, &Light_Mode, &Light_LeftLumen, &Light_RightLumen); |
| 480 | 462 | ||
| 481 | - //2、回复灯光属性 | 463 | + // 2、回复灯光属性 |
| 482 | JZsdk_Uart_SendDeal_SearchLight_Frequency(DeviceName, Light_Frequency); | 464 | JZsdk_Uart_SendDeal_SearchLight_Frequency(DeviceName, Light_Frequency); |
| 483 | JZsdk_Uart_SendDeal_SearchLight_Mode(DeviceName, Light_Mode); | 465 | JZsdk_Uart_SendDeal_SearchLight_Mode(DeviceName, Light_Mode); |
| 484 | - JZsdk_Uart_SendDeal_SearchLight_Lumen(DeviceName,Light_LeftLumen, Light_RightLumen); | 466 | + JZsdk_Uart_SendDeal_SearchLight_Lumen(DeviceName, Light_LeftLumen, Light_RightLumen); |
| 485 | } | 467 | } |
| 486 | 468 | ||
| 487 | /********* | 469 | /********* |
| 488 | * | 470 | * |
| 489 | * 灯光温度查询 | 471 | * 灯光温度查询 |
| 490 | * | 472 | * |
| 491 | -**********/ | 473 | + **********/ |
| 492 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightTemperture(int DeviceName, int FrameSequence) | 474 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SearchLightTemperture(int DeviceName, int FrameSequence) |
| 493 | { | 475 | { |
| 494 | - //1、查询灯光温度 | 476 | + // 1、查询灯光温度 |
| 495 | int Light_LeftTemperature; | 477 | int Light_LeftTemperature; |
| 496 | int Light_RightTemperature; | 478 | int Light_RightTemperature; |
| 497 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightTemperture(&Light_LeftTemperature, &Light_RightTemperature); | 479 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_SearchLightTemperture(&Light_LeftTemperature, &Light_RightTemperature); |
| 498 | 480 | ||
| 499 | - //2、回复灯光温度 | 481 | + // 2、回复灯光温度 |
| 500 | JZsdk_Uart_SendDeal_SearchLight_Temperature(DeviceName, Light_LeftTemperature, Light_RightTemperature); | 482 | JZsdk_Uart_SendDeal_SearchLight_Temperature(DeviceName, Light_LeftTemperature, Light_RightTemperature); |
| 501 | - | ||
| 502 | } | 483 | } |
| 503 | 484 | ||
| 504 | /********* | 485 | /********* |
| 505 | * | 486 | * |
| 506 | * 灯光消息订阅控制 | 487 | * 灯光消息订阅控制 |
| 507 | * | 488 | * |
| 508 | -**********/ | 489 | + **********/ |
| 509 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int value) | 490 | T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int value) |
| 510 | { | 491 | { |
| 511 | if (DeviceName == UART_DEV_2) | 492 | if (DeviceName == UART_DEV_2) |
| @@ -524,7 +505,7 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int | @@ -524,7 +505,7 @@ T_JZsdkReturnCode JZsdk_Uart_SearchLight_SubscriptionControl(int DeviceName, int | ||
| 524 | * | 505 | * |
| 525 | * 警灯模式控制 | 506 | * 警灯模式控制 |
| 526 | * | 507 | * |
| 527 | -**********/ | 508 | + **********/ |
| 528 | T_JZsdkReturnCode JZsdk_Uart_WarningLight_ModeControl(int DeviceName, int status, int mode) | 509 | T_JZsdkReturnCode JZsdk_Uart_WarningLight_ModeControl(int DeviceName, int status, int mode) |
| 529 | { | 510 | { |
| 530 | return UIcontrol_Set_WarningLight_ModeControl(DeviceName, status, mode); | 511 | return UIcontrol_Set_WarningLight_ModeControl(DeviceName, status, mode); |
| @@ -534,7 +515,7 @@ T_JZsdkReturnCode JZsdk_Uart_WarningLight_ModeControl(int DeviceName, int status | @@ -534,7 +515,7 @@ T_JZsdkReturnCode JZsdk_Uart_WarningLight_ModeControl(int DeviceName, int status | ||
| 534 | * | 515 | * |
| 535 | * 警灯颜色控制 | 516 | * 警灯颜色控制 |
| 536 | * | 517 | * |
| 537 | -**********/ | 518 | + **********/ |
| 538 | T_JZsdkReturnCode JZsdk_Uart_WarningLight_SetColor(int DeviceName, int color1, int color2) | 519 | T_JZsdkReturnCode JZsdk_Uart_WarningLight_SetColor(int DeviceName, int color1, int color2) |
| 539 | { | 520 | { |
| 540 | return UIcontrol_Set_WarningLight_Color(DeviceName, color1, color2); | 521 | return UIcontrol_Set_WarningLight_Color(DeviceName, color1, color2); |
| @@ -544,42 +525,40 @@ T_JZsdkReturnCode JZsdk_Uart_WarningLight_SetColor(int DeviceName, int color1, i | @@ -544,42 +525,40 @@ T_JZsdkReturnCode JZsdk_Uart_WarningLight_SetColor(int DeviceName, int color1, i | ||
| 544 | * | 525 | * |
| 545 | * 警灯状态查询 | 526 | * 警灯状态查询 |
| 546 | * | 527 | * |
| 547 | -**********/ | 528 | + **********/ |
| 548 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightStatus(int DeviceName, int FrameSequence) | 529 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightStatus(int DeviceName, int FrameSequence) |
| 549 | { | 530 | { |
| 550 | - //1、查询警灯状态查询 | 531 | + // 1、查询警灯状态查询 |
| 551 | int status; | 532 | int status; |
| 552 | int Mode; | 533 | int Mode; |
| 553 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightStatus(&status, &Mode); | 534 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightStatus(&status, &Mode); |
| 554 | 535 | ||
| 555 | - //2、回复警灯状态查询 | 536 | + // 2、回复警灯状态查询 |
| 556 | JZsdk_Uart_SendDeal_WarningLight_Status(DeviceName, status, Mode); | 537 | JZsdk_Uart_SendDeal_WarningLight_Status(DeviceName, status, Mode); |
| 557 | - | ||
| 558 | } | 538 | } |
| 559 | 539 | ||
| 560 | /********* | 540 | /********* |
| 561 | * | 541 | * |
| 562 | * 警灯颜色查询 | 542 | * 警灯颜色查询 |
| 563 | * | 543 | * |
| 564 | -**********/ | 544 | + **********/ |
| 565 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightColor(int DeviceName, int FrameSequence) | 545 | T_JZsdkReturnCode JZsdk_Uart_CheckStatus_WarningLightColor(int DeviceName, int FrameSequence) |
| 566 | { | 546 | { |
| 567 | - //1、查询灯光温度 | 547 | + // 1、查询灯光温度 |
| 568 | int color1; | 548 | int color1; |
| 569 | int color2; | 549 | int color2; |
| 570 | 550 | ||
| 571 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightColor(&color1, &color2); | 551 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_WarningLightColor(&color1, &color2); |
| 572 | 552 | ||
| 573 | - //2、回复警灯颜色 | 553 | + // 2、回复警灯颜色 |
| 574 | JZsdk_Uart_SendDeal_WarningLight_Color(DeviceName, color1, color2); | 554 | JZsdk_Uart_SendDeal_WarningLight_Color(DeviceName, color1, color2); |
| 575 | - | ||
| 576 | } | 555 | } |
| 577 | 556 | ||
| 578 | /* | 557 | /* |
| 579 | -* | ||
| 580 | -* 获取本地主设备名 | ||
| 581 | -* | ||
| 582 | -*/ | 558 | + * |
| 559 | + * 获取本地主设备名 | ||
| 560 | + * | ||
| 561 | + */ | ||
| 583 | int JZsdk_Uart_GetVersionReplay() | 562 | int JZsdk_Uart_GetVersionReplay() |
| 584 | { | 563 | { |
| 585 | switch (DEVICE_VERSION) | 564 | switch (DEVICE_VERSION) |
| @@ -615,25 +594,47 @@ int JZsdk_Uart_GetVersionReplay() | @@ -615,25 +594,47 @@ int JZsdk_Uart_GetVersionReplay() | ||
| 615 | return 0x00; | 594 | return 0x00; |
| 616 | break; | 595 | break; |
| 617 | }; | 596 | }; |
| 618 | - | ||
| 619 | } | 597 | } |
| 620 | 598 | ||
| 621 | - | ||
| 622 | /* | 599 | /* |
| 623 | -* | ||
| 624 | -* 设置工作模式 | ||
| 625 | -* | ||
| 626 | -*/ | 600 | + * |
| 601 | + * 设置工作模式 | ||
| 602 | + * | ||
| 603 | + */ | ||
| 627 | int JZsdk_Uart_SetMainWorkMode(int mode) | 604 | int JZsdk_Uart_SetMainWorkMode(int mode) |
| 628 | { | 605 | { |
| 629 | Main_WorkModeSet(mode); | 606 | Main_WorkModeSet(mode); |
| 630 | } | 607 | } |
| 631 | 608 | ||
| 609 | +/* | ||
| 610 | + * | ||
| 611 | + * 查询序列号 | ||
| 612 | + * | ||
| 613 | + */ | ||
| 614 | +T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SerialNumber(int UartPort, int FrameSequence) | ||
| 615 | +{ | ||
| 616 | + // 1、获取序列号 | ||
| 617 | + char SerialNum[14]; | ||
| 618 | + T_JZsdkReturnCode ret = GetSerialNumber(SerialNum); | ||
| 619 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 620 | + { | ||
| 621 | + JZSDK_LOG_ERROR("获取序列号失败"); | ||
| 622 | + | ||
| 623 | + JZsdk_Uart_SendDeal_Reply_Failure(UartPort, FrameSequence); | ||
| 624 | + | ||
| 625 | + return ret; | ||
| 626 | + } | ||
| 627 | + | ||
| 628 | + // 2、发送序列号 | ||
| 629 | + JZsdk_Uart_SendDeal_SerialNumber(UartPort, FrameSequence, SerialNum); | ||
| 630 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 631 | +} | ||
| 632 | + | ||
| 632 | /**************************************************************************************************************************************************** | 633 | /**************************************************************************************************************************************************** |
| 633 | -* | ||
| 634 | -* AudioFile 接口部分 | ||
| 635 | -* | ||
| 636 | -****************************************************************************************************************************************************/ | 634 | + * |
| 635 | + * AudioFile 接口部分 | ||
| 636 | + * | ||
| 637 | + ****************************************************************************************************************************************************/ | ||
| 637 | /* | 638 | /* |
| 638 | 1、开始传输的音频文件保存 | 639 | 1、开始传输的音频文件保存 |
| 639 | 2、存储音频文件中 | 640 | 2、存储音频文件中 |
| @@ -644,32 +645,76 @@ int JZsdk_Uart_SetMainWorkMode(int mode) | @@ -644,32 +645,76 @@ int JZsdk_Uart_SetMainWorkMode(int mode) | ||
| 644 | * 1、开始传输的音频文件保存 | 645 | * 1、开始传输的音频文件保存 |
| 645 | * | 646 | * |
| 646 | * | 647 | * |
| 647 | -**********/ | 648 | + **********/ |
| 648 | T_JZsdkReturnCode JZsdk_Uart_SaveAudioFileStart(char *FileName) | 649 | T_JZsdkReturnCode JZsdk_Uart_SaveAudioFileStart(char *FileName) |
| 649 | { | 650 | { |
| 650 | return Megaphone_SaveAudioFileStart(FileName); | 651 | return Megaphone_SaveAudioFileStart(FileName); |
| 651 | } | 652 | } |
| 652 | 653 | ||
| 653 | /* | 654 | /* |
| 654 | -* | ||
| 655 | -* 2、存储音频文件中 | ||
| 656 | -* | ||
| 657 | -*/ | 655 | + * |
| 656 | + * 2、存储音频文件中 | ||
| 657 | + * | ||
| 658 | + */ | ||
| 658 | int JZsdk_Uart_SaveAudioFileTrans(char *SaveData, int size) | 659 | int JZsdk_Uart_SaveAudioFileTrans(char *SaveData, int size) |
| 659 | { | 660 | { |
| 660 | Megaphone_SaveAudioFileTrans(SaveData, size); | 661 | Megaphone_SaveAudioFileTrans(SaveData, size); |
| 661 | } | 662 | } |
| 662 | 663 | ||
| 663 | /* | 664 | /* |
| 664 | -* | ||
| 665 | -* 3、存储音频文件结束 | ||
| 666 | -* | ||
| 667 | -*/ | 665 | + * |
| 666 | + * 3、存储音频文件结束 | ||
| 667 | + * | ||
| 668 | + */ | ||
| 668 | int JZsdk_Uart_SaveAudioFileStop() | 669 | int JZsdk_Uart_SaveAudioFileStop() |
| 669 | { | 670 | { |
| 670 | Megaphone_SaveAudioFileStop(); | 671 | Megaphone_SaveAudioFileStop(); |
| 671 | } | 672 | } |
| 672 | 673 | ||
| 674 | +/**************************************************************************************************************************************************** | ||
| 675 | + * | ||
| 676 | + * 对外供电部分 | ||
| 677 | + * | ||
| 678 | + ****************************************************************************************************************************************************/ | ||
| 679 | +/********* | ||
| 680 | + * | ||
| 681 | + * 对外供电开关 | ||
| 682 | + * | ||
| 683 | + **********/ | ||
| 684 | +T_JZsdkReturnCode JZsdk_Uart_OutPutPower_Control(int DeviceName, int FrameSequence, int Value) | ||
| 685 | +{ | ||
| 686 | + //1、设置本地的值 | ||
| 687 | + T_JZsdkReturnCode ret = UIcontrol_Set_OutPutPower_Control(DeviceName, Value); | ||
| 688 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 689 | + { | ||
| 690 | + JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | ||
| 691 | + } | ||
| 692 | + | ||
| 693 | + //2、回复操作成功 | ||
| 694 | + JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); | ||
| 695 | +} | ||
| 696 | + | ||
| 697 | +/********* | ||
| 698 | + * | ||
| 699 | + * 对外电源查询 | ||
| 700 | + * | ||
| 701 | + **********/ | ||
| 702 | +T_JZsdkReturnCode JZsdk_Uart_Checkstatus_OutPutPower(int DeviceName, int FrameSequence) | ||
| 703 | +{ | ||
| 704 | + int OutPutPowerValue = JZ_FLAGCODE_OFF; | ||
| 705 | + | ||
| 706 | + //1、获取电源值 | ||
| 707 | + T_JZsdkReturnCode ret = UIcontrol_CheckStatus_OutPutPowerValue(&OutPutPowerValue); | ||
| 708 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
| 709 | + { | ||
| 710 | + JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | ||
| 711 | + } | ||
| 712 | + | ||
| 713 | + //2、发送电源值 | ||
| 714 | + JZsdk_Uart_SendDeal_OutputPowerStatus(DeviceName, FrameSequence, OutPutPowerValue); | ||
| 715 | +} | ||
| 716 | + | ||
| 717 | + | ||
| 673 | /******************************************************************************************************** | 718 | /******************************************************************************************************** |
| 674 | ********* ********| | 719 | ********* ********| |
| 675 | ********* ********| | 720 | ********* ********| |
| @@ -693,7 +738,7 @@ int JZsdk_Uart_SaveAudioFileStop() | @@ -693,7 +738,7 @@ int JZsdk_Uart_SaveAudioFileStop() | ||
| 693 | * | 738 | * |
| 694 | * 收到灯光频率 | 739 | * 收到灯光频率 |
| 695 | * | 740 | * |
| 696 | -**********/ | 741 | + **********/ |
| 697 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Frequency(int DeviceName, int Frequency) | 742 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Frequency(int DeviceName, int Frequency) |
| 698 | { | 743 | { |
| 699 | UIcontrol_ObtainSearchLight_Frequency(DeviceName, Frequency); | 744 | UIcontrol_ObtainSearchLight_Frequency(DeviceName, Frequency); |
| @@ -703,7 +748,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Frequency(int DeviceName, int Fre | @@ -703,7 +748,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Frequency(int DeviceName, int Fre | ||
| 703 | * | 748 | * |
| 704 | * 收到灯光模式 | 749 | * 收到灯光模式 |
| 705 | * | 750 | * |
| 706 | -**********/ | 751 | + **********/ |
| 707 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Mode(int DeviceName, int mode) | 752 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Mode(int DeviceName, int mode) |
| 708 | { | 753 | { |
| 709 | UIcontrol_ObtainSearchLight_Mode(DeviceName, mode); | 754 | UIcontrol_ObtainSearchLight_Mode(DeviceName, mode); |
| @@ -713,7 +758,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Mode(int DeviceName, int mode) | @@ -713,7 +758,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Mode(int DeviceName, int mode) | ||
| 713 | * | 758 | * |
| 714 | * 收到灯光亮度 | 759 | * 收到灯光亮度 |
| 715 | * | 760 | * |
| 716 | -**********/ | 761 | + **********/ |
| 717 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen) | 762 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Lumen(int DeviceName, int LeftLumen, int RightLumen) |
| 718 | { | 763 | { |
| 719 | UIcontrol_ObtainSearchLight_Lumen(DeviceName, LeftLumen, RightLumen); | 764 | UIcontrol_ObtainSearchLight_Lumen(DeviceName, LeftLumen, RightLumen); |
| @@ -723,7 +768,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Lumen(int DeviceName, int LeftLum | @@ -723,7 +768,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Lumen(int DeviceName, int LeftLum | ||
| 723 | * | 768 | * |
| 724 | * 收到探照灯温度 | 769 | * 收到探照灯温度 |
| 725 | * | 770 | * |
| 726 | -**********/ | 771 | + **********/ |
| 727 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Temperature(int DeviceName, int LeftTemperature, int RightTemperature) | 772 | T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Temperature(int DeviceName, int LeftTemperature, int RightTemperature) |
| 728 | { | 773 | { |
| 729 | UIcontrol_ObtainSearchLight_Temperature(DeviceName, LeftTemperature, RightTemperature); | 774 | UIcontrol_ObtainSearchLight_Temperature(DeviceName, LeftTemperature, RightTemperature); |
| @@ -738,7 +783,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Temperature(int DeviceName, int L | @@ -738,7 +783,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainSearchLight_Temperature(int DeviceName, int L | ||
| 738 | * | 783 | * |
| 739 | * 收到云台俯仰 | 784 | * 收到云台俯仰 |
| 740 | * | 785 | * |
| 741 | -**********/ | 786 | + **********/ |
| 742 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Pitch(int DeviceName, int pitch) | 787 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Pitch(int DeviceName, int pitch) |
| 743 | { | 788 | { |
| 744 | UIcontrol_ObtainGimbal_Pitch(DeviceName, pitch); | 789 | UIcontrol_ObtainGimbal_Pitch(DeviceName, pitch); |
| @@ -748,29 +793,27 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Pitch(int DeviceName, int pit | @@ -748,29 +793,27 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Pitch(int DeviceName, int pit | ||
| 748 | * | 793 | * |
| 749 | * 收到云台航向 | 794 | * 收到云台航向 |
| 750 | * | 795 | * |
| 751 | -**********/ | 796 | + **********/ |
| 752 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Yaw(int DeviceName, int yaw) | 797 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainGimbal_Yaw(int DeviceName, int yaw) |
| 753 | { | 798 | { |
| 754 | - | ||
| 755 | } | 799 | } |
| 756 | 800 | ||
| 757 | /********* | 801 | /********* |
| 758 | * | 802 | * |
| 759 | * 收到云台俯仰微调值 | 803 | * 收到云台俯仰微调值 |
| 760 | * | 804 | * |
| 761 | -**********/ | ||
| 762 | -T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int FrameSequence,int pitch) | 805 | + **********/ |
| 806 | +T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int FrameSequence, int pitch) | ||
| 763 | { | 807 | { |
| 764 | printf("收到云台俯仰微调值\n"); | 808 | printf("收到云台俯仰微调值\n"); |
| 765 | 809 | ||
| 766 | - //2、发送到本地处理 | 810 | + // 2、发送到本地处理 |
| 767 | UIcontrol_Obtain_GimbalPitchFineTuninng(DeviceName, pitch); | 811 | UIcontrol_Obtain_GimbalPitchFineTuninng(DeviceName, pitch); |
| 768 | 812 | ||
| 769 | - //3、回复操作成功 | 813 | + // 3、回复操作成功 |
| 770 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); | 814 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); |
| 771 | } | 815 | } |
| 772 | 816 | ||
| 773 | - | ||
| 774 | /******************************************************************************************************************************* | 817 | /******************************************************************************************************************************* |
| 775 | * | 818 | * |
| 776 | * 警灯部分 | 819 | * 警灯部分 |
| @@ -780,7 +823,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int Fra | @@ -780,7 +823,7 @@ T_JZsdkReturnCode JZsdl_Uart_ObtainGimbalPitchFineTuning(int DeviceName, int Fra | ||
| 780 | * | 823 | * |
| 781 | * 收到警灯状态 | 824 | * 收到警灯状态 |
| 782 | * | 825 | * |
| 783 | -**********/ | 826 | + **********/ |
| 784 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Status(int DeviceName, int status, int mode) | 827 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Status(int DeviceName, int status, int mode) |
| 785 | { | 828 | { |
| 786 | UIcontrol_ObtainWarningLight_Status(DeviceName, status, mode); | 829 | UIcontrol_ObtainWarningLight_Status(DeviceName, status, mode); |
| @@ -790,7 +833,7 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Status(int DeviceName, i | @@ -790,7 +833,7 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Status(int DeviceName, i | ||
| 790 | * | 833 | * |
| 791 | * 收到警灯颜色 | 834 | * 收到警灯颜色 |
| 792 | * | 835 | * |
| 793 | -**********/ | 836 | + **********/ |
| 794 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Color(int DeviceName, int color1, int color2) | 837 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Color(int DeviceName, int color1, int color2) |
| 795 | { | 838 | { |
| 796 | UIcontrol_ObtainWarningLight_Color(DeviceName, color1, color2); | 839 | UIcontrol_ObtainWarningLight_Color(DeviceName, color1, color2); |
| @@ -800,13 +843,11 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Color(int DeviceName, in | @@ -800,13 +843,11 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainWaringlight_Color(int DeviceName, in | ||
| 800 | * | 843 | * |
| 801 | * 收到产品序列号 | 844 | * 收到产品序列号 |
| 802 | * | 845 | * |
| 803 | -**********/ | 846 | + **********/ |
| 804 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int SerialNumber) | 847 | T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int SerialNumber) |
| 805 | { | 848 | { |
| 806 | - | ||
| 807 | } | 849 | } |
| 808 | 850 | ||
| 809 | - | ||
| 810 | /******************************************************************************************************** | 851 | /******************************************************************************************************** |
| 811 | ********* ********| | 852 | ********* ********| |
| 812 | ********* ********| | 853 | ********* ********| |
| @@ -825,7 +866,7 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int Ser | @@ -825,7 +866,7 @@ T_JZsdkReturnCode JZsdl_Uart_RecvDeal_ObtainSerialNumber(int DeviceName, int Ser | ||
| 825 | * | 866 | * |
| 826 | * 设置云台最大值最小值 | 867 | * 设置云台最大值最小值 |
| 827 | * | 868 | * |
| 828 | -**********/ | 869 | + **********/ |
| 829 | T_JZsdkReturnCode JZsdk_Uart_SetGimbalRange(int DeviceName, int value) | 870 | T_JZsdkReturnCode JZsdk_Uart_SetGimbalRange(int DeviceName, int value) |
| 830 | { | 871 | { |
| 831 | return UIcontrol_SetGimbalRange(DeviceName, value); | 872 | return UIcontrol_SetGimbalRange(DeviceName, value); |
| @@ -835,19 +876,19 @@ T_JZsdkReturnCode JZsdk_Uart_SetGimbalRange(int DeviceName, int value) | @@ -835,19 +876,19 @@ T_JZsdkReturnCode JZsdk_Uart_SetGimbalRange(int DeviceName, int value) | ||
| 835 | * | 876 | * |
| 836 | * 设置云台联动 | 877 | * 设置云台联动 |
| 837 | * | 878 | * |
| 838 | -**********/ | 879 | + **********/ |
| 839 | T_JZsdkReturnCode JZsdk_Uart_GimbalLinkageControl(int DeviceName, int FrameSequence, int value) | 880 | T_JZsdkReturnCode JZsdk_Uart_GimbalLinkageControl(int DeviceName, int FrameSequence, int value) |
| 840 | { | 881 | { |
| 841 | - //1、设置本地的云台联动 | 882 | + // 1、设置本地的云台联动 |
| 842 | int ret = UIcontrol_Set_GimbalLinkageControl(DeviceName, value); | 883 | int ret = UIcontrol_Set_GimbalLinkageControl(DeviceName, value); |
| 843 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 884 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| 844 | { | 885 | { |
| 845 | - //回复操作成功 | 886 | + // 回复操作成功 |
| 846 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); | 887 | JZsdk_Uart_SendDeal_Reply_Sucesss(DeviceName, FrameSequence); |
| 847 | } | 888 | } |
| 848 | else | 889 | else |
| 849 | { | 890 | { |
| 850 | - //回复操作失败 | 891 | + // 回复操作失败 |
| 851 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | 892 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); |
| 852 | } | 893 | } |
| 853 | } | 894 | } |
| @@ -856,7 +897,7 @@ T_JZsdkReturnCode JZsdk_Uart_GimbalLinkageControl(int DeviceName, int FrameSeque | @@ -856,7 +897,7 @@ T_JZsdkReturnCode JZsdk_Uart_GimbalLinkageControl(int DeviceName, int FrameSeque | ||
| 856 | * | 897 | * |
| 857 | * 查询云台联动 | 898 | * 查询云台联动 |
| 858 | * | 899 | * |
| 859 | -**********/ | 900 | + **********/ |
| 860 | T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int FrameSequence) | 901 | T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int FrameSequence) |
| 861 | { | 902 | { |
| 862 | int LinkageValue; | 903 | int LinkageValue; |
| @@ -864,40 +905,38 @@ T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int Frame | @@ -864,40 +905,38 @@ T_JZsdkReturnCode JZsdk_Uart_Checkstatus_GimbalLinkage(int DeviceName, int Frame | ||
| 864 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_GimbalLinkage(&LinkageValue); | 905 | T_JZsdkReturnCode ret = UIcontrol_CheckStatus_GimbalLinkage(&LinkageValue); |
| 865 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 906 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| 866 | { | 907 | { |
| 867 | - //回复操作失败 | 908 | + // 回复操作失败 |
| 868 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); | 909 | JZsdk_Uart_SendDeal_Reply_Failure(DeviceName, FrameSequence); |
| 869 | } | 910 | } |
| 870 | 911 | ||
| 871 | - //成功则发送云台联动值 | 912 | + // 成功则发送云台联动值 |
| 872 | JZsdk_Uart_SendDeal_GimbalLinkageControl(DeviceName, FrameSequence, LinkageValue); | 913 | JZsdk_Uart_SendDeal_GimbalLinkageControl(DeviceName, FrameSequence, LinkageValue); |
| 873 | } | 914 | } |
| 874 | 915 | ||
| 875 | /* | 916 | /* |
| 876 | -* | ||
| 877 | -* 设置本地从设备名 | ||
| 878 | -* | ||
| 879 | -*/ | 917 | + * |
| 918 | + * 设置本地从设备名 | ||
| 919 | + * | ||
| 920 | + */ | ||
| 880 | T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName) | 921 | T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName) |
| 881 | { | 922 | { |
| 882 | - printf("设置本地从设备名%x\n",DeviceName); | 923 | + printf("设置本地从设备名%x\n", DeviceName); |
| 883 | 924 | ||
| 884 | SecondaryDeviceName = DeviceName; | 925 | SecondaryDeviceName = DeviceName; |
| 885 | 926 | ||
| 886 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 927 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 887 | } | 928 | } |
| 888 | 929 | ||
| 889 | - | ||
| 890 | /* | 930 | /* |
| 891 | -* | ||
| 892 | -* 获取本地从设备名 | ||
| 893 | -* | ||
| 894 | -*/ | 931 | + * |
| 932 | + * 获取本地从设备名 | ||
| 933 | + * | ||
| 934 | + */ | ||
| 895 | int JZsdk_Uart_GetSecondaryDeviceName() | 935 | int JZsdk_Uart_GetSecondaryDeviceName() |
| 896 | { | 936 | { |
| 897 | return SecondaryDeviceName; | 937 | return SecondaryDeviceName; |
| 898 | } | 938 | } |
| 899 | 939 | ||
| 900 | - | ||
| 901 | /******************************************************************************************************** | 940 | /******************************************************************************************************** |
| 902 | ********* ********| | 941 | ********* ********| |
| 903 | ********* ********| | 942 | ********* ********| |
| @@ -916,10 +955,10 @@ int JZsdk_Uart_GetSecondaryDeviceName() | @@ -916,10 +955,10 @@ int JZsdk_Uart_GetSecondaryDeviceName() | ||
| 916 | * | 955 | * |
| 917 | * 查询从设备名 | 956 | * 查询从设备名 |
| 918 | * | 957 | * |
| 919 | -*/ | 958 | + */ |
| 920 | int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence) | 959 | int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence) |
| 921 | { | 960 | { |
| 922 | - //1、发送查询一遍从设备名, 通常位于 串口1 | 961 | + // 1、发送查询一遍从设备名, 通常位于 串口1 |
| 923 | JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(UART_DEV_1, FrameSequence); | 962 | JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(UART_DEV_1, FrameSequence); |
| 924 | } | 963 | } |
| 925 | 964 | ||
| @@ -927,18 +966,18 @@ int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence) | @@ -927,18 +966,18 @@ int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence) | ||
| 927 | * | 966 | * |
| 928 | * 收到云台联动值 | 967 | * 收到云台联动值 |
| 929 | * | 968 | * |
| 930 | -**********/ | ||
| 931 | -T_JZsdkReturnCode JZsdk_Uart_ObtainGimbalLinkage(int DeviceName,int FrameSequence, int value) | 969 | + **********/ |
| 970 | +T_JZsdkReturnCode JZsdk_Uart_ObtainGimbalLinkage(int DeviceName, int FrameSequence, int value) | ||
| 932 | { | 971 | { |
| 933 | T_JZsdkReturnCode ret = UIcontrol_Obtain_GimbalLinkage(DeviceName, value); | 972 | T_JZsdkReturnCode ret = UIcontrol_Obtain_GimbalLinkage(DeviceName, value); |
| 934 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 973 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| 935 | { | 974 | { |
| 936 | - //回复操作成功 | 975 | + // 回复操作成功 |
| 937 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); | 976 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); |
| 938 | } | 977 | } |
| 939 | else | 978 | else |
| 940 | { | 979 | { |
| 941 | - //回复操作失败 | 980 | + // 回复操作失败 |
| 942 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); | 981 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); |
| 943 | } | 982 | } |
| 944 | } | 983 | } |
| @@ -62,6 +62,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode); | @@ -62,6 +62,7 @@ T_JZsdkReturnCode JZsdk_Uart_audio_PlayLoop(int DeviceName, int mode); | ||
| 62 | 62 | ||
| 63 | T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName); | 63 | T_JZsdkReturnCode JZsdk_Uart_Opus_PlayFixedFile(int DeviceName); |
| 64 | 64 | ||
| 65 | +T_JZsdkReturnCode JZsdk_Uart_CheckStatus_SerialNumber(int UartPort, int FrameSequence); | ||
| 65 | 66 | ||
| 66 | 67 | ||
| 67 | 68 | ||
| @@ -132,6 +133,10 @@ int JZsdk_Uart_GetSecondaryDeviceName(); | @@ -132,6 +133,10 @@ int JZsdk_Uart_GetSecondaryDeviceName(); | ||
| 132 | T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName); | 133 | T_JZsdkReturnCode JZsdk_Uart_SetSecondaryDeviceName(int DeviceName); |
| 133 | int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence); | 134 | int JZsdk_Uart_QuerySecondaryDeviceName(int FrameSequence); |
| 134 | 135 | ||
| 136 | + | ||
| 137 | +T_JZsdkReturnCode JZsdk_Uart_OutPutPower_Control(int DeviceName, int FrameSequence, int Value); | ||
| 138 | +T_JZsdkReturnCode JZsdk_Uart_Checkstatus_OutPutPower(int DeviceName, int FrameSequence); | ||
| 139 | + | ||
| 135 | #ifdef __cplusplus | 140 | #ifdef __cplusplus |
| 136 | } | 141 | } |
| 137 | #endif | 142 | #endif |
| @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value); | @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value); | ||
| 39 | **********/ | 39 | **********/ |
| 40 | static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) | 40 | static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) |
| 41 | { | 41 | { |
| 42 | - USER_LOG_INFO("串口设备4G,连接成功"); | 42 | + JZSDK_LOG_INFO("串口设备4g,连接成功"); |
| 43 | //获取帧的序列号 | 43 | //获取帧的序列号 |
| 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 45 | 45 | ||
| @@ -50,7 +50,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) | @@ -50,7 +50,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) | ||
| 50 | JZsdk_Uart_SendDeal_Send_Connect(UART_4G, Device_name); | 50 | JZsdk_Uart_SendDeal_Send_Connect(UART_4G, Device_name); |
| 51 | 51 | ||
| 52 | //1、将串口程序设置为连接模式 | 52 | //1、将串口程序设置为连接模式 |
| 53 | - //JZsdk_Uart_SetMainWorkMode(JZ_FLAGCODE_ON); | 53 | + //JZsdk_Uart_SetMainWorkMode(JZ_FLAGCODE_ON);s |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | /******************************************************************************************************************************* | 56 | /******************************************************************************************************************************* |
| @@ -67,7 +67,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) | @@ -67,7 +67,7 @@ static int Uart_4G_RecvDeal_AskForConnect(char *getbuf) | ||
| 67 | **********/ | 67 | **********/ |
| 68 | static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf) | 68 | static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf) |
| 69 | { | 69 | { |
| 70 | - USER_LOG_INFO("开启MP2实时喊话功能\n"); | 70 | + JZSDK_LOG_INFO("开启MP2实时喊话功能\n"); |
| 71 | T_JZsdkReturnCode ret; | 71 | T_JZsdkReturnCode ret; |
| 72 | 72 | ||
| 73 | //获取帧的序列号 | 73 | //获取帧的序列号 |
| @@ -111,7 +111,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf) | @@ -111,7 +111,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_start(char *getbuf) | ||
| 111 | **********/ | 111 | **********/ |
| 112 | static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | 112 | static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) |
| 113 | { | 113 | { |
| 114 | - USER_LOG_INFO("MP2实时喊话传输中\n"); | 114 | + JZSDK_LOG_INFO("MP2实时喊话传输中\n"); |
| 115 | T_JZsdkReturnCode ret; | 115 | T_JZsdkReturnCode ret; |
| 116 | 116 | ||
| 117 | //传输数据接口 | 117 | //传输数据接口 |
| @@ -126,7 +126,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | @@ -126,7 +126,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | ||
| 126 | **********/ | 126 | **********/ |
| 127 | static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf) | 127 | static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf) |
| 128 | { | 128 | { |
| 129 | - USER_LOG_INFO("关闭MP2实时喊话功能\n"); | 129 | + JZSDK_LOG_INFO("关闭MP2实时喊话功能\n"); |
| 130 | T_JZsdkReturnCode ret; | 130 | T_JZsdkReturnCode ret; |
| 131 | 131 | ||
| 132 | //获取帧的序列号 | 132 | //获取帧的序列号 |
| @@ -157,7 +157,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf) | @@ -157,7 +157,7 @@ static int Uart_4G_RecvDeal_RealTimeMP2_stop(char *getbuf) | ||
| 157 | **********/ | 157 | **********/ |
| 158 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | 158 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) |
| 159 | { | 159 | { |
| 160 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 160 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 161 | //获取帧的序列号 | 161 | //获取帧的序列号 |
| 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 163 | 163 | ||
| @@ -168,7 +168,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -168,7 +168,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 168 | char FileName[1024]; | 168 | char FileName[1024]; |
| 169 | memset(FileName,0,1024); | 169 | memset(FileName,0,1024); |
| 170 | memcpy(FileName, &getbuf[9], FileNameLen); | 170 | memcpy(FileName, &getbuf[9], FileNameLen); |
| 171 | - USER_LOG_INFO("保存的文件名为%s",FileName); | 171 | + JZSDK_LOG_INFO("保存的文件名为%s",FileName); |
| 172 | 172 | ||
| 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); | 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); |
| 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -192,7 +192,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -192,7 +192,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 192 | **********/ | 192 | **********/ |
| 193 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) | 193 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) |
| 194 | { | 194 | { |
| 195 | - USER_LOG_INFO("传输音频文件中\n"); | 195 | + JZSDK_LOG_INFO("传输音频文件中\n"); |
| 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); | 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); |
| 197 | } | 197 | } |
| 198 | /********* | 198 | /********* |
| @@ -203,7 +203,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int l | @@ -203,7 +203,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int l | ||
| 203 | **********/ | 203 | **********/ |
| 204 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | 204 | static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) |
| 205 | { | 205 | { |
| 206 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 206 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 207 | //获取帧的序列号 | 207 | //获取帧的序列号 |
| 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 209 | 209 | ||
| @@ -223,7 +223,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | @@ -223,7 +223,7 @@ static int Uart_4G_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | ||
| 223 | static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) | 223 | static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) |
| 224 | { | 224 | { |
| 225 | T_JZsdkReturnCode ret; | 225 | T_JZsdkReturnCode ret; |
| 226 | - USER_LOG_INFO("播放指定音频\n"); | 226 | + JZSDK_LOG_INFO("播放指定音频\n"); |
| 227 | //获取帧的序列号 | 227 | //获取帧的序列号 |
| 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 229 | 229 | ||
| @@ -238,7 +238,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) | @@ -238,7 +238,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 238 | memset(music_name, 0, 256); | 238 | memset(music_name, 0, 256); |
| 239 | memcpy(music_name, &getbuf[9], datasize); | 239 | memcpy(music_name, &getbuf[9], datasize); |
| 240 | 240 | ||
| 241 | - USER_LOG_INFO("播放指定音频:%s\n",music_name); | 241 | + JZSDK_LOG_INFO("播放指定音频:%s\n",music_name); |
| 242 | 242 | ||
| 243 | ret = JZsdk_Uart_PlayMusic(UART_4G, music_name, datasize); | 243 | ret = JZsdk_Uart_PlayMusic(UART_4G, music_name, datasize); |
| 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -260,7 +260,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) | @@ -260,7 +260,7 @@ static int Uart_4G_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 260 | **********/ | 260 | **********/ |
| 261 | static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf) | 261 | static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf) |
| 262 | { | 262 | { |
| 263 | - USER_LOG_INFO("音频继续播放\n"); | 263 | + JZSDK_LOG_INFO("音频继续播放\n"); |
| 264 | //获取帧的序列号 | 264 | //获取帧的序列号 |
| 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 266 | 266 | ||
| @@ -277,7 +277,7 @@ static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf) | @@ -277,7 +277,7 @@ static int Uart_4G_RecvDeal_audio_PlayContinue(char *getbuf) | ||
| 277 | **********/ | 277 | **********/ |
| 278 | static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf) | 278 | static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf) |
| 279 | { | 279 | { |
| 280 | - USER_LOG_INFO("音频暂停播放\n"); | 280 | + JZSDK_LOG_INFO("音频暂停播放\n"); |
| 281 | //获取帧的序列号 | 281 | //获取帧的序列号 |
| 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 283 | 283 | ||
| @@ -294,7 +294,7 @@ static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf) | @@ -294,7 +294,7 @@ static int Uart_4G_RecvDeal_audio_PlayPause(char *getbuf) | ||
| 294 | **********/ | 294 | **********/ |
| 295 | static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf) | 295 | static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf) |
| 296 | { | 296 | { |
| 297 | - USER_LOG_INFO("音频停止播放\n"); | 297 | + JZSDK_LOG_INFO("音频停止播放\n"); |
| 298 | //获取帧的序列号 | 298 | //获取帧的序列号 |
| 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 300 | 300 | ||
| @@ -312,7 +312,7 @@ static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf) | @@ -312,7 +312,7 @@ static int Uart_4G_RecvDeal_audio_PlayStop(char *getbuf) | ||
| 312 | **********/ | 312 | **********/ |
| 313 | static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf) | 313 | static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf) |
| 314 | { | 314 | { |
| 315 | - USER_LOG_INFO("音频上一曲\n"); | 315 | + JZSDK_LOG_INFO("音频上一曲\n"); |
| 316 | //获取帧的序列号 | 316 | //获取帧的序列号 |
| 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 318 | 318 | ||
| @@ -330,7 +330,7 @@ static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf) | @@ -330,7 +330,7 @@ static int Uart_4G_RecvDeal_audio_LastSong(char *getbuf) | ||
| 330 | **********/ | 330 | **********/ |
| 331 | static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf) | 331 | static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf) |
| 332 | { | 332 | { |
| 333 | - USER_LOG_INFO("音频下一曲\n"); | 333 | + JZSDK_LOG_INFO("音频下一曲\n"); |
| 334 | //获取帧的序列号 | 334 | //获取帧的序列号 |
| 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 336 | 336 | ||
| @@ -348,7 +348,7 @@ static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf) | @@ -348,7 +348,7 @@ static int Uart_4G_RecvDeal_audio_NextSong(char *getbuf) | ||
| 348 | **********/ | 348 | **********/ |
| 349 | static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf) | 349 | static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf) |
| 350 | { | 350 | { |
| 351 | - USER_LOG_INFO("获取音乐列表\n"); | 351 | + JZSDK_LOG_INFO("获取音乐列表\n"); |
| 352 | //获取帧的序列号 | 352 | //获取帧的序列号 |
| 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 354 | 354 | ||
| @@ -390,7 +390,7 @@ static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf) | @@ -390,7 +390,7 @@ static int Uart_4G_RecvDeal_audio_GetMusicList(char *getbuf) | ||
| 390 | **********/ | 390 | **********/ |
| 391 | static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf) | 391 | static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf) |
| 392 | { | 392 | { |
| 393 | - USER_LOG_INFO("强制关闭功放\n"); | 393 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 394 | //获取帧的序列号 | 394 | //获取帧的序列号 |
| 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 396 | 396 | ||
| @@ -408,7 +408,7 @@ static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf) | @@ -408,7 +408,7 @@ static int Uart_4G_RecvDeal_Amplifier_stop(char *getbuf) | ||
| 408 | **********/ | 408 | **********/ |
| 409 | static int Uart_4G_RecvDeal_Amplifier_open(char *getbuf) | 409 | static int Uart_4G_RecvDeal_Amplifier_open(char *getbuf) |
| 410 | { | 410 | { |
| 411 | - USER_LOG_INFO("强制关闭功放\n"); | 411 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 412 | //获取帧的序列号 | 412 | //获取帧的序列号 |
| 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 414 | 414 | ||
| @@ -437,7 +437,7 @@ static int Uart_4G_RecvDeal_Amplifier_auto() | @@ -437,7 +437,7 @@ static int Uart_4G_RecvDeal_Amplifier_auto() | ||
| 437 | **********/ | 437 | **********/ |
| 438 | static int Uart_4G_RecvDeal_SetVolume(char *getbuf) | 438 | static int Uart_4G_RecvDeal_SetVolume(char *getbuf) |
| 439 | { | 439 | { |
| 440 | - USER_LOG_INFO("调节音量\n"); | 440 | + JZSDK_LOG_INFO("调节音量\n"); |
| 441 | //获取帧的序列号 | 441 | //获取帧的序列号 |
| 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 443 | 443 | ||
| @@ -456,7 +456,7 @@ static int Uart_4G_RecvDeal_SetVolume(char *getbuf) | @@ -456,7 +456,7 @@ static int Uart_4G_RecvDeal_SetVolume(char *getbuf) | ||
| 456 | **********/ | 456 | **********/ |
| 457 | static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf) | 457 | static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf) |
| 458 | { | 458 | { |
| 459 | - USER_LOG_INFO("查询音量\n"); | 459 | + JZSDK_LOG_INFO("查询音量\n"); |
| 460 | //获取帧的序列号 | 460 | //获取帧的序列号 |
| 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 462 | 462 | ||
| @@ -479,7 +479,7 @@ static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf) | @@ -479,7 +479,7 @@ static int Uart_4G_RecvDeal_CheckStatus_volume(char *getbuf) | ||
| 479 | static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf) | 479 | static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf) |
| 480 | { | 480 | { |
| 481 | //查询播放状态 | 481 | //查询播放状态 |
| 482 | - USER_LOG_INFO("查询播放状态\n"); | 482 | + JZSDK_LOG_INFO("查询播放状态\n"); |
| 483 | //获取帧的序列号 | 483 | //获取帧的序列号 |
| 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 485 | 485 | ||
| @@ -504,7 +504,7 @@ static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf) | @@ -504,7 +504,7 @@ static int Uart_4G_RecvDeal_CheckStatus_play(char *getbuf) | ||
| 504 | static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf) | 504 | static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf) |
| 505 | { | 505 | { |
| 506 | //查询云台角度 | 506 | //查询云台角度 |
| 507 | - USER_LOG_INFO("查询云台角度\n"); | 507 | + JZSDK_LOG_INFO("查询云台角度\n"); |
| 508 | //获取帧的序列号 | 508 | //获取帧的序列号 |
| 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 510 | 510 | ||
| @@ -514,9 +514,6 @@ static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf) | @@ -514,9 +514,6 @@ static int Uart_4G_RecvDeal_CheckStatus_gimbal(char *getbuf) | ||
| 514 | 514 | ||
| 515 | JZsdk_Uart_CheckStatus_gimbal(&PitchAngle, &YawAngle); | 515 | JZsdk_Uart_CheckStatus_gimbal(&PitchAngle, &YawAngle); |
| 516 | 516 | ||
| 517 | - //回复操作成功 | ||
| 518 | - //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); | ||
| 519 | - | ||
| 520 | //2、发送本地云台值 | 517 | //2、发送本地云台值 |
| 521 | JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(UART_4G, PitchAngle); | 518 | JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(UART_4G, PitchAngle); |
| 522 | } | 519 | } |
| @@ -543,7 +540,7 @@ static int Uart_4G_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | @@ -543,7 +540,7 @@ static int Uart_4G_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | ||
| 543 | static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | 540 | static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) |
| 544 | { | 541 | { |
| 545 | //查询播放文件名 | 542 | //查询播放文件名 |
| 546 | - USER_LOG_INFO("查询播放文件名\n"); | 543 | + JZSDK_LOG_INFO("查询播放文件名\n"); |
| 547 | //获取帧的序列号 | 544 | //获取帧的序列号 |
| 548 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 549 | 546 | ||
| @@ -552,7 +549,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -552,7 +549,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 552 | int MusicName_Len; | 549 | int MusicName_Len; |
| 553 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); | 550 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); |
| 554 | 551 | ||
| 555 | - USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); | 552 | + JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); |
| 556 | 553 | ||
| 557 | //回复操作成功 | 554 | //回复操作成功 |
| 558 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); | 555 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); |
| @@ -569,7 +566,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -569,7 +566,7 @@ static int Uart_4G_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 569 | static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | 566 | static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) |
| 570 | { | 567 | { |
| 571 | //查询软件版本号 | 568 | //查询软件版本号 |
| 572 | - USER_LOG_INFO("查询软件版本号\n"); | 569 | + JZSDK_LOG_INFO("查询软件版本号\n"); |
| 573 | //获取帧的序列号 | 570 | //获取帧的序列号 |
| 574 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 571 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 575 | 572 | ||
| @@ -580,7 +577,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -580,7 +577,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 580 | 577 | ||
| 581 | //1、获取版本号 | 578 | //1、获取版本号 |
| 582 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); | 579 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); |
| 583 | - USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); | 580 | + JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); |
| 584 | 581 | ||
| 585 | //回复操作成功 | 582 | //回复操作成功 |
| 586 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); | 583 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); |
| @@ -597,7 +594,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -597,7 +594,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 597 | static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | 594 | static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) |
| 598 | { | 595 | { |
| 599 | //查询是否打开循环 | 596 | //查询是否打开循环 |
| 600 | - USER_LOG_INFO("查询是否打开循环\n"); | 597 | + JZSDK_LOG_INFO("查询是否打开循环\n"); |
| 601 | //获取帧的序列号 | 598 | //获取帧的序列号 |
| 602 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 599 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 603 | 600 | ||
| @@ -605,7 +602,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -605,7 +602,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 605 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); | 602 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); |
| 606 | if (LoopStatus < 0) | 603 | if (LoopStatus < 0) |
| 607 | { | 604 | { |
| 608 | - USER_LOG_INFO("循环状态获取失败"); | 605 | + JZSDK_LOG_INFO("循环状态获取失败"); |
| 609 | return -1; | 606 | return -1; |
| 610 | } | 607 | } |
| 611 | 608 | ||
| @@ -624,7 +621,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -624,7 +621,7 @@ static int Uart_4G_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 624 | static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | 621 | static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) |
| 625 | { | 622 | { |
| 626 | //查询音色 | 623 | //查询音色 |
| 627 | - USER_LOG_INFO("查询音色\n"); | 624 | + JZSDK_LOG_INFO("查询音色\n"); |
| 628 | //获取帧的序列号 | 625 | //获取帧的序列号 |
| 629 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 626 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 630 | 627 | ||
| @@ -632,7 +629,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -632,7 +629,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 632 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); | 629 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); |
| 633 | if (TTS_tone < 0) | 630 | if (TTS_tone < 0) |
| 634 | { | 631 | { |
| 635 | - USER_LOG_INFO("音色获取失败"); | 632 | + JZSDK_LOG_INFO("音色获取失败"); |
| 636 | return -1; | 633 | return -1; |
| 637 | } | 634 | } |
| 638 | 635 | ||
| @@ -652,7 +649,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -652,7 +649,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 652 | static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | 649 | static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) |
| 653 | { | 650 | { |
| 654 | //查询语速 | 651 | //查询语速 |
| 655 | - USER_LOG_INFO("查询语速\n"); | 652 | + JZSDK_LOG_INFO("查询语速\n"); |
| 656 | //获取帧的序列号 | 653 | //获取帧的序列号 |
| 657 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 658 | 655 | ||
| @@ -660,7 +657,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -660,7 +657,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 660 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); | 657 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); |
| 661 | if (TTS_speed < 0) | 658 | if (TTS_speed < 0) |
| 662 | { | 659 | { |
| 663 | - USER_LOG_INFO("语速获取失败"); | 660 | + JZSDK_LOG_INFO("语速获取失败"); |
| 664 | return -1; | 661 | return -1; |
| 665 | } | 662 | } |
| 666 | 663 | ||
| @@ -681,7 +678,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -681,7 +678,7 @@ static int Uart_4G_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 681 | **********/ | 678 | **********/ |
| 682 | static int Uart_4G_RecvDeal_PlayLoop(char *getbuf) | 679 | static int Uart_4G_RecvDeal_PlayLoop(char *getbuf) |
| 683 | { | 680 | { |
| 684 | - USER_LOG_INFO("开启关闭循环\n"); | 681 | + JZSDK_LOG_INFO("开启关闭循环\n"); |
| 685 | //获取帧的序列号 | 682 | //获取帧的序列号 |
| 686 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 683 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 687 | 684 | ||
| @@ -711,7 +708,7 @@ static int Uart_4G_RecvDeal_PlayLoop(char *getbuf) | @@ -711,7 +708,7 @@ static int Uart_4G_RecvDeal_PlayLoop(char *getbuf) | ||
| 711 | **********/ | 708 | **********/ |
| 712 | static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf) | 709 | static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf) |
| 713 | { | 710 | { |
| 714 | - USER_LOG_INFO("删除音频操作\n"); | 711 | + JZSDK_LOG_INFO("删除音频操作\n"); |
| 715 | //获取帧的序列号 | 712 | //获取帧的序列号 |
| 716 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 713 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 717 | 714 | ||
| @@ -744,7 +741,7 @@ static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf) | @@ -744,7 +741,7 @@ static int Uart_4G_RecvDeal_Delete_Audio(char *getbuf) | ||
| 744 | **********/ | 741 | **********/ |
| 745 | static int Uart_4G_RecvDeal_Delete_VoiceRecord(char *getbuf) | 742 | static int Uart_4G_RecvDeal_Delete_VoiceRecord(char *getbuf) |
| 746 | { | 743 | { |
| 747 | - USER_LOG_INFO("删除录音操作\n"); | 744 | + JZSDK_LOG_INFO("删除录音操作\n"); |
| 748 | //获取帧的序列号 | 745 | //获取帧的序列号 |
| 749 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 746 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 750 | 747 | ||
| @@ -786,7 +783,7 @@ static int Uart_4G_RecvDeal_Delete_VideoRecord() | @@ -786,7 +783,7 @@ static int Uart_4G_RecvDeal_Delete_VideoRecord() | ||
| 786 | **********/ | 783 | **********/ |
| 787 | static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf) | 784 | static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf) |
| 788 | { | 785 | { |
| 789 | - USER_LOG_INFO("tts设置音色\n"); | 786 | + JZSDK_LOG_INFO("tts设置音色\n"); |
| 790 | //获取帧的序列号 | 787 | //获取帧的序列号 |
| 791 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 788 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 792 | 789 | ||
| @@ -814,16 +811,16 @@ static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf) | @@ -814,16 +811,16 @@ static int Uart_4G_RecvDeal_TTS_SetTone(char *getbuf) | ||
| 814 | **********/ | 811 | **********/ |
| 815 | static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf) | 812 | static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf) |
| 816 | { | 813 | { |
| 817 | - USER_LOG_INFO("设置语速\n"); | 814 | + JZSDK_LOG_INFO("设置语速\n"); |
| 818 | //获取帧的序列号 | 815 | //获取帧的序列号 |
| 819 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 820 | 817 | ||
| 821 | //1、从帧数据从获取语速 | 818 | //1、从帧数据从获取语速 |
| 822 | int speed = (int)getbuf[9]; | 819 | int speed = (int)getbuf[9]; |
| 823 | - USER_LOG_INFO("获取的语速为:%d",speed); | 820 | + JZSDK_LOG_INFO("获取的语速为:%d",speed); |
| 824 | if (speed > 100 || speed < 0) | 821 | if (speed > 100 || speed < 0) |
| 825 | { | 822 | { |
| 826 | - USER_LOG_INFO("语速超出范围\n"); | 823 | + JZSDK_LOG_INFO("语速超出范围\n"); |
| 827 | 824 | ||
| 828 | //回复操作失败 | 825 | //回复操作失败 |
| 829 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); | 826 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); |
| @@ -854,12 +851,12 @@ static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf) | @@ -854,12 +851,12 @@ static int Uart_4G_RecvDeal_TTS_SetSpeed(char *getbuf) | ||
| 854 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 | 851 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 |
| 855 | static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf) | 852 | static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf) |
| 856 | { | 853 | { |
| 857 | - USER_LOG_INFO("tts开始传输"); | 854 | + JZSDK_LOG_INFO("tts开始传输"); |
| 858 | //获取帧的序列号 | 855 | //获取帧的序列号 |
| 859 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 856 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 860 | 857 | ||
| 861 | //1、重置缓冲区 | 858 | //1、重置缓冲区 |
| 862 | - memset(TTS_Recv_buffer, '\0', 1009); | 859 | + memset(TTS_Recv_buffer, 0, 1009); |
| 863 | 860 | ||
| 864 | //2、重置缓冲区长度 | 861 | //2、重置缓冲区长度 |
| 865 | TTS_Recv_buffer_length = 0; | 862 | TTS_Recv_buffer_length = 0; |
| @@ -878,7 +875,7 @@ static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf) | @@ -878,7 +875,7 @@ static int Uart_4G_RecvDeal_TTS_Trans_start(char *getbuf) | ||
| 878 | **********/ | 875 | **********/ |
| 879 | static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | 876 | static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) |
| 880 | { | 877 | { |
| 881 | - USER_LOG_INFO("tts传输中"); | 878 | + JZSDK_LOG_INFO("tts传输中"); |
| 882 | 879 | ||
| 883 | if (TTS_Recv_buffer_length+len < 1000) | 880 | if (TTS_Recv_buffer_length+len < 1000) |
| 884 | { | 881 | { |
| @@ -890,9 +887,10 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -890,9 +887,10 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 890 | } | 887 | } |
| 891 | else | 888 | else |
| 892 | { | 889 | { |
| 893 | - USER_LOG_ERROR("TTS字数超出1000字"); | 890 | + JZSDK_LOG_ERROR("TTS字数超出1000字节"); |
| 894 | } | 891 | } |
| 895 | } | 892 | } |
| 893 | + | ||
| 896 | /********* | 894 | /********* |
| 897 | * | 895 | * |
| 898 | * tts传输结束 | 896 | * tts传输结束 |
| @@ -901,12 +899,13 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -901,12 +899,13 @@ static int Uart_4G_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 901 | **********/ | 899 | **********/ |
| 902 | static int Uart_4G_RecvDeal_TTS_Trans_stop(char *getbuf) | 900 | static int Uart_4G_RecvDeal_TTS_Trans_stop(char *getbuf) |
| 903 | { | 901 | { |
| 904 | - USER_LOG_INFO("tts传输结束"); | 902 | + JZSDK_LOG_INFO("tts传输结束"); |
| 905 | //获取帧的序列号 | 903 | //获取帧的序列号 |
| 906 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 904 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 907 | 905 | ||
| 906 | + | ||
| 908 | //1、打印一次TTS文本 | 907 | //1、打印一次TTS文本 |
| 909 | - USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer); | 908 | + JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer); |
| 910 | 909 | ||
| 911 | //2、播放TTS | 910 | //2、播放TTS |
| 912 | JZsdk_Uart_TTS_Play(UART_4G, TTS_Recv_buffer, TTS_Recv_buffer_length); | 911 | 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) | @@ -924,7 +923,7 @@ static int Uart_4G_RecvDeal_TTS_Trans_stop(char *getbuf) | ||
| 924 | **********/ | 923 | **********/ |
| 925 | static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf) | 924 | static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf) |
| 926 | { | 925 | { |
| 927 | - USER_LOG_INFO("打开opus传输\n"); | 926 | + JZSDK_LOG_INFO("打开opus传输\n"); |
| 928 | //获取帧的序列号 | 927 | //获取帧的序列号 |
| 929 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 928 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 930 | 929 | ||
| @@ -941,7 +940,7 @@ static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf) | @@ -941,7 +940,7 @@ static int Uart_4G_RecvDeal_OpusTrans_start(char *getbuf) | ||
| 941 | //3、修改接收模式为传输opus | 940 | //3、修改接收模式为传输opus |
| 942 | JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); | 941 | JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); |
| 943 | 942 | ||
| 944 | - USER_LOG_INFO("已完成打开opus传输处理\n"); | 943 | + JZSDK_LOG_INFO("已完成打开opus传输处理\n"); |
| 945 | 944 | ||
| 946 | //回复操作成功 | 945 | //回复操作成功 |
| 947 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); | 946 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); |
| @@ -956,7 +955,7 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -956,7 +955,7 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 956 | { | 955 | { |
| 957 | JZsdk_Uart_SaveOpusTrans(SaveData,size); | 956 | JZsdk_Uart_SaveOpusTrans(SaveData,size); |
| 958 | 957 | ||
| 959 | - USER_LOG_INFO("已完成opus传输保存处理\n"); | 958 | + JZSDK_LOG_INFO("已完成opus传输保存处理\n"); |
| 960 | } | 959 | } |
| 961 | /********* | 960 | /********* |
| 962 | * | 961 | * |
| @@ -966,13 +965,13 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -966,13 +965,13 @@ static int Uart_4G_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 966 | **********/ | 965 | **********/ |
| 967 | static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf) | 966 | static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf) |
| 968 | { | 967 | { |
| 969 | - USER_LOG_INFO("结束opus传输\n"); | 968 | + JZSDK_LOG_INFO("结束opus传输\n"); |
| 970 | //获取帧的序列号 | 969 | //获取帧的序列号 |
| 971 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 970 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 972 | 971 | ||
| 973 | JZsdk_Uart_SaveOpusStop(); | 972 | JZsdk_Uart_SaveOpusStop(); |
| 974 | 973 | ||
| 975 | - USER_LOG_INFO("结束opus传输处理\n"); | 974 | + JZSDK_LOG_INFO("结束opus传输处理\n"); |
| 976 | 975 | ||
| 977 | //回复操作成功 | 976 | //回复操作成功 |
| 978 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); | 977 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_4G, FrameSequence); |
| @@ -985,7 +984,7 @@ static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf) | @@ -985,7 +984,7 @@ static int Uart_4G_RecvDeal_OpusTrans_stop(char *getbuf) | ||
| 985 | **********/ | 984 | **********/ |
| 986 | static int Uart_4G_RecvDeal_OpusPlay(char *getbuf) | 985 | static int Uart_4G_RecvDeal_OpusPlay(char *getbuf) |
| 987 | { | 986 | { |
| 988 | - USER_LOG_INFO("opus播放\n"); | 987 | + JZSDK_LOG_INFO("opus播放\n"); |
| 989 | //获取帧的序列号 | 988 | //获取帧的序列号 |
| 990 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 989 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 991 | 990 | ||
| @@ -1005,7 +1004,7 @@ static int Uart_4G_RecvDeal_OpusPlay(char *getbuf) | @@ -1005,7 +1004,7 @@ static int Uart_4G_RecvDeal_OpusPlay(char *getbuf) | ||
| 1005 | **********/ | 1004 | **********/ |
| 1006 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | 1005 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) |
| 1007 | { | 1006 | { |
| 1008 | - USER_LOG_INFO("开启opus实时喊话功能\n"); | 1007 | + JZSDK_LOG_INFO("开启opus实时喊话功能\n"); |
| 1009 | //获取帧的序列号 | 1008 | //获取帧的序列号 |
| 1010 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1009 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1011 | 1010 | ||
| @@ -1040,7 +1039,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | @@ -1040,7 +1039,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | ||
| 1040 | **********/ | 1039 | **********/ |
| 1041 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) | 1040 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) |
| 1042 | { | 1041 | { |
| 1043 | - USER_LOG_INFO("opus语音传输中\n"); | 1042 | + JZSDK_LOG_INFO("opus语音传输中\n"); |
| 1044 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); | 1043 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); |
| 1045 | 1044 | ||
| 1046 | } | 1045 | } |
| @@ -1052,7 +1051,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int l | @@ -1052,7 +1051,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int l | ||
| 1052 | **********/ | 1051 | **********/ |
| 1053 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | 1052 | static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) |
| 1054 | { | 1053 | { |
| 1055 | - USER_LOG_INFO("关闭opus实时喊话功能\n"); | 1054 | + JZSDK_LOG_INFO("关闭opus实时喊话功能\n"); |
| 1056 | //获取帧的序列号 | 1055 | //获取帧的序列号 |
| 1057 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1056 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1058 | 1057 | ||
| @@ -1082,7 +1081,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | @@ -1082,7 +1081,7 @@ static int Uart_4G_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | ||
| 1082 | **********/ | 1081 | **********/ |
| 1083 | static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) | 1082 | static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) |
| 1084 | { | 1083 | { |
| 1085 | - USER_LOG_INFO("云台俯仰控制\n"); | 1084 | + JZSDK_LOG_INFO("云台俯仰控制\n"); |
| 1086 | //获取帧的序列号 | 1085 | //获取帧的序列号 |
| 1087 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1086 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1088 | 1087 | ||
| @@ -1103,13 +1102,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1103,13 +1102,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1103 | } | 1102 | } |
| 1104 | else | 1103 | else |
| 1105 | { | 1104 | { |
| 1106 | - USER_LOG_INFO("云台输入角度符号错误,无法正常控制"); | 1105 | + JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制"); |
| 1107 | //回复操作失败 | 1106 | //回复操作失败 |
| 1108 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); | 1107 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); |
| 1109 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1108 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1110 | } | 1109 | } |
| 1111 | 1110 | ||
| 1112 | - USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle); | 1111 | + JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle); |
| 1113 | 1112 | ||
| 1114 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_4G, Gimbal_angle); | 1113 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_4G, Gimbal_angle); |
| 1115 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 1114 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -1132,7 +1131,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1132,7 +1131,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1132 | **********/ | 1131 | **********/ |
| 1133 | static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | 1132 | static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) |
| 1134 | { | 1133 | { |
| 1135 | - USER_LOG_INFO("云台俯仰微调角度\n"); | 1134 | + JZSDK_LOG_INFO("云台俯仰微调角度\n"); |
| 1136 | //获取帧的序列号 | 1135 | //获取帧的序列号 |
| 1137 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1136 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1138 | 1137 | ||
| @@ -1140,7 +1139,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1140,7 +1139,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1140 | int Gimbal_signal = getbuf[9]; | 1139 | int Gimbal_signal = getbuf[9]; |
| 1141 | 1140 | ||
| 1142 | //2、通过云台控制帧 获取云台角度绝对值 | 1141 | //2、通过云台控制帧 获取云台角度绝对值 |
| 1143 | - int Gimbal_angle = ((int)getbuf[10]) ; | 1142 | + int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1144 | 1143 | ||
| 1145 | //3、拼接得到云台值 | 1144 | //3、拼接得到云台值 |
| 1146 | if (Gimbal_signal == 0x00) | 1145 | if (Gimbal_signal == 0x00) |
| @@ -1153,13 +1152,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1153,13 +1152,13 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1153 | } | 1152 | } |
| 1154 | else | 1153 | else |
| 1155 | { | 1154 | { |
| 1156 | - USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); | 1155 | + JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); |
| 1157 | //回复操作失败 | 1156 | //回复操作失败 |
| 1158 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); | 1157 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, FrameSequence); |
| 1159 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1158 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1160 | } | 1159 | } |
| 1161 | 1160 | ||
| 1162 | - USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); | 1161 | + JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); |
| 1163 | 1162 | ||
| 1164 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_4G, FrameSequence ,Gimbal_angle); | 1163 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_4G, FrameSequence ,Gimbal_angle); |
| 1165 | 1164 | ||
| @@ -1180,7 +1179,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1180,7 +1179,7 @@ static int Uart_4G_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1180 | **********/ | 1179 | **********/ |
| 1181 | static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf) | 1180 | static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf) |
| 1182 | { | 1181 | { |
| 1183 | - USER_LOG_INFO("设置爆闪频率\n"); | 1182 | + JZSDK_LOG_INFO("设置爆闪频率\n"); |
| 1184 | //获取帧的序列号 | 1183 | //获取帧的序列号 |
| 1185 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1184 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1186 | 1185 | ||
| @@ -1207,7 +1206,7 @@ static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf) | @@ -1207,7 +1206,7 @@ static int Uart_4G_RecvDeal_SearchLight_SetFrequency(char *getbuf) | ||
| 1207 | **********/ | 1206 | **********/ |
| 1208 | static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf) | 1207 | static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf) |
| 1209 | { | 1208 | { |
| 1210 | - USER_LOG_INFO("设置灯光控制\n"); | 1209 | + JZSDK_LOG_INFO("设置灯光控制\n"); |
| 1211 | //获取帧的序列号 | 1210 | //获取帧的序列号 |
| 1212 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1211 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1213 | 1212 | ||
| @@ -1234,7 +1233,7 @@ static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf) | @@ -1234,7 +1233,7 @@ static int Uart_4G_RecvDeal_SearchLight_Control(char *getbuf) | ||
| 1234 | **********/ | 1233 | **********/ |
| 1235 | static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf) | 1234 | static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf) |
| 1236 | { | 1235 | { |
| 1237 | - USER_LOG_INFO("设置灯光亮度\n"); | 1236 | + JZSDK_LOG_INFO("设置灯光亮度\n"); |
| 1238 | //获取帧的序列号 | 1237 | //获取帧的序列号 |
| 1239 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1238 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1240 | 1239 | ||
| @@ -1262,7 +1261,7 @@ static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf) | @@ -1262,7 +1261,7 @@ static int Uart_4G_RecvDeal_SearchLight_Lumen(char *getbuf) | ||
| 1262 | **********/ | 1261 | **********/ |
| 1263 | static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) | 1262 | static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) |
| 1264 | { | 1263 | { |
| 1265 | - USER_LOG_INFO("灯光属性查询\n"); | 1264 | + JZSDK_LOG_INFO("灯光属性查询\n"); |
| 1266 | //1、获取帧的序列号 | 1265 | //1、获取帧的序列号 |
| 1267 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1266 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1268 | 1267 | ||
| @@ -1278,7 +1277,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) | @@ -1278,7 +1277,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) | ||
| 1278 | **********/ | 1277 | **********/ |
| 1279 | static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | 1278 | static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) |
| 1280 | { | 1279 | { |
| 1281 | - USER_LOG_INFO("探照灯温度查询\n"); | 1280 | + JZSDK_LOG_INFO("探照灯温度查询\n"); |
| 1282 | //1、获取帧的序列号 | 1281 | //1、获取帧的序列号 |
| 1283 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1284 | 1283 | ||
| @@ -1293,7 +1292,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | @@ -1293,7 +1292,7 @@ static int Uart_4G_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | ||
| 1293 | **********/ | 1292 | **********/ |
| 1294 | static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | 1293 | static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) |
| 1295 | { | 1294 | { |
| 1296 | - USER_LOG_INFO("消息订阅控制\n"); | 1295 | + JZSDK_LOG_INFO("消息订阅控制\n"); |
| 1297 | //获取帧的序列号 | 1296 | //获取帧的序列号 |
| 1298 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1297 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1299 | 1298 | ||
| @@ -1313,6 +1312,55 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1313,6 +1312,55 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1313 | } | 1312 | } |
| 1314 | } | 1313 | } |
| 1315 | 1314 | ||
| 1315 | +/********* | ||
| 1316 | + * | ||
| 1317 | + * 查询产品序列号 | ||
| 1318 | + * | ||
| 1319 | +**********/ | ||
| 1320 | +static int Uart_4G_RecvDeal_CheckStatus_SerialNumber(char *getbuf) | ||
| 1321 | +{ | ||
| 1322 | + JZSDK_LOG_INFO("消息订阅控制\n"); | ||
| 1323 | + //获取帧的序列号 | ||
| 1324 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1325 | + | ||
| 1326 | + JZsdk_Uart_CheckStatus_SerialNumber(UART_4G, FrameSequence); | ||
| 1327 | + | ||
| 1328 | +} | ||
| 1329 | + | ||
| 1330 | +/********* | ||
| 1331 | + * | ||
| 1332 | + * 对外供电开关 | ||
| 1333 | + * | ||
| 1334 | +**********/ | ||
| 1335 | +static int Uart_4G_RecvDeal_OutPutPower_Control(char *getbuf) | ||
| 1336 | +{ | ||
| 1337 | + printf("对外电源控制\n"); | ||
| 1338 | + //获取帧的序列号 | ||
| 1339 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1340 | + | ||
| 1341 | + //获取控制值 | ||
| 1342 | + int Value = getbuf[9]; | ||
| 1343 | + | ||
| 1344 | + //控制 | ||
| 1345 | + JZsdk_Uart_OutPutPower_Control(UART_4G, FrameSequence, Value); | ||
| 1346 | +} | ||
| 1347 | + | ||
| 1348 | +/********* | ||
| 1349 | + * | ||
| 1350 | + * 对外电源查询 | ||
| 1351 | + * | ||
| 1352 | +**********/ | ||
| 1353 | +static int Uart_4G_RecvDeal_Checkstatus_OutPutPower(char *getbuf) | ||
| 1354 | +{ | ||
| 1355 | + printf("对外电源查询\n"); | ||
| 1356 | + | ||
| 1357 | + //获取帧的序列号 | ||
| 1358 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1359 | + | ||
| 1360 | + //获取本地数值 | ||
| 1361 | + JZsdk_Uart_Checkstatus_OutPutPower(UART_4G, FrameSequence); | ||
| 1362 | +} | ||
| 1363 | + | ||
| 1316 | /******************************************************************************************************************************* | 1364 | /******************************************************************************************************************************* |
| 1317 | * | 1365 | * |
| 1318 | * 警灯部分 | 1366 | * 警灯部分 |
| @@ -1325,7 +1373,7 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1325,7 +1373,7 @@ static int Uart_4G_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1325 | **********/ | 1373 | **********/ |
| 1326 | static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf) | 1374 | static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf) |
| 1327 | { | 1375 | { |
| 1328 | - USER_LOG_INFO("警灯模式控制\n"); | 1376 | + JZSDK_LOG_INFO("警灯模式控制\n"); |
| 1329 | //获取帧的序列号 | 1377 | //获取帧的序列号 |
| 1330 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1378 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1331 | 1379 | ||
| @@ -1353,7 +1401,7 @@ static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf) | @@ -1353,7 +1401,7 @@ static int Uart_4G_RecvDeal_WarningLight_ModeControl(char *getbuf) | ||
| 1353 | **********/ | 1401 | **********/ |
| 1354 | static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf) | 1402 | static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf) |
| 1355 | { | 1403 | { |
| 1356 | - USER_LOG_INFO("警灯颜色选择\n"); | 1404 | + JZSDK_LOG_INFO("警灯颜色选择\n"); |
| 1357 | //获取帧的序列号 | 1405 | //获取帧的序列号 |
| 1358 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1406 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1359 | 1407 | ||
| @@ -1381,7 +1429,7 @@ static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf) | @@ -1381,7 +1429,7 @@ static int Uart_4G_RecvDeal_WarningLight_SetColor(char *getbuf) | ||
| 1381 | **********/ | 1429 | **********/ |
| 1382 | static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | 1430 | static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) |
| 1383 | { | 1431 | { |
| 1384 | - USER_LOG_INFO("警灯状态查询\n"); | 1432 | + JZSDK_LOG_INFO("警灯状态查询\n"); |
| 1385 | //1、获取帧的序列号 | 1433 | //1、获取帧的序列号 |
| 1386 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1434 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1387 | 1435 | ||
| @@ -1397,7 +1445,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | @@ -1397,7 +1445,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | ||
| 1397 | **********/ | 1445 | **********/ |
| 1398 | static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | 1446 | static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) |
| 1399 | { | 1447 | { |
| 1400 | - USER_LOG_INFO("警灯颜色查询\n"); | 1448 | + JZSDK_LOG_INFO("警灯颜色查询\n"); |
| 1401 | //1、获取帧的序列号 | 1449 | //1、获取帧的序列号 |
| 1402 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1450 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1403 | 1451 | ||
| @@ -1436,7 +1484,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | @@ -1436,7 +1484,7 @@ static int Uart_4G_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | ||
| 1436 | **********/ | 1484 | **********/ |
| 1437 | static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | 1485 | static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) |
| 1438 | { | 1486 | { |
| 1439 | - USER_LOG_INFO("收到灯光频率\n"); | 1487 | + JZSDK_LOG_INFO("收到灯光频率\n"); |
| 1440 | //获取帧的序列号 | 1488 | //获取帧的序列号 |
| 1441 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1489 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1442 | 1490 | ||
| @@ -1454,7 +1502,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | @@ -1454,7 +1502,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | ||
| 1454 | **********/ | 1502 | **********/ |
| 1455 | static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | 1503 | static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf) |
| 1456 | { | 1504 | { |
| 1457 | - USER_LOG_INFO("收到灯光模式\n"); | 1505 | + JZSDK_LOG_INFO("收到灯光模式\n"); |
| 1458 | //获取帧的序列号 | 1506 | //获取帧的序列号 |
| 1459 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1507 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1460 | 1508 | ||
| @@ -1472,7 +1520,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | @@ -1472,7 +1520,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | ||
| 1472 | **********/ | 1520 | **********/ |
| 1473 | static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | 1521 | static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) |
| 1474 | { | 1522 | { |
| 1475 | - USER_LOG_INFO("收到灯光亮度\n"); | 1523 | + JZSDK_LOG_INFO("收到灯光亮度\n"); |
| 1476 | //获取帧的序列号 | 1524 | //获取帧的序列号 |
| 1477 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1525 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1478 | 1526 | ||
| @@ -1491,7 +1539,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | @@ -1491,7 +1539,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | ||
| 1491 | **********/ | 1539 | **********/ |
| 1492 | static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | 1540 | static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) |
| 1493 | { | 1541 | { |
| 1494 | - USER_LOG_INFO("收到探照灯温度\n"); | 1542 | + JZSDK_LOG_INFO("收到探照灯温度\n"); |
| 1495 | //获取帧的序列号 | 1543 | //获取帧的序列号 |
| 1496 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1544 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1497 | 1545 | ||
| @@ -1510,7 +1558,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | @@ -1510,7 +1558,7 @@ static int Uart_4G_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | ||
| 1510 | **********/ | 1558 | **********/ |
| 1511 | static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | 1559 | static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf) |
| 1512 | { | 1560 | { |
| 1513 | - USER_LOG_INFO("收到云台俯仰\n"); | 1561 | + JZSDK_LOG_INFO("收到云台俯仰\n"); |
| 1514 | //获取帧的序列号 | 1562 | //获取帧的序列号 |
| 1515 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1563 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1516 | 1564 | ||
| @@ -1541,7 +1589,7 @@ static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | @@ -1541,7 +1589,7 @@ static int Uart_4G_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | ||
| 1541 | **********/ | 1589 | **********/ |
| 1542 | static int Uart_4G_RecvDeal_ObtainGimbal_Yaw(char *getbuf) | 1590 | static int Uart_4G_RecvDeal_ObtainGimbal_Yaw(char *getbuf) |
| 1543 | { | 1591 | { |
| 1544 | - USER_LOG_INFO("收到云台航向\n"); | 1592 | + JZSDK_LOG_INFO("收到云台航向\n"); |
| 1545 | //获取帧的序列号 | 1593 | //获取帧的序列号 |
| 1546 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1594 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1547 | 1595 | ||
| @@ -1579,7 +1627,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1579,7 +1627,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1579 | int signal = getbuf[9]; | 1627 | int signal = getbuf[9]; |
| 1580 | 1628 | ||
| 1581 | //2、获取云台角度绝对值 | 1629 | //2、获取云台角度绝对值 |
| 1582 | - int pitch = (int)getbuf[10] ; | 1630 | + int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1583 | 1631 | ||
| 1584 | //3、拼接得到云台值 | 1632 | //3、拼接得到云台值 |
| 1585 | if (signal == 0x00) | 1633 | if (signal == 0x00) |
| @@ -1601,7 +1649,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1601,7 +1649,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1601 | **********/ | 1649 | **********/ |
| 1602 | static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf) | 1650 | static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf) |
| 1603 | { | 1651 | { |
| 1604 | - USER_LOG_INFO("收到警灯状态\n"); | 1652 | + JZSDK_LOG_INFO("收到警灯状态\n"); |
| 1605 | //获取帧的序列号 | 1653 | //获取帧的序列号 |
| 1606 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1607 | 1655 | ||
| @@ -1620,7 +1668,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf) | @@ -1620,7 +1668,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Status(char *getbuf) | ||
| 1620 | **********/ | 1668 | **********/ |
| 1621 | static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf) | 1669 | static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf) |
| 1622 | { | 1670 | { |
| 1623 | - USER_LOG_INFO("收到警灯颜色\n"); | 1671 | + JZSDK_LOG_INFO("收到警灯颜色\n"); |
| 1624 | //获取帧的序列号 | 1672 | //获取帧的序列号 |
| 1625 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1673 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1626 | 1674 | ||
| @@ -1639,7 +1687,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf) | @@ -1639,7 +1687,7 @@ static int Uart_4G_RecvDeal_ObtainWaringlight_Color(char *getbuf) | ||
| 1639 | **********/ | 1687 | **********/ |
| 1640 | static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf) | 1688 | static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf) |
| 1641 | { | 1689 | { |
| 1642 | - USER_LOG_INFO("收到产品序列号\n"); | 1690 | + JZSDK_LOG_INFO("收到产品序列号\n"); |
| 1643 | //获取帧的序列号 | 1691 | //获取帧的序列号 |
| 1644 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1692 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1645 | 1693 | ||
| @@ -1670,7 +1718,7 @@ static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf) | @@ -1670,7 +1718,7 @@ static int Uart_4G_RecvDeal_ObtainSerialNumber(char *getbuf) | ||
| 1670 | **********/ | 1718 | **********/ |
| 1671 | static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | 1719 | static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf) |
| 1672 | { | 1720 | { |
| 1673 | - USER_LOG_INFO("查询当前从设备名\n"); | 1721 | + JZSDK_LOG_INFO("查询当前从设备名\n"); |
| 1674 | 1722 | ||
| 1675 | //获取帧的序列号 | 1723 | //获取帧的序列号 |
| 1676 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1724 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1699,7 +1747,7 @@ static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | @@ -1699,7 +1747,7 @@ static int Uart_4G_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | ||
| 1699 | **********/ | 1747 | **********/ |
| 1700 | static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf) | 1748 | static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf) |
| 1701 | { | 1749 | { |
| 1702 | - USER_LOG_INFO("设置云台最大值最小值\n"); | 1750 | + JZSDK_LOG_INFO("设置云台最大值最小值\n"); |
| 1703 | //获取帧的序列号 | 1751 | //获取帧的序列号 |
| 1704 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1752 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1705 | 1753 | ||
| @@ -1726,7 +1774,7 @@ static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf) | @@ -1726,7 +1774,7 @@ static int Uart_4G_RecvDeal_SetGimbalRange(char *getbuf) | ||
| 1726 | **********/ | 1774 | **********/ |
| 1727 | static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf) | 1775 | static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf) |
| 1728 | { | 1776 | { |
| 1729 | - USER_LOG_INFO("设置云台联动\n"); | 1777 | + JZSDK_LOG_INFO("设置云台联动\n"); |
| 1730 | 1778 | ||
| 1731 | //获取帧的序列号 | 1779 | //获取帧的序列号 |
| 1732 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1780 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1746,7 +1794,7 @@ static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf) | @@ -1746,7 +1794,7 @@ static int Uart_4G_RecvDeal_GimbalLinkageControl(char *getbuf) | ||
| 1746 | **********/ | 1794 | **********/ |
| 1747 | static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | 1795 | static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) |
| 1748 | { | 1796 | { |
| 1749 | - USER_LOG_INFO("收到查询是否开启云台联动\n"); | 1797 | + JZSDK_LOG_INFO("收到查询是否开启云台联动\n"); |
| 1750 | 1798 | ||
| 1751 | //获取帧的序列号 | 1799 | //获取帧的序列号 |
| 1752 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1800 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1780,7 +1828,7 @@ static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | @@ -1780,7 +1828,7 @@ static int Uart_4G_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | ||
| 1780 | **********/ | 1828 | **********/ |
| 1781 | static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | 1829 | static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) |
| 1782 | { | 1830 | { |
| 1783 | - USER_LOG_INFO("收到从设备名\n"); | 1831 | + JZSDK_LOG_INFO("收到从设备名\n"); |
| 1784 | //获取帧的序列号 | 1832 | //获取帧的序列号 |
| 1785 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1833 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1786 | 1834 | ||
| @@ -1812,7 +1860,7 @@ static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | @@ -1812,7 +1860,7 @@ static int Uart_4G_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | ||
| 1812 | **********/ | 1860 | **********/ |
| 1813 | static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf) | 1861 | static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf) |
| 1814 | { | 1862 | { |
| 1815 | - USER_LOG_INFO("收到云台联动值\n"); | 1863 | + JZSDK_LOG_INFO("收到云台联动值\n"); |
| 1816 | //获取帧的序列号 | 1864 | //获取帧的序列号 |
| 1817 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1865 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1818 | 1866 | ||
| @@ -1847,7 +1895,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf) | @@ -1847,7 +1895,7 @@ static int Uart_4G_RecvDeal_ObtainGimbalLinkage(char *getbuf) | ||
| 1847 | **********/ | 1895 | **********/ |
| 1848 | static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf) | 1896 | static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf) |
| 1849 | { | 1897 | { |
| 1850 | - USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); | 1898 | + JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); |
| 1851 | //无法正常获取帧的序列号 | 1899 | //无法正常获取帧的序列号 |
| 1852 | //回复操作失败 | 1900 | //回复操作失败 |
| 1853 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, 0x00); | 1901 | JZsdk_Uart_SendDeal_Reply_Failure(UART_4G, 0x00); |
| @@ -1862,7 +1910,7 @@ static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf) | @@ -1862,7 +1910,7 @@ static int Uart_4G_RecvDeal_FrameErrorReply(char *getbuf) | ||
| 1862 | **********/ | 1910 | **********/ |
| 1863 | static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf) | 1911 | static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf) |
| 1864 | { | 1912 | { |
| 1865 | - USER_LOG_INFO("接受到操作成功\n"); | 1913 | + JZSDK_LOG_INFO("接受到操作成功\n"); |
| 1866 | } | 1914 | } |
| 1867 | 1915 | ||
| 1868 | /********* | 1916 | /********* |
| @@ -1873,7 +1921,7 @@ static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf) | @@ -1873,7 +1921,7 @@ static int Uart_4G_RecvDeal_OperationSuccessful(char *getbuf) | ||
| 1873 | **********/ | 1921 | **********/ |
| 1874 | static int Uart_4G_RecvDeal_OperationFailed(char *getbuf) | 1922 | static int Uart_4G_RecvDeal_OperationFailed(char *getbuf) |
| 1875 | { | 1923 | { |
| 1876 | - USER_LOG_INFO("接受到操作失败\n"); | 1924 | + JZSDK_LOG_INFO("接受到操作失败\n"); |
| 1877 | } | 1925 | } |
| 1878 | /******************************************************************************************************** | 1926 | /******************************************************************************************************** |
| 1879 | ********* ********| | 1927 | ********* ********| |
| @@ -1890,7 +1938,7 @@ static int Uart_4G_RecvDeal_OperationFailed(char *getbuf) | @@ -1890,7 +1938,7 @@ static int Uart_4G_RecvDeal_OperationFailed(char *getbuf) | ||
| 1890 | *********************************************************************************************************/ | 1938 | *********************************************************************************************************/ |
| 1891 | int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) | 1939 | int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) |
| 1892 | { | 1940 | { |
| 1893 | - USER_LOG_INFO("串口设备4G,接受到的模式为:%x",Receive_mode); | 1941 | + JZSDK_LOG_INFO("串口设备4g,接受到的模式为:%x",Receive_mode); |
| 1894 | switch (Receive_mode) | 1942 | switch (Receive_mode) |
| 1895 | { | 1943 | { |
| 1896 | /******************************************************************************************************************************* | 1944 | /******************************************************************************************************************************* |
| @@ -2198,9 +2246,20 @@ int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) | @@ -2198,9 +2246,20 @@ int Uart_4G_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) | ||
| 2198 | 2246 | ||
| 2199 | //序列号查询 | 2247 | //序列号查询 |
| 2200 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: | 2248 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: |
| 2249 | + Uart_4G_RecvDeal_CheckStatus_SerialNumber(getdata); | ||
| 2250 | + break; | ||
| 2201 | 2251 | ||
| 2252 | + //向外供电开关 | ||
| 2253 | + case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL: | ||
| 2254 | + Uart_4G_RecvDeal_OutPutPower_Control(getdata); | ||
| 2202 | break; | 2255 | break; |
| 2203 | 2256 | ||
| 2257 | + //查询向外供电情况 | ||
| 2258 | + case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER: | ||
| 2259 | + Uart_4G_RecvDeal_Checkstatus_OutPutPower(getdata); | ||
| 2260 | + break; | ||
| 2261 | + | ||
| 2262 | + | ||
| 2204 | 2263 | ||
| 2205 | /******************************************************************************************************************************* | 2264 | /******************************************************************************************************************************* |
| 2206 | * | 2265 | * |
| @@ -2589,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_4G(unsigned char *getbuf, int len) | @@ -2589,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_4G(unsigned char *getbuf, int len) | ||
| 2589 | * ****************/ | 2648 | * ****************/ |
| 2590 | int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value) | 2649 | int JZsdk_Uart_RecvDeal_Set_UART_4G_Receive_mode(int value) |
| 2591 | { | 2650 | { |
| 2592 | - USER_LOG_INFO("串口设备4G,二次修改接收模式%x\n",value); | 2651 | + JZSDK_LOG_INFO("串口设备4g,二次修改接收模式%x\n",value); |
| 2593 | UART_4G_Receive_mode = value; | 2652 | UART_4G_Receive_mode = value; |
| 2594 | return 0; | 2653 | return 0; |
| 2595 | } | 2654 | } |
| @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value); | @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value); | ||
| 39 | **********/ | 39 | **********/ |
| 40 | static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf) | 40 | static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf) |
| 41 | { | 41 | { |
| 42 | - USER_LOG_INFO("串口设备1号,连接成功"); | 42 | + JZSDK_LOG_INFO("串口设备1号,连接成功"); |
| 43 | //获取帧的序列号 | 43 | //获取帧的序列号 |
| 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 45 | 45 | ||
| @@ -67,7 +67,7 @@ static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf) | @@ -67,7 +67,7 @@ static int Uart_DEV1_RecvDeal_AskForConnect(char *getbuf) | ||
| 67 | **********/ | 67 | **********/ |
| 68 | static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf) | 68 | static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf) |
| 69 | { | 69 | { |
| 70 | - USER_LOG_INFO("开启MP2实时喊话功能\n"); | 70 | + JZSDK_LOG_INFO("开启MP2实时喊话功能\n"); |
| 71 | T_JZsdkReturnCode ret; | 71 | T_JZsdkReturnCode ret; |
| 72 | 72 | ||
| 73 | //获取帧的序列号 | 73 | //获取帧的序列号 |
| @@ -111,7 +111,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf) | @@ -111,7 +111,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_start(char *getbuf) | ||
| 111 | **********/ | 111 | **********/ |
| 112 | static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | 112 | static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) |
| 113 | { | 113 | { |
| 114 | - USER_LOG_INFO("MP2实时喊话传输中\n"); | 114 | + JZSDK_LOG_INFO("MP2实时喊话传输中\n"); |
| 115 | T_JZsdkReturnCode ret; | 115 | T_JZsdkReturnCode ret; |
| 116 | 116 | ||
| 117 | //传输数据接口 | 117 | //传输数据接口 |
| @@ -126,7 +126,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | @@ -126,7 +126,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | ||
| 126 | **********/ | 126 | **********/ |
| 127 | static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf) | 127 | static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf) |
| 128 | { | 128 | { |
| 129 | - USER_LOG_INFO("关闭MP2实时喊话功能\n"); | 129 | + JZSDK_LOG_INFO("关闭MP2实时喊话功能\n"); |
| 130 | T_JZsdkReturnCode ret; | 130 | T_JZsdkReturnCode ret; |
| 131 | 131 | ||
| 132 | //获取帧的序列号 | 132 | //获取帧的序列号 |
| @@ -157,7 +157,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf) | @@ -157,7 +157,7 @@ static int Uart_DEV1_RecvDeal_RealTimeMP2_stop(char *getbuf) | ||
| 157 | **********/ | 157 | **********/ |
| 158 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | 158 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) |
| 159 | { | 159 | { |
| 160 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 160 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 161 | //获取帧的序列号 | 161 | //获取帧的序列号 |
| 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 163 | 163 | ||
| @@ -168,7 +168,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -168,7 +168,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 168 | char FileName[1024]; | 168 | char FileName[1024]; |
| 169 | memset(FileName,0,1024); | 169 | memset(FileName,0,1024); |
| 170 | memcpy(FileName, &getbuf[9], FileNameLen); | 170 | memcpy(FileName, &getbuf[9], FileNameLen); |
| 171 | - USER_LOG_INFO("保存的文件名为%s",FileName); | 171 | + JZSDK_LOG_INFO("保存的文件名为%s",FileName); |
| 172 | 172 | ||
| 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); | 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); |
| 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -192,7 +192,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -192,7 +192,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 192 | **********/ | 192 | **********/ |
| 193 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) | 193 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) |
| 194 | { | 194 | { |
| 195 | - USER_LOG_INFO("传输音频文件中\n"); | 195 | + JZSDK_LOG_INFO("传输音频文件中\n"); |
| 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); | 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); |
| 197 | } | 197 | } |
| 198 | /********* | 198 | /********* |
| @@ -203,7 +203,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int | @@ -203,7 +203,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int | ||
| 203 | **********/ | 203 | **********/ |
| 204 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | 204 | static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) |
| 205 | { | 205 | { |
| 206 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 206 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 207 | //获取帧的序列号 | 207 | //获取帧的序列号 |
| 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 209 | 209 | ||
| @@ -223,7 +223,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | @@ -223,7 +223,7 @@ static int Uart_DEV1_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | ||
| 223 | static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) | 223 | static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) |
| 224 | { | 224 | { |
| 225 | T_JZsdkReturnCode ret; | 225 | T_JZsdkReturnCode ret; |
| 226 | - USER_LOG_INFO("播放指定音频\n"); | 226 | + JZSDK_LOG_INFO("播放指定音频\n"); |
| 227 | //获取帧的序列号 | 227 | //获取帧的序列号 |
| 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 229 | 229 | ||
| @@ -238,7 +238,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) | @@ -238,7 +238,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 238 | memset(music_name, 0, 256); | 238 | memset(music_name, 0, 256); |
| 239 | memcpy(music_name, &getbuf[9], datasize); | 239 | memcpy(music_name, &getbuf[9], datasize); |
| 240 | 240 | ||
| 241 | - USER_LOG_INFO("播放指定音频:%s\n",music_name); | 241 | + JZSDK_LOG_INFO("播放指定音频:%s\n",music_name); |
| 242 | 242 | ||
| 243 | ret = JZsdk_Uart_PlayMusic(UART_DEV_1, music_name, datasize); | 243 | ret = JZsdk_Uart_PlayMusic(UART_DEV_1, music_name, datasize); |
| 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -260,7 +260,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) | @@ -260,7 +260,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 260 | **********/ | 260 | **********/ |
| 261 | static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf) | 261 | static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf) |
| 262 | { | 262 | { |
| 263 | - USER_LOG_INFO("音频继续播放\n"); | 263 | + JZSDK_LOG_INFO("音频继续播放\n"); |
| 264 | //获取帧的序列号 | 264 | //获取帧的序列号 |
| 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 266 | 266 | ||
| @@ -277,7 +277,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf) | @@ -277,7 +277,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayContinue(char *getbuf) | ||
| 277 | **********/ | 277 | **********/ |
| 278 | static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf) | 278 | static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf) |
| 279 | { | 279 | { |
| 280 | - USER_LOG_INFO("音频暂停播放\n"); | 280 | + JZSDK_LOG_INFO("音频暂停播放\n"); |
| 281 | //获取帧的序列号 | 281 | //获取帧的序列号 |
| 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 283 | 283 | ||
| @@ -294,7 +294,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf) | @@ -294,7 +294,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayPause(char *getbuf) | ||
| 294 | **********/ | 294 | **********/ |
| 295 | static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf) | 295 | static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf) |
| 296 | { | 296 | { |
| 297 | - USER_LOG_INFO("音频停止播放\n"); | 297 | + JZSDK_LOG_INFO("音频停止播放\n"); |
| 298 | //获取帧的序列号 | 298 | //获取帧的序列号 |
| 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 300 | 300 | ||
| @@ -312,7 +312,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf) | @@ -312,7 +312,7 @@ static int Uart_DEV1_RecvDeal_audio_PlayStop(char *getbuf) | ||
| 312 | **********/ | 312 | **********/ |
| 313 | static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf) | 313 | static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf) |
| 314 | { | 314 | { |
| 315 | - USER_LOG_INFO("音频上一曲\n"); | 315 | + JZSDK_LOG_INFO("音频上一曲\n"); |
| 316 | //获取帧的序列号 | 316 | //获取帧的序列号 |
| 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 318 | 318 | ||
| @@ -330,7 +330,7 @@ static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf) | @@ -330,7 +330,7 @@ static int Uart_DEV1_RecvDeal_audio_LastSong(char *getbuf) | ||
| 330 | **********/ | 330 | **********/ |
| 331 | static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf) | 331 | static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf) |
| 332 | { | 332 | { |
| 333 | - USER_LOG_INFO("音频下一曲\n"); | 333 | + JZSDK_LOG_INFO("音频下一曲\n"); |
| 334 | //获取帧的序列号 | 334 | //获取帧的序列号 |
| 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 336 | 336 | ||
| @@ -348,7 +348,7 @@ static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf) | @@ -348,7 +348,7 @@ static int Uart_DEV1_RecvDeal_audio_NextSong(char *getbuf) | ||
| 348 | **********/ | 348 | **********/ |
| 349 | static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf) | 349 | static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf) |
| 350 | { | 350 | { |
| 351 | - USER_LOG_INFO("获取音乐列表\n"); | 351 | + JZSDK_LOG_INFO("获取音乐列表\n"); |
| 352 | //获取帧的序列号 | 352 | //获取帧的序列号 |
| 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 354 | 354 | ||
| @@ -390,7 +390,7 @@ static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf) | @@ -390,7 +390,7 @@ static int Uart_DEV1_RecvDeal_audio_GetMusicList(char *getbuf) | ||
| 390 | **********/ | 390 | **********/ |
| 391 | static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf) | 391 | static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf) |
| 392 | { | 392 | { |
| 393 | - USER_LOG_INFO("强制关闭功放\n"); | 393 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 394 | //获取帧的序列号 | 394 | //获取帧的序列号 |
| 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 396 | 396 | ||
| @@ -408,7 +408,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf) | @@ -408,7 +408,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_stop(char *getbuf) | ||
| 408 | **********/ | 408 | **********/ |
| 409 | static int Uart_DEV1_RecvDeal_Amplifier_open(char *getbuf) | 409 | static int Uart_DEV1_RecvDeal_Amplifier_open(char *getbuf) |
| 410 | { | 410 | { |
| 411 | - USER_LOG_INFO("强制关闭功放\n"); | 411 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 412 | //获取帧的序列号 | 412 | //获取帧的序列号 |
| 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 414 | 414 | ||
| @@ -437,7 +437,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_auto() | @@ -437,7 +437,7 @@ static int Uart_DEV1_RecvDeal_Amplifier_auto() | ||
| 437 | **********/ | 437 | **********/ |
| 438 | static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf) | 438 | static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf) |
| 439 | { | 439 | { |
| 440 | - USER_LOG_INFO("调节音量\n"); | 440 | + JZSDK_LOG_INFO("调节音量\n"); |
| 441 | //获取帧的序列号 | 441 | //获取帧的序列号 |
| 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 443 | 443 | ||
| @@ -456,7 +456,7 @@ static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf) | @@ -456,7 +456,7 @@ static int Uart_DEV1_RecvDeal_SetVolume(char *getbuf) | ||
| 456 | **********/ | 456 | **********/ |
| 457 | static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf) | 457 | static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf) |
| 458 | { | 458 | { |
| 459 | - USER_LOG_INFO("查询音量\n"); | 459 | + JZSDK_LOG_INFO("查询音量\n"); |
| 460 | //获取帧的序列号 | 460 | //获取帧的序列号 |
| 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 462 | 462 | ||
| @@ -479,7 +479,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf) | @@ -479,7 +479,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_volume(char *getbuf) | ||
| 479 | static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf) | 479 | static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf) |
| 480 | { | 480 | { |
| 481 | //查询播放状态 | 481 | //查询播放状态 |
| 482 | - USER_LOG_INFO("查询播放状态\n"); | 482 | + JZSDK_LOG_INFO("查询播放状态\n"); |
| 483 | //获取帧的序列号 | 483 | //获取帧的序列号 |
| 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 485 | 485 | ||
| @@ -504,7 +504,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf) | @@ -504,7 +504,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_play(char *getbuf) | ||
| 504 | static int Uart_DEV1_RecvDeal_CheckStatus_gimbal(char *getbuf) | 504 | static int Uart_DEV1_RecvDeal_CheckStatus_gimbal(char *getbuf) |
| 505 | { | 505 | { |
| 506 | //查询云台角度 | 506 | //查询云台角度 |
| 507 | - USER_LOG_INFO("查询云台角度\n"); | 507 | + JZSDK_LOG_INFO("查询云台角度\n"); |
| 508 | //获取帧的序列号 | 508 | //获取帧的序列号 |
| 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 510 | 510 | ||
| @@ -540,7 +540,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | @@ -540,7 +540,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | ||
| 540 | static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | 540 | static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) |
| 541 | { | 541 | { |
| 542 | //查询播放文件名 | 542 | //查询播放文件名 |
| 543 | - USER_LOG_INFO("查询播放文件名\n"); | 543 | + JZSDK_LOG_INFO("查询播放文件名\n"); |
| 544 | //获取帧的序列号 | 544 | //获取帧的序列号 |
| 545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 546 | 546 | ||
| @@ -549,7 +549,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -549,7 +549,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 549 | int MusicName_Len; | 549 | int MusicName_Len; |
| 550 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); | 550 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); |
| 551 | 551 | ||
| 552 | - USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); | 552 | + JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); |
| 553 | 553 | ||
| 554 | //回复操作成功 | 554 | //回复操作成功 |
| 555 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); | 555 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); |
| @@ -566,7 +566,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -566,7 +566,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 566 | static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | 566 | static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) |
| 567 | { | 567 | { |
| 568 | //查询软件版本号 | 568 | //查询软件版本号 |
| 569 | - USER_LOG_INFO("查询软件版本号\n"); | 569 | + JZSDK_LOG_INFO("查询软件版本号\n"); |
| 570 | //获取帧的序列号 | 570 | //获取帧的序列号 |
| 571 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 571 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 572 | 572 | ||
| @@ -577,7 +577,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -577,7 +577,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 577 | 577 | ||
| 578 | //1、获取版本号 | 578 | //1、获取版本号 |
| 579 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); | 579 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); |
| 580 | - USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); | 580 | + JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); |
| 581 | 581 | ||
| 582 | //回复操作成功 | 582 | //回复操作成功 |
| 583 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); | 583 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); |
| @@ -594,7 +594,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -594,7 +594,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 594 | static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | 594 | static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) |
| 595 | { | 595 | { |
| 596 | //查询是否打开循环 | 596 | //查询是否打开循环 |
| 597 | - USER_LOG_INFO("查询是否打开循环\n"); | 597 | + JZSDK_LOG_INFO("查询是否打开循环\n"); |
| 598 | //获取帧的序列号 | 598 | //获取帧的序列号 |
| 599 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 599 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 600 | 600 | ||
| @@ -602,7 +602,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -602,7 +602,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 602 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); | 602 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); |
| 603 | if (LoopStatus < 0) | 603 | if (LoopStatus < 0) |
| 604 | { | 604 | { |
| 605 | - USER_LOG_INFO("循环状态获取失败"); | 605 | + JZSDK_LOG_INFO("循环状态获取失败"); |
| 606 | return -1; | 606 | return -1; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| @@ -621,7 +621,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -621,7 +621,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 621 | static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | 621 | static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) |
| 622 | { | 622 | { |
| 623 | //查询音色 | 623 | //查询音色 |
| 624 | - USER_LOG_INFO("查询音色\n"); | 624 | + JZSDK_LOG_INFO("查询音色\n"); |
| 625 | //获取帧的序列号 | 625 | //获取帧的序列号 |
| 626 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 626 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 627 | 627 | ||
| @@ -629,7 +629,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -629,7 +629,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 629 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); | 629 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); |
| 630 | if (TTS_tone < 0) | 630 | if (TTS_tone < 0) |
| 631 | { | 631 | { |
| 632 | - USER_LOG_INFO("音色获取失败"); | 632 | + JZSDK_LOG_INFO("音色获取失败"); |
| 633 | return -1; | 633 | return -1; |
| 634 | } | 634 | } |
| 635 | 635 | ||
| @@ -649,7 +649,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -649,7 +649,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 649 | static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | 649 | static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) |
| 650 | { | 650 | { |
| 651 | //查询语速 | 651 | //查询语速 |
| 652 | - USER_LOG_INFO("查询语速\n"); | 652 | + JZSDK_LOG_INFO("查询语速\n"); |
| 653 | //获取帧的序列号 | 653 | //获取帧的序列号 |
| 654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 655 | 655 | ||
| @@ -657,7 +657,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -657,7 +657,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 657 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); | 657 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); |
| 658 | if (TTS_speed < 0) | 658 | if (TTS_speed < 0) |
| 659 | { | 659 | { |
| 660 | - USER_LOG_INFO("语速获取失败"); | 660 | + JZSDK_LOG_INFO("语速获取失败"); |
| 661 | return -1; | 661 | return -1; |
| 662 | } | 662 | } |
| 663 | 663 | ||
| @@ -678,7 +678,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -678,7 +678,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 678 | **********/ | 678 | **********/ |
| 679 | static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf) | 679 | static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf) |
| 680 | { | 680 | { |
| 681 | - USER_LOG_INFO("开启关闭循环\n"); | 681 | + JZSDK_LOG_INFO("开启关闭循环\n"); |
| 682 | //获取帧的序列号 | 682 | //获取帧的序列号 |
| 683 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 683 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 684 | 684 | ||
| @@ -708,7 +708,7 @@ static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf) | @@ -708,7 +708,7 @@ static int Uart_DEV1_RecvDeal_PlayLoop(char *getbuf) | ||
| 708 | **********/ | 708 | **********/ |
| 709 | static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf) | 709 | static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf) |
| 710 | { | 710 | { |
| 711 | - USER_LOG_INFO("删除音频操作\n"); | 711 | + JZSDK_LOG_INFO("删除音频操作\n"); |
| 712 | //获取帧的序列号 | 712 | //获取帧的序列号 |
| 713 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 713 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 714 | 714 | ||
| @@ -741,7 +741,7 @@ static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf) | @@ -741,7 +741,7 @@ static int Uart_DEV1_RecvDeal_Delete_Audio(char *getbuf) | ||
| 741 | **********/ | 741 | **********/ |
| 742 | static int Uart_DEV1_RecvDeal_Delete_VoiceRecord(char *getbuf) | 742 | static int Uart_DEV1_RecvDeal_Delete_VoiceRecord(char *getbuf) |
| 743 | { | 743 | { |
| 744 | - USER_LOG_INFO("删除录音操作\n"); | 744 | + JZSDK_LOG_INFO("删除录音操作\n"); |
| 745 | //获取帧的序列号 | 745 | //获取帧的序列号 |
| 746 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 746 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 747 | 747 | ||
| @@ -783,7 +783,7 @@ static int Uart_DEV1_RecvDeal_Delete_VideoRecord() | @@ -783,7 +783,7 @@ static int Uart_DEV1_RecvDeal_Delete_VideoRecord() | ||
| 783 | **********/ | 783 | **********/ |
| 784 | static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf) | 784 | static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf) |
| 785 | { | 785 | { |
| 786 | - USER_LOG_INFO("tts设置音色\n"); | 786 | + JZSDK_LOG_INFO("tts设置音色\n"); |
| 787 | //获取帧的序列号 | 787 | //获取帧的序列号 |
| 788 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 788 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 789 | 789 | ||
| @@ -811,16 +811,16 @@ static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf) | @@ -811,16 +811,16 @@ static int Uart_DEV1_RecvDeal_TTS_SetTone(char *getbuf) | ||
| 811 | **********/ | 811 | **********/ |
| 812 | static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf) | 812 | static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf) |
| 813 | { | 813 | { |
| 814 | - USER_LOG_INFO("设置语速\n"); | 814 | + JZSDK_LOG_INFO("设置语速\n"); |
| 815 | //获取帧的序列号 | 815 | //获取帧的序列号 |
| 816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 817 | 817 | ||
| 818 | //1、从帧数据从获取语速 | 818 | //1、从帧数据从获取语速 |
| 819 | int speed = (int)getbuf[9]; | 819 | int speed = (int)getbuf[9]; |
| 820 | - USER_LOG_INFO("获取的语速为:%d",speed); | 820 | + JZSDK_LOG_INFO("获取的语速为:%d",speed); |
| 821 | if (speed > 100 || speed < 0) | 821 | if (speed > 100 || speed < 0) |
| 822 | { | 822 | { |
| 823 | - USER_LOG_INFO("语速超出范围\n"); | 823 | + JZSDK_LOG_INFO("语速超出范围\n"); |
| 824 | 824 | ||
| 825 | //回复操作失败 | 825 | //回复操作失败 |
| 826 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); | 826 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); |
| @@ -851,7 +851,7 @@ static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf) | @@ -851,7 +851,7 @@ static int Uart_DEV1_RecvDeal_TTS_SetSpeed(char *getbuf) | ||
| 851 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 | 851 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 |
| 852 | static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf) | 852 | static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf) |
| 853 | { | 853 | { |
| 854 | - USER_LOG_INFO("tts开始传输"); | 854 | + JZSDK_LOG_INFO("tts开始传输"); |
| 855 | //获取帧的序列号 | 855 | //获取帧的序列号 |
| 856 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 856 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 857 | 857 | ||
| @@ -875,7 +875,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf) | @@ -875,7 +875,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_start(char *getbuf) | ||
| 875 | **********/ | 875 | **********/ |
| 876 | static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | 876 | static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) |
| 877 | { | 877 | { |
| 878 | - USER_LOG_INFO("tts传输中"); | 878 | + JZSDK_LOG_INFO("tts传输中"); |
| 879 | 879 | ||
| 880 | if (TTS_Recv_buffer_length+len < 1000) | 880 | if (TTS_Recv_buffer_length+len < 1000) |
| 881 | { | 881 | { |
| @@ -887,7 +887,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -887,7 +887,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 887 | } | 887 | } |
| 888 | else | 888 | else |
| 889 | { | 889 | { |
| 890 | - USER_LOG_ERROR("TTS字数超出1000字节"); | 890 | + JZSDK_LOG_ERROR("TTS字数超出1000字节"); |
| 891 | } | 891 | } |
| 892 | } | 892 | } |
| 893 | 893 | ||
| @@ -899,13 +899,13 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -899,13 +899,13 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 899 | **********/ | 899 | **********/ |
| 900 | static int Uart_DEV1_RecvDeal_TTS_Trans_stop(char *getbuf) | 900 | static int Uart_DEV1_RecvDeal_TTS_Trans_stop(char *getbuf) |
| 901 | { | 901 | { |
| 902 | - USER_LOG_INFO("tts传输结束"); | 902 | + JZSDK_LOG_INFO("tts传输结束"); |
| 903 | //获取帧的序列号 | 903 | //获取帧的序列号 |
| 904 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 904 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 905 | 905 | ||
| 906 | 906 | ||
| 907 | //1、打印一次TTS文本 | 907 | //1、打印一次TTS文本 |
| 908 | - USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer); | 908 | + JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer); |
| 909 | 909 | ||
| 910 | //2、播放TTS | 910 | //2、播放TTS |
| 911 | JZsdk_Uart_TTS_Play(UART_DEV_1, TTS_Recv_buffer, TTS_Recv_buffer_length); | 911 | 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) | @@ -923,7 +923,7 @@ static int Uart_DEV1_RecvDeal_TTS_Trans_stop(char *getbuf) | ||
| 923 | **********/ | 923 | **********/ |
| 924 | static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf) | 924 | static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf) |
| 925 | { | 925 | { |
| 926 | - USER_LOG_INFO("打开opus传输\n"); | 926 | + JZSDK_LOG_INFO("打开opus传输\n"); |
| 927 | //获取帧的序列号 | 927 | //获取帧的序列号 |
| 928 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 928 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 929 | 929 | ||
| @@ -940,7 +940,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf) | @@ -940,7 +940,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_start(char *getbuf) | ||
| 940 | //3、修改接收模式为传输opus | 940 | //3、修改接收模式为传输opus |
| 941 | JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); | 941 | JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); |
| 942 | 942 | ||
| 943 | - USER_LOG_INFO("已完成打开opus传输处理\n"); | 943 | + JZSDK_LOG_INFO("已完成打开opus传输处理\n"); |
| 944 | 944 | ||
| 945 | //回复操作成功 | 945 | //回复操作成功 |
| 946 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); | 946 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); |
| @@ -955,7 +955,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -955,7 +955,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 955 | { | 955 | { |
| 956 | JZsdk_Uart_SaveOpusTrans(SaveData,size); | 956 | JZsdk_Uart_SaveOpusTrans(SaveData,size); |
| 957 | 957 | ||
| 958 | - USER_LOG_INFO("已完成opus传输保存处理\n"); | 958 | + JZSDK_LOG_INFO("已完成opus传输保存处理\n"); |
| 959 | } | 959 | } |
| 960 | /********* | 960 | /********* |
| 961 | * | 961 | * |
| @@ -965,13 +965,13 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -965,13 +965,13 @@ static int Uart_DEV1_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 965 | **********/ | 965 | **********/ |
| 966 | static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf) | 966 | static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf) |
| 967 | { | 967 | { |
| 968 | - USER_LOG_INFO("结束opus传输\n"); | 968 | + JZSDK_LOG_INFO("结束opus传输\n"); |
| 969 | //获取帧的序列号 | 969 | //获取帧的序列号 |
| 970 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 970 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 971 | 971 | ||
| 972 | JZsdk_Uart_SaveOpusStop(); | 972 | JZsdk_Uart_SaveOpusStop(); |
| 973 | 973 | ||
| 974 | - USER_LOG_INFO("结束opus传输处理\n"); | 974 | + JZSDK_LOG_INFO("结束opus传输处理\n"); |
| 975 | 975 | ||
| 976 | //回复操作成功 | 976 | //回复操作成功 |
| 977 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); | 977 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_1, FrameSequence); |
| @@ -984,7 +984,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf) | @@ -984,7 +984,7 @@ static int Uart_DEV1_RecvDeal_OpusTrans_stop(char *getbuf) | ||
| 984 | **********/ | 984 | **********/ |
| 985 | static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf) | 985 | static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf) |
| 986 | { | 986 | { |
| 987 | - USER_LOG_INFO("opus播放\n"); | 987 | + JZSDK_LOG_INFO("opus播放\n"); |
| 988 | //获取帧的序列号 | 988 | //获取帧的序列号 |
| 989 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 989 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 990 | 990 | ||
| @@ -1004,7 +1004,7 @@ static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf) | @@ -1004,7 +1004,7 @@ static int Uart_DEV1_RecvDeal_OpusPlay(char *getbuf) | ||
| 1004 | **********/ | 1004 | **********/ |
| 1005 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | 1005 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) |
| 1006 | { | 1006 | { |
| 1007 | - USER_LOG_INFO("开启opus实时喊话功能\n"); | 1007 | + JZSDK_LOG_INFO("开启opus实时喊话功能\n"); |
| 1008 | //获取帧的序列号 | 1008 | //获取帧的序列号 |
| 1009 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1009 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1010 | 1010 | ||
| @@ -1039,7 +1039,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | @@ -1039,7 +1039,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | ||
| 1039 | **********/ | 1039 | **********/ |
| 1040 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) | 1040 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) |
| 1041 | { | 1041 | { |
| 1042 | - USER_LOG_INFO("opus语音传输中\n"); | 1042 | + JZSDK_LOG_INFO("opus语音传输中\n"); |
| 1043 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); | 1043 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); |
| 1044 | 1044 | ||
| 1045 | } | 1045 | } |
| @@ -1051,7 +1051,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int | @@ -1051,7 +1051,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int | ||
| 1051 | **********/ | 1051 | **********/ |
| 1052 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | 1052 | static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) |
| 1053 | { | 1053 | { |
| 1054 | - USER_LOG_INFO("关闭opus实时喊话功能\n"); | 1054 | + JZSDK_LOG_INFO("关闭opus实时喊话功能\n"); |
| 1055 | //获取帧的序列号 | 1055 | //获取帧的序列号 |
| 1056 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1056 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1057 | 1057 | ||
| @@ -1081,7 +1081,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | @@ -1081,7 +1081,7 @@ static int Uart_DEV1_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | ||
| 1081 | **********/ | 1081 | **********/ |
| 1082 | static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) | 1082 | static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) |
| 1083 | { | 1083 | { |
| 1084 | - USER_LOG_INFO("云台俯仰控制\n"); | 1084 | + JZSDK_LOG_INFO("云台俯仰控制\n"); |
| 1085 | //获取帧的序列号 | 1085 | //获取帧的序列号 |
| 1086 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1086 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1087 | 1087 | ||
| @@ -1102,13 +1102,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1102,13 +1102,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1102 | } | 1102 | } |
| 1103 | else | 1103 | else |
| 1104 | { | 1104 | { |
| 1105 | - USER_LOG_INFO("云台输入角度符号错误,无法正常控制"); | 1105 | + JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制"); |
| 1106 | //回复操作失败 | 1106 | //回复操作失败 |
| 1107 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); | 1107 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); |
| 1108 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1108 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1109 | } | 1109 | } |
| 1110 | 1110 | ||
| 1111 | - USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle); | 1111 | + JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle); |
| 1112 | 1112 | ||
| 1113 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_1, Gimbal_angle); | 1113 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_1, Gimbal_angle); |
| 1114 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 1114 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -1131,7 +1131,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1131,7 +1131,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1131 | **********/ | 1131 | **********/ |
| 1132 | static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | 1132 | static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) |
| 1133 | { | 1133 | { |
| 1134 | - USER_LOG_INFO("云台俯仰微调角度\n"); | 1134 | + JZSDK_LOG_INFO("云台俯仰微调角度\n"); |
| 1135 | //获取帧的序列号 | 1135 | //获取帧的序列号 |
| 1136 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1136 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1137 | 1137 | ||
| @@ -1139,7 +1139,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1139,7 +1139,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1139 | int Gimbal_signal = getbuf[9]; | 1139 | int Gimbal_signal = getbuf[9]; |
| 1140 | 1140 | ||
| 1141 | //2、通过云台控制帧 获取云台角度绝对值 | 1141 | //2、通过云台控制帧 获取云台角度绝对值 |
| 1142 | - int Gimbal_angle = ((int)getbuf[10]) ; | 1142 | + int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1143 | 1143 | ||
| 1144 | //3、拼接得到云台值 | 1144 | //3、拼接得到云台值 |
| 1145 | if (Gimbal_signal == 0x00) | 1145 | if (Gimbal_signal == 0x00) |
| @@ -1152,13 +1152,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1152,13 +1152,13 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1152 | } | 1152 | } |
| 1153 | else | 1153 | else |
| 1154 | { | 1154 | { |
| 1155 | - USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); | 1155 | + JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); |
| 1156 | //回复操作失败 | 1156 | //回复操作失败 |
| 1157 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); | 1157 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, FrameSequence); |
| 1158 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1158 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1159 | } | 1159 | } |
| 1160 | 1160 | ||
| 1161 | - USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); | 1161 | + JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); |
| 1162 | 1162 | ||
| 1163 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_1, FrameSequence ,Gimbal_angle); | 1163 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_1, FrameSequence ,Gimbal_angle); |
| 1164 | 1164 | ||
| @@ -1179,7 +1179,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1179,7 +1179,7 @@ static int Uart_DEV1_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1179 | **********/ | 1179 | **********/ |
| 1180 | static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf) | 1180 | static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf) |
| 1181 | { | 1181 | { |
| 1182 | - USER_LOG_INFO("设置爆闪频率\n"); | 1182 | + JZSDK_LOG_INFO("设置爆闪频率\n"); |
| 1183 | //获取帧的序列号 | 1183 | //获取帧的序列号 |
| 1184 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1184 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1185 | 1185 | ||
| @@ -1206,7 +1206,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf) | @@ -1206,7 +1206,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SetFrequency(char *getbuf) | ||
| 1206 | **********/ | 1206 | **********/ |
| 1207 | static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf) | 1207 | static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf) |
| 1208 | { | 1208 | { |
| 1209 | - USER_LOG_INFO("设置灯光控制\n"); | 1209 | + JZSDK_LOG_INFO("设置灯光控制\n"); |
| 1210 | //获取帧的序列号 | 1210 | //获取帧的序列号 |
| 1211 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1211 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1212 | 1212 | ||
| @@ -1233,7 +1233,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf) | @@ -1233,7 +1233,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Control(char *getbuf) | ||
| 1233 | **********/ | 1233 | **********/ |
| 1234 | static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf) | 1234 | static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf) |
| 1235 | { | 1235 | { |
| 1236 | - USER_LOG_INFO("设置灯光亮度\n"); | 1236 | + JZSDK_LOG_INFO("设置灯光亮度\n"); |
| 1237 | //获取帧的序列号 | 1237 | //获取帧的序列号 |
| 1238 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1238 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1239 | 1239 | ||
| @@ -1261,7 +1261,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf) | @@ -1261,7 +1261,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_Lumen(char *getbuf) | ||
| 1261 | **********/ | 1261 | **********/ |
| 1262 | static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) | 1262 | static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) |
| 1263 | { | 1263 | { |
| 1264 | - USER_LOG_INFO("灯光属性查询\n"); | 1264 | + JZSDK_LOG_INFO("灯光属性查询\n"); |
| 1265 | //1、获取帧的序列号 | 1265 | //1、获取帧的序列号 |
| 1266 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1266 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1267 | 1267 | ||
| @@ -1277,7 +1277,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf | @@ -1277,7 +1277,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf | ||
| 1277 | **********/ | 1277 | **********/ |
| 1278 | static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | 1278 | static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) |
| 1279 | { | 1279 | { |
| 1280 | - USER_LOG_INFO("探照灯温度查询\n"); | 1280 | + JZSDK_LOG_INFO("探照灯温度查询\n"); |
| 1281 | //1、获取帧的序列号 | 1281 | //1、获取帧的序列号 |
| 1282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1283 | 1283 | ||
| @@ -1292,7 +1292,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | @@ -1292,7 +1292,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | ||
| 1292 | **********/ | 1292 | **********/ |
| 1293 | static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | 1293 | static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) |
| 1294 | { | 1294 | { |
| 1295 | - USER_LOG_INFO("消息订阅控制\n"); | 1295 | + JZSDK_LOG_INFO("消息订阅控制\n"); |
| 1296 | //获取帧的序列号 | 1296 | //获取帧的序列号 |
| 1297 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1297 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1298 | 1298 | ||
| @@ -1312,6 +1312,55 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1312,6 +1312,55 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1312 | } | 1312 | } |
| 1313 | } | 1313 | } |
| 1314 | 1314 | ||
| 1315 | +/********* | ||
| 1316 | + * | ||
| 1317 | + * 查询产品序列号 | ||
| 1318 | + * | ||
| 1319 | +**********/ | ||
| 1320 | +static int Uart_DEV1_RecvDeal_CheckStatus_SerialNumber(char *getbuf) | ||
| 1321 | +{ | ||
| 1322 | + JZSDK_LOG_INFO("消息订阅控制\n"); | ||
| 1323 | + //获取帧的序列号 | ||
| 1324 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1325 | + | ||
| 1326 | + JZsdk_Uart_CheckStatus_SerialNumber(UART_DEV_1, FrameSequence); | ||
| 1327 | + | ||
| 1328 | +} | ||
| 1329 | + | ||
| 1330 | +/********* | ||
| 1331 | + * | ||
| 1332 | + * 对外供电开关 | ||
| 1333 | + * | ||
| 1334 | +**********/ | ||
| 1335 | +static int Uart_DEV1_RecvDeal_OutPutPower_Control(char *getbuf) | ||
| 1336 | +{ | ||
| 1337 | + printf("对外电源控制\n"); | ||
| 1338 | + //获取帧的序列号 | ||
| 1339 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1340 | + | ||
| 1341 | + //获取控制值 | ||
| 1342 | + int Value = getbuf[9]; | ||
| 1343 | + | ||
| 1344 | + //控制 | ||
| 1345 | + JZsdk_Uart_OutPutPower_Control(UART_DEV_1, FrameSequence, Value); | ||
| 1346 | +} | ||
| 1347 | + | ||
| 1348 | +/********* | ||
| 1349 | + * | ||
| 1350 | + * 对外电源查询 | ||
| 1351 | + * | ||
| 1352 | +**********/ | ||
| 1353 | +static int Uart_DEV1_RecvDeal_Checkstatus_OutPutPower(char *getbuf) | ||
| 1354 | +{ | ||
| 1355 | + printf("对外电源查询\n"); | ||
| 1356 | + | ||
| 1357 | + //获取帧的序列号 | ||
| 1358 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1359 | + | ||
| 1360 | + //获取本地数值 | ||
| 1361 | + JZsdk_Uart_Checkstatus_OutPutPower(UART_DEV_1, FrameSequence); | ||
| 1362 | +} | ||
| 1363 | + | ||
| 1315 | /******************************************************************************************************************************* | 1364 | /******************************************************************************************************************************* |
| 1316 | * | 1365 | * |
| 1317 | * 警灯部分 | 1366 | * 警灯部分 |
| @@ -1324,7 +1373,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1324,7 +1373,7 @@ static int Uart_DEV1_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1324 | **********/ | 1373 | **********/ |
| 1325 | static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf) | 1374 | static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf) |
| 1326 | { | 1375 | { |
| 1327 | - USER_LOG_INFO("警灯模式控制\n"); | 1376 | + JZSDK_LOG_INFO("警灯模式控制\n"); |
| 1328 | //获取帧的序列号 | 1377 | //获取帧的序列号 |
| 1329 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1378 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1330 | 1379 | ||
| @@ -1352,7 +1401,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf) | @@ -1352,7 +1401,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_ModeControl(char *getbuf) | ||
| 1352 | **********/ | 1401 | **********/ |
| 1353 | static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf) | 1402 | static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf) |
| 1354 | { | 1403 | { |
| 1355 | - USER_LOG_INFO("警灯颜色选择\n"); | 1404 | + JZSDK_LOG_INFO("警灯颜色选择\n"); |
| 1356 | //获取帧的序列号 | 1405 | //获取帧的序列号 |
| 1357 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1406 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1358 | 1407 | ||
| @@ -1380,7 +1429,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf) | @@ -1380,7 +1429,7 @@ static int Uart_DEV1_RecvDeal_WarningLight_SetColor(char *getbuf) | ||
| 1380 | **********/ | 1429 | **********/ |
| 1381 | static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | 1430 | static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) |
| 1382 | { | 1431 | { |
| 1383 | - USER_LOG_INFO("警灯状态查询\n"); | 1432 | + JZSDK_LOG_INFO("警灯状态查询\n"); |
| 1384 | //1、获取帧的序列号 | 1433 | //1、获取帧的序列号 |
| 1385 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1434 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1386 | 1435 | ||
| @@ -1396,7 +1445,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | @@ -1396,7 +1445,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | ||
| 1396 | **********/ | 1445 | **********/ |
| 1397 | static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | 1446 | static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) |
| 1398 | { | 1447 | { |
| 1399 | - USER_LOG_INFO("警灯颜色查询\n"); | 1448 | + JZSDK_LOG_INFO("警灯颜色查询\n"); |
| 1400 | //1、获取帧的序列号 | 1449 | //1、获取帧的序列号 |
| 1401 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1450 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1402 | 1451 | ||
| @@ -1435,7 +1484,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | @@ -1435,7 +1484,7 @@ static int Uart_DEV1_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | ||
| 1435 | **********/ | 1484 | **********/ |
| 1436 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | 1485 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) |
| 1437 | { | 1486 | { |
| 1438 | - USER_LOG_INFO("收到灯光频率\n"); | 1487 | + JZSDK_LOG_INFO("收到灯光频率\n"); |
| 1439 | //获取帧的序列号 | 1488 | //获取帧的序列号 |
| 1440 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1489 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1441 | 1490 | ||
| @@ -1453,7 +1502,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | @@ -1453,7 +1502,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | ||
| 1453 | **********/ | 1502 | **********/ |
| 1454 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | 1503 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf) |
| 1455 | { | 1504 | { |
| 1456 | - USER_LOG_INFO("收到灯光模式\n"); | 1505 | + JZSDK_LOG_INFO("收到灯光模式\n"); |
| 1457 | //获取帧的序列号 | 1506 | //获取帧的序列号 |
| 1458 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1507 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1459 | 1508 | ||
| @@ -1471,7 +1520,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | @@ -1471,7 +1520,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | ||
| 1471 | **********/ | 1520 | **********/ |
| 1472 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | 1521 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) |
| 1473 | { | 1522 | { |
| 1474 | - USER_LOG_INFO("收到灯光亮度\n"); | 1523 | + JZSDK_LOG_INFO("收到灯光亮度\n"); |
| 1475 | //获取帧的序列号 | 1524 | //获取帧的序列号 |
| 1476 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1525 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1477 | 1526 | ||
| @@ -1490,7 +1539,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | @@ -1490,7 +1539,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | ||
| 1490 | **********/ | 1539 | **********/ |
| 1491 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | 1540 | static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) |
| 1492 | { | 1541 | { |
| 1493 | - USER_LOG_INFO("收到探照灯温度\n"); | 1542 | + JZSDK_LOG_INFO("收到探照灯温度\n"); |
| 1494 | //获取帧的序列号 | 1543 | //获取帧的序列号 |
| 1495 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1544 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1496 | 1545 | ||
| @@ -1509,7 +1558,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | @@ -1509,7 +1558,7 @@ static int Uart_DEV1_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | ||
| 1509 | **********/ | 1558 | **********/ |
| 1510 | static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | 1559 | static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf) |
| 1511 | { | 1560 | { |
| 1512 | - USER_LOG_INFO("收到云台俯仰\n"); | 1561 | + JZSDK_LOG_INFO("收到云台俯仰\n"); |
| 1513 | //获取帧的序列号 | 1562 | //获取帧的序列号 |
| 1514 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1563 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1515 | 1564 | ||
| @@ -1540,7 +1589,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | @@ -1540,7 +1589,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | ||
| 1540 | **********/ | 1589 | **********/ |
| 1541 | static int Uart_DEV1_RecvDeal_ObtainGimbal_Yaw(char *getbuf) | 1590 | static int Uart_DEV1_RecvDeal_ObtainGimbal_Yaw(char *getbuf) |
| 1542 | { | 1591 | { |
| 1543 | - USER_LOG_INFO("收到云台航向\n"); | 1592 | + JZSDK_LOG_INFO("收到云台航向\n"); |
| 1544 | //获取帧的序列号 | 1593 | //获取帧的序列号 |
| 1545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1594 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1546 | 1595 | ||
| @@ -1578,7 +1627,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1578,7 +1627,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1578 | int signal = getbuf[9]; | 1627 | int signal = getbuf[9]; |
| 1579 | 1628 | ||
| 1580 | //2、获取云台角度绝对值 | 1629 | //2、获取云台角度绝对值 |
| 1581 | - int pitch = (int)getbuf[10] ; | 1630 | + int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1582 | 1631 | ||
| 1583 | //3、拼接得到云台值 | 1632 | //3、拼接得到云台值 |
| 1584 | if (signal == 0x00) | 1633 | if (signal == 0x00) |
| @@ -1600,7 +1649,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1600,7 +1649,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1600 | **********/ | 1649 | **********/ |
| 1601 | static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf) | 1650 | static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf) |
| 1602 | { | 1651 | { |
| 1603 | - USER_LOG_INFO("收到警灯状态\n"); | 1652 | + JZSDK_LOG_INFO("收到警灯状态\n"); |
| 1604 | //获取帧的序列号 | 1653 | //获取帧的序列号 |
| 1605 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1606 | 1655 | ||
| @@ -1619,7 +1668,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf) | @@ -1619,7 +1668,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Status(char *getbuf) | ||
| 1619 | **********/ | 1668 | **********/ |
| 1620 | static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf) | 1669 | static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf) |
| 1621 | { | 1670 | { |
| 1622 | - USER_LOG_INFO("收到警灯颜色\n"); | 1671 | + JZSDK_LOG_INFO("收到警灯颜色\n"); |
| 1623 | //获取帧的序列号 | 1672 | //获取帧的序列号 |
| 1624 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1673 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1625 | 1674 | ||
| @@ -1638,7 +1687,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf) | @@ -1638,7 +1687,7 @@ static int Uart_DEV1_RecvDeal_ObtainWaringlight_Color(char *getbuf) | ||
| 1638 | **********/ | 1687 | **********/ |
| 1639 | static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf) | 1688 | static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf) |
| 1640 | { | 1689 | { |
| 1641 | - USER_LOG_INFO("收到产品序列号\n"); | 1690 | + JZSDK_LOG_INFO("收到产品序列号\n"); |
| 1642 | //获取帧的序列号 | 1691 | //获取帧的序列号 |
| 1643 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1692 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1644 | 1693 | ||
| @@ -1669,7 +1718,7 @@ static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf) | @@ -1669,7 +1718,7 @@ static int Uart_DEV1_RecvDeal_ObtainSerialNumber(char *getbuf) | ||
| 1669 | **********/ | 1718 | **********/ |
| 1670 | static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | 1719 | static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf) |
| 1671 | { | 1720 | { |
| 1672 | - USER_LOG_INFO("查询当前从设备名\n"); | 1721 | + JZSDK_LOG_INFO("查询当前从设备名\n"); |
| 1673 | 1722 | ||
| 1674 | //获取帧的序列号 | 1723 | //获取帧的序列号 |
| 1675 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1724 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1698,7 +1747,7 @@ static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | @@ -1698,7 +1747,7 @@ static int Uart_DEV1_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | ||
| 1698 | **********/ | 1747 | **********/ |
| 1699 | static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf) | 1748 | static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf) |
| 1700 | { | 1749 | { |
| 1701 | - USER_LOG_INFO("设置云台最大值最小值\n"); | 1750 | + JZSDK_LOG_INFO("设置云台最大值最小值\n"); |
| 1702 | //获取帧的序列号 | 1751 | //获取帧的序列号 |
| 1703 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1752 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1704 | 1753 | ||
| @@ -1725,7 +1774,7 @@ static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf) | @@ -1725,7 +1774,7 @@ static int Uart_DEV1_RecvDeal_SetGimbalRange(char *getbuf) | ||
| 1725 | **********/ | 1774 | **********/ |
| 1726 | static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf) | 1775 | static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf) |
| 1727 | { | 1776 | { |
| 1728 | - USER_LOG_INFO("设置云台联动\n"); | 1777 | + JZSDK_LOG_INFO("设置云台联动\n"); |
| 1729 | 1778 | ||
| 1730 | //获取帧的序列号 | 1779 | //获取帧的序列号 |
| 1731 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1780 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1745,7 +1794,7 @@ static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf) | @@ -1745,7 +1794,7 @@ static int Uart_DEV1_RecvDeal_GimbalLinkageControl(char *getbuf) | ||
| 1745 | **********/ | 1794 | **********/ |
| 1746 | static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | 1795 | static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) |
| 1747 | { | 1796 | { |
| 1748 | - USER_LOG_INFO("收到查询是否开启云台联动\n"); | 1797 | + JZSDK_LOG_INFO("收到查询是否开启云台联动\n"); |
| 1749 | 1798 | ||
| 1750 | //获取帧的序列号 | 1799 | //获取帧的序列号 |
| 1751 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1800 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1779,7 +1828,7 @@ static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | @@ -1779,7 +1828,7 @@ static int Uart_DEV1_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | ||
| 1779 | **********/ | 1828 | **********/ |
| 1780 | static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | 1829 | static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) |
| 1781 | { | 1830 | { |
| 1782 | - USER_LOG_INFO("收到从设备名\n"); | 1831 | + JZSDK_LOG_INFO("收到从设备名\n"); |
| 1783 | //获取帧的序列号 | 1832 | //获取帧的序列号 |
| 1784 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1833 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1785 | 1834 | ||
| @@ -1811,7 +1860,7 @@ static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | @@ -1811,7 +1860,7 @@ static int Uart_DEV1_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | ||
| 1811 | **********/ | 1860 | **********/ |
| 1812 | static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf) | 1861 | static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf) |
| 1813 | { | 1862 | { |
| 1814 | - USER_LOG_INFO("收到云台联动值\n"); | 1863 | + JZSDK_LOG_INFO("收到云台联动值\n"); |
| 1815 | //获取帧的序列号 | 1864 | //获取帧的序列号 |
| 1816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1865 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1817 | 1866 | ||
| @@ -1846,7 +1895,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf) | @@ -1846,7 +1895,7 @@ static int Uart_DEV1_RecvDeal_ObtainGimbalLinkage(char *getbuf) | ||
| 1846 | **********/ | 1895 | **********/ |
| 1847 | static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf) | 1896 | static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf) |
| 1848 | { | 1897 | { |
| 1849 | - USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); | 1898 | + JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); |
| 1850 | //无法正常获取帧的序列号 | 1899 | //无法正常获取帧的序列号 |
| 1851 | //回复操作失败 | 1900 | //回复操作失败 |
| 1852 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, 0x00); | 1901 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_1, 0x00); |
| @@ -1861,7 +1910,7 @@ static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf) | @@ -1861,7 +1910,7 @@ static int Uart_DEV1_RecvDeal_FrameErrorReply(char *getbuf) | ||
| 1861 | **********/ | 1910 | **********/ |
| 1862 | static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf) | 1911 | static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf) |
| 1863 | { | 1912 | { |
| 1864 | - USER_LOG_INFO("接受到操作成功\n"); | 1913 | + JZSDK_LOG_INFO("接受到操作成功\n"); |
| 1865 | } | 1914 | } |
| 1866 | 1915 | ||
| 1867 | /********* | 1916 | /********* |
| @@ -1872,7 +1921,7 @@ static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf) | @@ -1872,7 +1921,7 @@ static int Uart_DEV1_RecvDeal_OperationSuccessful(char *getbuf) | ||
| 1872 | **********/ | 1921 | **********/ |
| 1873 | static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf) | 1922 | static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf) |
| 1874 | { | 1923 | { |
| 1875 | - USER_LOG_INFO("接受到操作失败\n"); | 1924 | + JZSDK_LOG_INFO("接受到操作失败\n"); |
| 1876 | } | 1925 | } |
| 1877 | /******************************************************************************************************** | 1926 | /******************************************************************************************************** |
| 1878 | ********* ********| | 1927 | ********* ********| |
| @@ -1889,7 +1938,7 @@ static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf) | @@ -1889,7 +1938,7 @@ static int Uart_DEV1_RecvDeal_OperationFailed(char *getbuf) | ||
| 1889 | *********************************************************************************************************/ | 1938 | *********************************************************************************************************/ |
| 1890 | int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) | 1939 | int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) |
| 1891 | { | 1940 | { |
| 1892 | - USER_LOG_INFO("串口设备1号,接受到的模式为:%x",Receive_mode); | 1941 | + JZSDK_LOG_INFO("串口设备1号,接受到的模式为:%x",Receive_mode); |
| 1893 | switch (Receive_mode) | 1942 | switch (Receive_mode) |
| 1894 | { | 1943 | { |
| 1895 | /******************************************************************************************************************************* | 1944 | /******************************************************************************************************************************* |
| @@ -2197,10 +2246,21 @@ int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le | @@ -2197,10 +2246,21 @@ int Uart_DEV1_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le | ||
| 2197 | 2246 | ||
| 2198 | //序列号查询 | 2247 | //序列号查询 |
| 2199 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: | 2248 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: |
| 2249 | + Uart_DEV1_RecvDeal_CheckStatus_SerialNumber(getdata); | ||
| 2250 | + break; | ||
| 2251 | + | ||
| 2252 | + //向外供电开关 | ||
| 2253 | + case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL: | ||
| 2254 | + Uart_DEV1_RecvDeal_OutPutPower_Control(getdata); | ||
| 2255 | + break; | ||
| 2200 | 2256 | ||
| 2257 | + //查询向外供电情况 | ||
| 2258 | + case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER: | ||
| 2259 | + Uart_DEV1_RecvDeal_Checkstatus_OutPutPower(getdata); | ||
| 2201 | break; | 2260 | break; |
| 2202 | 2261 | ||
| 2203 | 2262 | ||
| 2263 | + | ||
| 2204 | /******************************************************************************************************************************* | 2264 | /******************************************************************************************************************************* |
| 2205 | * | 2265 | * |
| 2206 | * 5B类部分 | 2266 | * 5B类部分 |
| @@ -2588,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV1(unsigned char *getbuf, int len) | @@ -2588,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV1(unsigned char *getbuf, int len) | ||
| 2588 | * ****************/ | 2648 | * ****************/ |
| 2589 | int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value) | 2649 | int JZsdk_Uart_RecvDeal_Set_UART_DEV1_Receive_mode(int value) |
| 2590 | { | 2650 | { |
| 2591 | - USER_LOG_INFO("串口设备1号,二次修改接收模式%x\n",value); | 2651 | + JZSDK_LOG_INFO("串口设备1号,二次修改接收模式%x\n",value); |
| 2592 | UART_DEV1_Receive_mode = value; | 2652 | UART_DEV1_Receive_mode = value; |
| 2593 | return 0; | 2653 | return 0; |
| 2594 | } | 2654 | } |
| @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value); | @@ -39,7 +39,7 @@ int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value); | ||
| 39 | **********/ | 39 | **********/ |
| 40 | static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf) | 40 | static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf) |
| 41 | { | 41 | { |
| 42 | - USER_LOG_INFO("串口设备2号,连接成功"); | 42 | + JZSDK_LOG_INFO("串口设备2号,连接成功"); |
| 43 | //获取帧的序列号 | 43 | //获取帧的序列号 |
| 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 44 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 45 | 45 | ||
| @@ -67,7 +67,7 @@ static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf) | @@ -67,7 +67,7 @@ static int Uart_DEV2_RecvDeal_AskForConnect(char *getbuf) | ||
| 67 | **********/ | 67 | **********/ |
| 68 | static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf) | 68 | static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf) |
| 69 | { | 69 | { |
| 70 | - USER_LOG_INFO("开启MP2实时喊话功能\n"); | 70 | + JZSDK_LOG_INFO("开启MP2实时喊话功能\n"); |
| 71 | T_JZsdkReturnCode ret; | 71 | T_JZsdkReturnCode ret; |
| 72 | 72 | ||
| 73 | //获取帧的序列号 | 73 | //获取帧的序列号 |
| @@ -111,7 +111,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf) | @@ -111,7 +111,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_start(char *getbuf) | ||
| 111 | **********/ | 111 | **********/ |
| 112 | static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | 112 | static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) |
| 113 | { | 113 | { |
| 114 | - USER_LOG_INFO("MP2实时喊话传输中\n"); | 114 | + JZSDK_LOG_INFO("MP2实时喊话传输中\n"); |
| 115 | T_JZsdkReturnCode ret; | 115 | T_JZsdkReturnCode ret; |
| 116 | 116 | ||
| 117 | //传输数据接口 | 117 | //传输数据接口 |
| @@ -126,7 +126,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | @@ -126,7 +126,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_transmission(char *getdata, int len) | ||
| 126 | **********/ | 126 | **********/ |
| 127 | static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf) | 127 | static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf) |
| 128 | { | 128 | { |
| 129 | - USER_LOG_INFO("关闭MP2实时喊话功能\n"); | 129 | + JZSDK_LOG_INFO("关闭MP2实时喊话功能\n"); |
| 130 | T_JZsdkReturnCode ret; | 130 | T_JZsdkReturnCode ret; |
| 131 | 131 | ||
| 132 | //获取帧的序列号 | 132 | //获取帧的序列号 |
| @@ -157,7 +157,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf) | @@ -157,7 +157,7 @@ static int Uart_DEV2_RecvDeal_RealTimeMP2_stop(char *getbuf) | ||
| 157 | **********/ | 157 | **********/ |
| 158 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | 158 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) |
| 159 | { | 159 | { |
| 160 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 160 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 161 | //获取帧的序列号 | 161 | //获取帧的序列号 |
| 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 162 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 163 | 163 | ||
| @@ -168,7 +168,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -168,7 +168,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 168 | char FileName[1024]; | 168 | char FileName[1024]; |
| 169 | memset(FileName,0,1024); | 169 | memset(FileName,0,1024); |
| 170 | memcpy(FileName, &getbuf[9], FileNameLen); | 170 | memcpy(FileName, &getbuf[9], FileNameLen); |
| 171 | - USER_LOG_INFO("保存的文件名为%s",FileName); | 171 | + JZSDK_LOG_INFO("保存的文件名为%s",FileName); |
| 172 | 172 | ||
| 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); | 173 | T_JZsdkReturnCode ret = JZsdk_Uart_SaveAudioFileStart(FileName); |
| 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 174 | if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -192,7 +192,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | @@ -192,7 +192,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_start(char *getbuf, int len) | ||
| 192 | **********/ | 192 | **********/ |
| 193 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) | 193 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int len) |
| 194 | { | 194 | { |
| 195 | - USER_LOG_INFO("传输音频文件中\n"); | 195 | + JZSDK_LOG_INFO("传输音频文件中\n"); |
| 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); | 196 | JZsdk_Uart_SaveAudioFileTrans(getdata, len); |
| 197 | } | 197 | } |
| 198 | /********* | 198 | /********* |
| @@ -203,7 +203,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int | @@ -203,7 +203,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_transmission(char *getdata, int | ||
| 203 | **********/ | 203 | **********/ |
| 204 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | 204 | static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) |
| 205 | { | 205 | { |
| 206 | - USER_LOG_INFO("开始传输的音频文件保存\n"); | 206 | + JZSDK_LOG_INFO("开始传输的音频文件保存\n"); |
| 207 | //获取帧的序列号 | 207 | //获取帧的序列号 |
| 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 208 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 209 | 209 | ||
| @@ -223,7 +223,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | @@ -223,7 +223,7 @@ static int Uart_DEV2_RecvDeal_SaveAudioFileTrans_stop(char *getbuf) | ||
| 223 | static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) | 223 | static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) |
| 224 | { | 224 | { |
| 225 | T_JZsdkReturnCode ret; | 225 | T_JZsdkReturnCode ret; |
| 226 | - USER_LOG_INFO("播放指定音频\n"); | 226 | + JZSDK_LOG_INFO("播放指定音频\n"); |
| 227 | //获取帧的序列号 | 227 | //获取帧的序列号 |
| 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 228 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 229 | 229 | ||
| @@ -238,7 +238,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) | @@ -238,7 +238,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 238 | memset(music_name, 0, 256); | 238 | memset(music_name, 0, 256); |
| 239 | memcpy(music_name, &getbuf[9], datasize); | 239 | memcpy(music_name, &getbuf[9], datasize); |
| 240 | 240 | ||
| 241 | - USER_LOG_INFO("播放指定音频:%s\n",music_name); | 241 | + JZSDK_LOG_INFO("播放指定音频:%s\n",music_name); |
| 242 | 242 | ||
| 243 | ret = JZsdk_Uart_PlayMusic(UART_DEV_2, music_name, datasize); | 243 | ret = JZsdk_Uart_PlayMusic(UART_DEV_2, music_name, datasize); |
| 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 244 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -260,7 +260,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) | @@ -260,7 +260,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayFile(char *getbuf) | ||
| 260 | **********/ | 260 | **********/ |
| 261 | static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf) | 261 | static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf) |
| 262 | { | 262 | { |
| 263 | - USER_LOG_INFO("音频继续播放\n"); | 263 | + JZSDK_LOG_INFO("音频继续播放\n"); |
| 264 | //获取帧的序列号 | 264 | //获取帧的序列号 |
| 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 265 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 266 | 266 | ||
| @@ -277,7 +277,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf) | @@ -277,7 +277,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayContinue(char *getbuf) | ||
| 277 | **********/ | 277 | **********/ |
| 278 | static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf) | 278 | static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf) |
| 279 | { | 279 | { |
| 280 | - USER_LOG_INFO("音频暂停播放\n"); | 280 | + JZSDK_LOG_INFO("音频暂停播放\n"); |
| 281 | //获取帧的序列号 | 281 | //获取帧的序列号 |
| 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 283 | 283 | ||
| @@ -294,7 +294,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf) | @@ -294,7 +294,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayPause(char *getbuf) | ||
| 294 | **********/ | 294 | **********/ |
| 295 | static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf) | 295 | static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf) |
| 296 | { | 296 | { |
| 297 | - USER_LOG_INFO("音频停止播放\n"); | 297 | + JZSDK_LOG_INFO("音频停止播放\n"); |
| 298 | //获取帧的序列号 | 298 | //获取帧的序列号 |
| 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 299 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 300 | 300 | ||
| @@ -312,7 +312,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf) | @@ -312,7 +312,7 @@ static int Uart_DEV2_RecvDeal_audio_PlayStop(char *getbuf) | ||
| 312 | **********/ | 312 | **********/ |
| 313 | static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf) | 313 | static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf) |
| 314 | { | 314 | { |
| 315 | - USER_LOG_INFO("音频上一曲\n"); | 315 | + JZSDK_LOG_INFO("音频上一曲\n"); |
| 316 | //获取帧的序列号 | 316 | //获取帧的序列号 |
| 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 317 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 318 | 318 | ||
| @@ -330,7 +330,7 @@ static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf) | @@ -330,7 +330,7 @@ static int Uart_DEV2_RecvDeal_audio_LastSong(char *getbuf) | ||
| 330 | **********/ | 330 | **********/ |
| 331 | static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf) | 331 | static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf) |
| 332 | { | 332 | { |
| 333 | - USER_LOG_INFO("音频下一曲\n"); | 333 | + JZSDK_LOG_INFO("音频下一曲\n"); |
| 334 | //获取帧的序列号 | 334 | //获取帧的序列号 |
| 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 335 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 336 | 336 | ||
| @@ -348,7 +348,7 @@ static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf) | @@ -348,7 +348,7 @@ static int Uart_DEV2_RecvDeal_audio_NextSong(char *getbuf) | ||
| 348 | **********/ | 348 | **********/ |
| 349 | static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf) | 349 | static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf) |
| 350 | { | 350 | { |
| 351 | - USER_LOG_INFO("获取音乐列表\n"); | 351 | + JZSDK_LOG_INFO("获取音乐列表\n"); |
| 352 | //获取帧的序列号 | 352 | //获取帧的序列号 |
| 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 353 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 354 | 354 | ||
| @@ -390,7 +390,7 @@ static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf) | @@ -390,7 +390,7 @@ static int Uart_DEV2_RecvDeal_audio_GetMusicList(char *getbuf) | ||
| 390 | **********/ | 390 | **********/ |
| 391 | static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf) | 391 | static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf) |
| 392 | { | 392 | { |
| 393 | - USER_LOG_INFO("强制关闭功放\n"); | 393 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 394 | //获取帧的序列号 | 394 | //获取帧的序列号 |
| 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 395 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 396 | 396 | ||
| @@ -408,7 +408,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf) | @@ -408,7 +408,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_stop(char *getbuf) | ||
| 408 | **********/ | 408 | **********/ |
| 409 | static int Uart_DEV2_RecvDeal_Amplifier_open(char *getbuf) | 409 | static int Uart_DEV2_RecvDeal_Amplifier_open(char *getbuf) |
| 410 | { | 410 | { |
| 411 | - USER_LOG_INFO("强制关闭功放\n"); | 411 | + JZSDK_LOG_INFO("强制关闭功放\n"); |
| 412 | //获取帧的序列号 | 412 | //获取帧的序列号 |
| 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 413 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 414 | 414 | ||
| @@ -437,7 +437,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_auto() | @@ -437,7 +437,7 @@ static int Uart_DEV2_RecvDeal_Amplifier_auto() | ||
| 437 | **********/ | 437 | **********/ |
| 438 | static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf) | 438 | static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf) |
| 439 | { | 439 | { |
| 440 | - USER_LOG_INFO("调节音量\n"); | 440 | + JZSDK_LOG_INFO("调节音量\n"); |
| 441 | //获取帧的序列号 | 441 | //获取帧的序列号 |
| 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 442 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 443 | 443 | ||
| @@ -456,7 +456,7 @@ static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf) | @@ -456,7 +456,7 @@ static int Uart_DEV2_RecvDeal_SetVolume(char *getbuf) | ||
| 456 | **********/ | 456 | **********/ |
| 457 | static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf) | 457 | static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf) |
| 458 | { | 458 | { |
| 459 | - USER_LOG_INFO("查询音量\n"); | 459 | + JZSDK_LOG_INFO("查询音量\n"); |
| 460 | //获取帧的序列号 | 460 | //获取帧的序列号 |
| 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 461 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 462 | 462 | ||
| @@ -479,7 +479,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf) | @@ -479,7 +479,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_volume(char *getbuf) | ||
| 479 | static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf) | 479 | static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf) |
| 480 | { | 480 | { |
| 481 | //查询播放状态 | 481 | //查询播放状态 |
| 482 | - USER_LOG_INFO("查询播放状态\n"); | 482 | + JZSDK_LOG_INFO("查询播放状态\n"); |
| 483 | //获取帧的序列号 | 483 | //获取帧的序列号 |
| 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 484 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 485 | 485 | ||
| @@ -504,7 +504,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf) | @@ -504,7 +504,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_play(char *getbuf) | ||
| 504 | static int Uart_DEV2_RecvDeal_CheckStatus_gimbal(char *getbuf) | 504 | static int Uart_DEV2_RecvDeal_CheckStatus_gimbal(char *getbuf) |
| 505 | { | 505 | { |
| 506 | //查询云台角度 | 506 | //查询云台角度 |
| 507 | - USER_LOG_INFO("查询云台角度\n"); | 507 | + JZSDK_LOG_INFO("查询云台角度\n"); |
| 508 | //获取帧的序列号 | 508 | //获取帧的序列号 |
| 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 509 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 510 | 510 | ||
| @@ -540,7 +540,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | @@ -540,7 +540,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_GimbalFineTuning(char *getbuf) | ||
| 540 | static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | 540 | static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) |
| 541 | { | 541 | { |
| 542 | //查询播放文件名 | 542 | //查询播放文件名 |
| 543 | - USER_LOG_INFO("查询播放文件名\n"); | 543 | + JZSDK_LOG_INFO("查询播放文件名\n"); |
| 544 | //获取帧的序列号 | 544 | //获取帧的序列号 |
| 545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 545 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 546 | 546 | ||
| @@ -549,7 +549,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -549,7 +549,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 549 | int MusicName_Len; | 549 | int MusicName_Len; |
| 550 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); | 550 | JZsdk_Uart_CheckStatus_PlayFileName(MusicName, &MusicName_Len); |
| 551 | 551 | ||
| 552 | - USER_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); | 552 | + JZSDK_LOG_INFO("当前播放的是%s %d\n",MusicName, MusicName_Len); |
| 553 | 553 | ||
| 554 | //回复操作成功 | 554 | //回复操作成功 |
| 555 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); | 555 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); |
| @@ -566,7 +566,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | @@ -566,7 +566,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_PLayFileName(char *getbuf) | ||
| 566 | static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | 566 | static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) |
| 567 | { | 567 | { |
| 568 | //查询软件版本号 | 568 | //查询软件版本号 |
| 569 | - USER_LOG_INFO("查询软件版本号\n"); | 569 | + JZSDK_LOG_INFO("查询软件版本号\n"); |
| 570 | //获取帧的序列号 | 570 | //获取帧的序列号 |
| 571 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 571 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 572 | 572 | ||
| @@ -577,7 +577,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -577,7 +577,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 577 | 577 | ||
| 578 | //1、获取版本号 | 578 | //1、获取版本号 |
| 579 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); | 579 | JZsdk_Uart_CheckStatus_SoftwareVersion(&majorVersion, &minorVersion, &modifyVersion, &debugVersion); |
| 580 | - USER_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); | 580 | + JZSDK_LOG_INFO("当前的软件版本号为:%2x, %2x, %2x, %2x",majorVersion, minorVersion, modifyVersion, debugVersion); |
| 581 | 581 | ||
| 582 | //回复操作成功 | 582 | //回复操作成功 |
| 583 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); | 583 | //JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); |
| @@ -594,7 +594,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | @@ -594,7 +594,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SoftwareVersion(char *getbuf) | ||
| 594 | static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | 594 | static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) |
| 595 | { | 595 | { |
| 596 | //查询是否打开循环 | 596 | //查询是否打开循环 |
| 597 | - USER_LOG_INFO("查询是否打开循环\n"); | 597 | + JZSDK_LOG_INFO("查询是否打开循环\n"); |
| 598 | //获取帧的序列号 | 598 | //获取帧的序列号 |
| 599 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 599 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 600 | 600 | ||
| @@ -602,7 +602,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -602,7 +602,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 602 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); | 602 | int LoopStatus = JZsdk_Uart_CheckStatus_LoopPlay(); |
| 603 | if (LoopStatus < 0) | 603 | if (LoopStatus < 0) |
| 604 | { | 604 | { |
| 605 | - USER_LOG_INFO("循环状态获取失败"); | 605 | + JZSDK_LOG_INFO("循环状态获取失败"); |
| 606 | return -1; | 606 | return -1; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| @@ -621,7 +621,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | @@ -621,7 +621,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_LoopPlay(char *getbuf) | ||
| 621 | static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | 621 | static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) |
| 622 | { | 622 | { |
| 623 | //查询音色 | 623 | //查询音色 |
| 624 | - USER_LOG_INFO("查询音色\n"); | 624 | + JZSDK_LOG_INFO("查询音色\n"); |
| 625 | //获取帧的序列号 | 625 | //获取帧的序列号 |
| 626 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 626 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 627 | 627 | ||
| @@ -629,7 +629,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -629,7 +629,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 629 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); | 629 | int TTS_tone = JZsdk_Uart_CheckStatus_TTS_tone(); |
| 630 | if (TTS_tone < 0) | 630 | if (TTS_tone < 0) |
| 631 | { | 631 | { |
| 632 | - USER_LOG_INFO("音色获取失败"); | 632 | + JZSDK_LOG_INFO("音色获取失败"); |
| 633 | return -1; | 633 | return -1; |
| 634 | } | 634 | } |
| 635 | 635 | ||
| @@ -649,7 +649,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | @@ -649,7 +649,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_tone(char *getbuf) | ||
| 649 | static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | 649 | static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) |
| 650 | { | 650 | { |
| 651 | //查询语速 | 651 | //查询语速 |
| 652 | - USER_LOG_INFO("查询语速\n"); | 652 | + JZSDK_LOG_INFO("查询语速\n"); |
| 653 | //获取帧的序列号 | 653 | //获取帧的序列号 |
| 654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 655 | 655 | ||
| @@ -657,7 +657,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -657,7 +657,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 657 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); | 657 | int TTS_speed = JZsdk_Uart_CheckStatus_TTS_speed(); |
| 658 | if (TTS_speed < 0) | 658 | if (TTS_speed < 0) |
| 659 | { | 659 | { |
| 660 | - USER_LOG_INFO("语速获取失败"); | 660 | + JZSDK_LOG_INFO("语速获取失败"); |
| 661 | return -1; | 661 | return -1; |
| 662 | } | 662 | } |
| 663 | 663 | ||
| @@ -678,7 +678,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | @@ -678,7 +678,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_TTS_speed(char *getbuf) | ||
| 678 | **********/ | 678 | **********/ |
| 679 | static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf) | 679 | static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf) |
| 680 | { | 680 | { |
| 681 | - USER_LOG_INFO("开启关闭循环\n"); | 681 | + JZSDK_LOG_INFO("开启关闭循环\n"); |
| 682 | //获取帧的序列号 | 682 | //获取帧的序列号 |
| 683 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 683 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 684 | 684 | ||
| @@ -708,7 +708,7 @@ static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf) | @@ -708,7 +708,7 @@ static int Uart_DEV2_RecvDeal_PlayLoop(char *getbuf) | ||
| 708 | **********/ | 708 | **********/ |
| 709 | static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf) | 709 | static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf) |
| 710 | { | 710 | { |
| 711 | - USER_LOG_INFO("删除音频操作\n"); | 711 | + JZSDK_LOG_INFO("删除音频操作\n"); |
| 712 | //获取帧的序列号 | 712 | //获取帧的序列号 |
| 713 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 713 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 714 | 714 | ||
| @@ -741,7 +741,7 @@ static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf) | @@ -741,7 +741,7 @@ static int Uart_DEV2_RecvDeal_Delete_Audio(char *getbuf) | ||
| 741 | **********/ | 741 | **********/ |
| 742 | static int Uart_DEV2_RecvDeal_Delete_VoiceRecord(char *getbuf) | 742 | static int Uart_DEV2_RecvDeal_Delete_VoiceRecord(char *getbuf) |
| 743 | { | 743 | { |
| 744 | - USER_LOG_INFO("删除录音操作\n"); | 744 | + JZSDK_LOG_INFO("删除录音操作\n"); |
| 745 | //获取帧的序列号 | 745 | //获取帧的序列号 |
| 746 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 746 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 747 | 747 | ||
| @@ -783,7 +783,7 @@ static int Uart_DEV2_RecvDeal_Delete_VideoRecord() | @@ -783,7 +783,7 @@ static int Uart_DEV2_RecvDeal_Delete_VideoRecord() | ||
| 783 | **********/ | 783 | **********/ |
| 784 | static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf) | 784 | static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf) |
| 785 | { | 785 | { |
| 786 | - USER_LOG_INFO("tts设置音色\n"); | 786 | + JZSDK_LOG_INFO("tts设置音色\n"); |
| 787 | //获取帧的序列号 | 787 | //获取帧的序列号 |
| 788 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 788 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 789 | 789 | ||
| @@ -811,16 +811,16 @@ static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf) | @@ -811,16 +811,16 @@ static int Uart_DEV2_RecvDeal_TTS_SetTone(char *getbuf) | ||
| 811 | **********/ | 811 | **********/ |
| 812 | static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf) | 812 | static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf) |
| 813 | { | 813 | { |
| 814 | - USER_LOG_INFO("设置语速\n"); | 814 | + JZSDK_LOG_INFO("设置语速\n"); |
| 815 | //获取帧的序列号 | 815 | //获取帧的序列号 |
| 816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 816 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 817 | 817 | ||
| 818 | //1、从帧数据从获取语速 | 818 | //1、从帧数据从获取语速 |
| 819 | int speed = (int)getbuf[9]; | 819 | int speed = (int)getbuf[9]; |
| 820 | - USER_LOG_INFO("获取的语速为:%d",speed); | 820 | + JZSDK_LOG_INFO("获取的语速为:%d",speed); |
| 821 | if (speed > 100 || speed < 0) | 821 | if (speed > 100 || speed < 0) |
| 822 | { | 822 | { |
| 823 | - USER_LOG_INFO("语速超出范围\n"); | 823 | + JZSDK_LOG_INFO("语速超出范围\n"); |
| 824 | 824 | ||
| 825 | //回复操作失败 | 825 | //回复操作失败 |
| 826 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); | 826 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); |
| @@ -851,12 +851,12 @@ static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf) | @@ -851,12 +851,12 @@ static int Uart_DEV2_RecvDeal_TTS_SetSpeed(char *getbuf) | ||
| 851 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 | 851 | // 0x5A 0x5A 0x77 0x00 0x0c 0x00 0x00 0x57 0x04 0x00 0x00 0x23 结束TTS发送 |
| 852 | static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf) | 852 | static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf) |
| 853 | { | 853 | { |
| 854 | - USER_LOG_INFO("tts开始传输"); | 854 | + JZSDK_LOG_INFO("tts开始传输"); |
| 855 | //获取帧的序列号 | 855 | //获取帧的序列号 |
| 856 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 856 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 857 | 857 | ||
| 858 | //1、重置缓冲区 | 858 | //1、重置缓冲区 |
| 859 | - memset(TTS_Recv_buffer, '\0', 1009); | 859 | + memset(TTS_Recv_buffer, 0, 1009); |
| 860 | 860 | ||
| 861 | //2、重置缓冲区长度 | 861 | //2、重置缓冲区长度 |
| 862 | TTS_Recv_buffer_length = 0; | 862 | TTS_Recv_buffer_length = 0; |
| @@ -875,7 +875,7 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf) | @@ -875,7 +875,7 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_start(char *getbuf) | ||
| 875 | **********/ | 875 | **********/ |
| 876 | static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | 876 | static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) |
| 877 | { | 877 | { |
| 878 | - USER_LOG_INFO("tts传输中"); | 878 | + JZSDK_LOG_INFO("tts传输中"); |
| 879 | 879 | ||
| 880 | if (TTS_Recv_buffer_length+len < 1000) | 880 | if (TTS_Recv_buffer_length+len < 1000) |
| 881 | { | 881 | { |
| @@ -887,9 +887,10 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -887,9 +887,10 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 887 | } | 887 | } |
| 888 | else | 888 | else |
| 889 | { | 889 | { |
| 890 | - USER_LOG_ERROR("TTS字数超出1000字"); | 890 | + JZSDK_LOG_ERROR("TTS字数超出1000字节"); |
| 891 | } | 891 | } |
| 892 | } | 892 | } |
| 893 | + | ||
| 893 | /********* | 894 | /********* |
| 894 | * | 895 | * |
| 895 | * tts传输结束 | 896 | * tts传输结束 |
| @@ -898,12 +899,13 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | @@ -898,12 +899,13 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_transmission(char *getdata, int len) | ||
| 898 | **********/ | 899 | **********/ |
| 899 | static int Uart_DEV2_RecvDeal_TTS_Trans_stop(char *getbuf) | 900 | static int Uart_DEV2_RecvDeal_TTS_Trans_stop(char *getbuf) |
| 900 | { | 901 | { |
| 901 | - USER_LOG_INFO("tts传输结束"); | 902 | + JZSDK_LOG_INFO("tts传输结束"); |
| 902 | //获取帧的序列号 | 903 | //获取帧的序列号 |
| 903 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 904 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 904 | 905 | ||
| 906 | + | ||
| 905 | //1、打印一次TTS文本 | 907 | //1、打印一次TTS文本 |
| 906 | - USER_LOG_INFO("TTS播放%s",TTS_Recv_buffer); | 908 | + JZSDK_LOG_INFO("TTS播放%s",TTS_Recv_buffer); |
| 907 | 909 | ||
| 908 | //2、播放TTS | 910 | //2、播放TTS |
| 909 | JZsdk_Uart_TTS_Play(UART_DEV_2, TTS_Recv_buffer, TTS_Recv_buffer_length); | 911 | 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) | @@ -921,7 +923,7 @@ static int Uart_DEV2_RecvDeal_TTS_Trans_stop(char *getbuf) | ||
| 921 | **********/ | 923 | **********/ |
| 922 | static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf) | 924 | static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf) |
| 923 | { | 925 | { |
| 924 | - USER_LOG_INFO("打开opus传输\n"); | 926 | + JZSDK_LOG_INFO("打开opus传输\n"); |
| 925 | //获取帧的序列号 | 927 | //获取帧的序列号 |
| 926 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 928 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 927 | 929 | ||
| @@ -938,7 +940,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf) | @@ -938,7 +940,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_start(char *getbuf) | ||
| 938 | //3、修改接收模式为传输opus | 940 | //3、修改接收模式为传输opus |
| 939 | JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); | 941 | JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(JZ_INSCODE_5AFRAME_OPUS_TRANS_TRANSMISSION); |
| 940 | 942 | ||
| 941 | - USER_LOG_INFO("已完成打开opus传输处理\n"); | 943 | + JZSDK_LOG_INFO("已完成打开opus传输处理\n"); |
| 942 | 944 | ||
| 943 | //回复操作成功 | 945 | //回复操作成功 |
| 944 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); | 946 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); |
| @@ -953,7 +955,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -953,7 +955,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 953 | { | 955 | { |
| 954 | JZsdk_Uart_SaveOpusTrans(SaveData,size); | 956 | JZsdk_Uart_SaveOpusTrans(SaveData,size); |
| 955 | 957 | ||
| 956 | - USER_LOG_INFO("已完成opus传输保存处理\n"); | 958 | + JZSDK_LOG_INFO("已完成opus传输保存处理\n"); |
| 957 | } | 959 | } |
| 958 | /********* | 960 | /********* |
| 959 | * | 961 | * |
| @@ -963,13 +965,13 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | @@ -963,13 +965,13 @@ static int Uart_DEV2_RecvDeal_OpusTrans_transmission(char *SaveData, int size) | ||
| 963 | **********/ | 965 | **********/ |
| 964 | static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf) | 966 | static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf) |
| 965 | { | 967 | { |
| 966 | - USER_LOG_INFO("结束opus传输\n"); | 968 | + JZSDK_LOG_INFO("结束opus传输\n"); |
| 967 | //获取帧的序列号 | 969 | //获取帧的序列号 |
| 968 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 970 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 969 | 971 | ||
| 970 | JZsdk_Uart_SaveOpusStop(); | 972 | JZsdk_Uart_SaveOpusStop(); |
| 971 | 973 | ||
| 972 | - USER_LOG_INFO("结束opus传输处理\n"); | 974 | + JZSDK_LOG_INFO("结束opus传输处理\n"); |
| 973 | 975 | ||
| 974 | //回复操作成功 | 976 | //回复操作成功 |
| 975 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); | 977 | JZsdk_Uart_SendDeal_Reply_Sucesss(UART_DEV_2, FrameSequence); |
| @@ -982,7 +984,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf) | @@ -982,7 +984,7 @@ static int Uart_DEV2_RecvDeal_OpusTrans_stop(char *getbuf) | ||
| 982 | **********/ | 984 | **********/ |
| 983 | static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf) | 985 | static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf) |
| 984 | { | 986 | { |
| 985 | - USER_LOG_INFO("opus播放\n"); | 987 | + JZSDK_LOG_INFO("opus播放\n"); |
| 986 | //获取帧的序列号 | 988 | //获取帧的序列号 |
| 987 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 989 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 988 | 990 | ||
| @@ -1002,7 +1004,7 @@ static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf) | @@ -1002,7 +1004,7 @@ static int Uart_DEV2_RecvDeal_OpusPlay(char *getbuf) | ||
| 1002 | **********/ | 1004 | **********/ |
| 1003 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | 1005 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) |
| 1004 | { | 1006 | { |
| 1005 | - USER_LOG_INFO("开启opus实时喊话功能\n"); | 1007 | + JZSDK_LOG_INFO("开启opus实时喊话功能\n"); |
| 1006 | //获取帧的序列号 | 1008 | //获取帧的序列号 |
| 1007 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1009 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1008 | 1010 | ||
| @@ -1037,7 +1039,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | @@ -1037,7 +1039,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_start(char *getbuf) | ||
| 1037 | **********/ | 1039 | **********/ |
| 1038 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) | 1040 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int len) |
| 1039 | { | 1041 | { |
| 1040 | - USER_LOG_INFO("opus语音传输中\n"); | 1042 | + JZSDK_LOG_INFO("opus语音传输中\n"); |
| 1041 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); | 1043 | JZsdk_Uart_RealTimeVoiceTrans(getdata, len); |
| 1042 | 1044 | ||
| 1043 | } | 1045 | } |
| @@ -1049,7 +1051,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int | @@ -1049,7 +1051,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_transmission(char *getdata, int | ||
| 1049 | **********/ | 1051 | **********/ |
| 1050 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | 1052 | static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) |
| 1051 | { | 1053 | { |
| 1052 | - USER_LOG_INFO("关闭opus实时喊话功能\n"); | 1054 | + JZSDK_LOG_INFO("关闭opus实时喊话功能\n"); |
| 1053 | //获取帧的序列号 | 1055 | //获取帧的序列号 |
| 1054 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1056 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1055 | 1057 | ||
| @@ -1079,7 +1081,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | @@ -1079,7 +1081,7 @@ static int Uart_DEV2_RecvDeal_Opus_RealTimeVoice_stop(char *getbuf) | ||
| 1079 | **********/ | 1081 | **********/ |
| 1080 | static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) | 1082 | static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) |
| 1081 | { | 1083 | { |
| 1082 | - USER_LOG_INFO("云台俯仰控制\n"); | 1084 | + JZSDK_LOG_INFO("云台俯仰控制\n"); |
| 1083 | //获取帧的序列号 | 1085 | //获取帧的序列号 |
| 1084 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1086 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1085 | 1087 | ||
| @@ -1100,13 +1102,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1100,13 +1102,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1100 | } | 1102 | } |
| 1101 | else | 1103 | else |
| 1102 | { | 1104 | { |
| 1103 | - USER_LOG_INFO("云台输入角度符号错误,无法正常控制"); | 1105 | + JZSDK_LOG_INFO("云台输入角度符号错误,无法正常控制"); |
| 1104 | //回复操作失败 | 1106 | //回复操作失败 |
| 1105 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); | 1107 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); |
| 1106 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1108 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1107 | } | 1109 | } |
| 1108 | 1110 | ||
| 1109 | - USER_LOG_INFO("处理得到的角度是%d",Gimbal_angle); | 1111 | + JZSDK_LOG_INFO("处理得到的角度是%d",Gimbal_angle); |
| 1110 | 1112 | ||
| 1111 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_2, Gimbal_angle); | 1113 | T_JZsdkReturnCode ret = JZsdk_Uart_Gimbal_PitchControl(UART_DEV_2, Gimbal_angle); |
| 1112 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | 1114 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) |
| @@ -1129,7 +1131,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) | @@ -1129,7 +1131,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchControl(char *getbuf) | ||
| 1129 | **********/ | 1131 | **********/ |
| 1130 | static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | 1132 | static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) |
| 1131 | { | 1133 | { |
| 1132 | - USER_LOG_INFO("云台俯仰微调角度\n"); | 1134 | + JZSDK_LOG_INFO("云台俯仰微调角度\n"); |
| 1133 | //获取帧的序列号 | 1135 | //获取帧的序列号 |
| 1134 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1136 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1135 | 1137 | ||
| @@ -1137,7 +1139,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1137,7 +1139,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1137 | int Gimbal_signal = getbuf[9]; | 1139 | int Gimbal_signal = getbuf[9]; |
| 1138 | 1140 | ||
| 1139 | //2、通过云台控制帧 获取云台角度绝对值 | 1141 | //2、通过云台控制帧 获取云台角度绝对值 |
| 1140 | - int Gimbal_angle = ((int)getbuf[10]) ; | 1142 | + int Gimbal_angle = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1141 | 1143 | ||
| 1142 | //3、拼接得到云台值 | 1144 | //3、拼接得到云台值 |
| 1143 | if (Gimbal_signal == 0x00) | 1145 | if (Gimbal_signal == 0x00) |
| @@ -1150,13 +1152,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1150,13 +1152,13 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1150 | } | 1152 | } |
| 1151 | else | 1153 | else |
| 1152 | { | 1154 | { |
| 1153 | - USER_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); | 1155 | + JZSDK_LOG_INFO("云台俯仰微调角度符号错误,无法正常控制"); |
| 1154 | //回复操作失败 | 1156 | //回复操作失败 |
| 1155 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); | 1157 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, FrameSequence); |
| 1156 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 1158 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 1157 | } | 1159 | } |
| 1158 | 1160 | ||
| 1159 | - USER_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); | 1161 | + JZSDK_LOG_INFO("处理得到云台俯仰微调角度是%d",Gimbal_angle); |
| 1160 | 1162 | ||
| 1161 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_2, FrameSequence ,Gimbal_angle); | 1163 | JZsdk_Uart_Gimbal_PitchFineTuningControl(UART_DEV_2, FrameSequence ,Gimbal_angle); |
| 1162 | 1164 | ||
| @@ -1177,7 +1179,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | @@ -1177,7 +1179,7 @@ static int Uart_DEV2_RecvDeal_Gimbal_PitchFineTuningControl(char *getbuf) | ||
| 1177 | **********/ | 1179 | **********/ |
| 1178 | static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf) | 1180 | static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf) |
| 1179 | { | 1181 | { |
| 1180 | - USER_LOG_INFO("设置爆闪频率\n"); | 1182 | + JZSDK_LOG_INFO("设置爆闪频率\n"); |
| 1181 | //获取帧的序列号 | 1183 | //获取帧的序列号 |
| 1182 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1184 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1183 | 1185 | ||
| @@ -1204,7 +1206,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf) | @@ -1204,7 +1206,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SetFrequency(char *getbuf) | ||
| 1204 | **********/ | 1206 | **********/ |
| 1205 | static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf) | 1207 | static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf) |
| 1206 | { | 1208 | { |
| 1207 | - USER_LOG_INFO("设置灯光控制\n"); | 1209 | + JZSDK_LOG_INFO("设置灯光控制\n"); |
| 1208 | //获取帧的序列号 | 1210 | //获取帧的序列号 |
| 1209 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1211 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1210 | 1212 | ||
| @@ -1231,7 +1233,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf) | @@ -1231,7 +1233,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Control(char *getbuf) | ||
| 1231 | **********/ | 1233 | **********/ |
| 1232 | static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf) | 1234 | static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf) |
| 1233 | { | 1235 | { |
| 1234 | - USER_LOG_INFO("设置灯光亮度\n"); | 1236 | + JZSDK_LOG_INFO("设置灯光亮度\n"); |
| 1235 | //获取帧的序列号 | 1237 | //获取帧的序列号 |
| 1236 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1238 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1237 | 1239 | ||
| @@ -1259,7 +1261,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf) | @@ -1259,7 +1261,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_Lumen(char *getbuf) | ||
| 1259 | **********/ | 1261 | **********/ |
| 1260 | static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) | 1262 | static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf) |
| 1261 | { | 1263 | { |
| 1262 | - USER_LOG_INFO("灯光属性查询\n"); | 1264 | + JZSDK_LOG_INFO("灯光属性查询\n"); |
| 1263 | //1、获取帧的序列号 | 1265 | //1、获取帧的序列号 |
| 1264 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1266 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1265 | 1267 | ||
| @@ -1275,7 +1277,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf | @@ -1275,7 +1277,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightLightAttribute(char *getbuf | ||
| 1275 | **********/ | 1277 | **********/ |
| 1276 | static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | 1278 | static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) |
| 1277 | { | 1279 | { |
| 1278 | - USER_LOG_INFO("探照灯温度查询\n"); | 1280 | + JZSDK_LOG_INFO("探照灯温度查询\n"); |
| 1279 | //1、获取帧的序列号 | 1281 | //1、获取帧的序列号 |
| 1280 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1282 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1281 | 1283 | ||
| @@ -1290,7 +1292,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | @@ -1290,7 +1292,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_SearchLightTemperture(char *getbuf) | ||
| 1290 | **********/ | 1292 | **********/ |
| 1291 | static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | 1293 | static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) |
| 1292 | { | 1294 | { |
| 1293 | - USER_LOG_INFO("消息订阅控制\n"); | 1295 | + JZSDK_LOG_INFO("消息订阅控制\n"); |
| 1294 | //获取帧的序列号 | 1296 | //获取帧的序列号 |
| 1295 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1297 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1296 | 1298 | ||
| @@ -1310,6 +1312,55 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1310,6 +1312,55 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1310 | } | 1312 | } |
| 1311 | } | 1313 | } |
| 1312 | 1314 | ||
| 1315 | +/********* | ||
| 1316 | + * | ||
| 1317 | + * 查询产品序列号 | ||
| 1318 | + * | ||
| 1319 | +**********/ | ||
| 1320 | +static int Uart_DEV2_RecvDeal_CheckStatus_SerialNumber(char *getbuf) | ||
| 1321 | +{ | ||
| 1322 | + JZSDK_LOG_INFO("消息订阅控制\n"); | ||
| 1323 | + //获取帧的序列号 | ||
| 1324 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1325 | + | ||
| 1326 | + JZsdk_Uart_CheckStatus_SerialNumber(UART_DEV_2, FrameSequence); | ||
| 1327 | + | ||
| 1328 | +} | ||
| 1329 | + | ||
| 1330 | +/********* | ||
| 1331 | + * | ||
| 1332 | + * 对外供电开关 | ||
| 1333 | + * | ||
| 1334 | +**********/ | ||
| 1335 | +static int Uart_DEV2_RecvDeal_OutPutPower_Control(char *getbuf) | ||
| 1336 | +{ | ||
| 1337 | + printf("对外电源控制\n"); | ||
| 1338 | + //获取帧的序列号 | ||
| 1339 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1340 | + | ||
| 1341 | + //获取控制值 | ||
| 1342 | + int Value = getbuf[9]; | ||
| 1343 | + | ||
| 1344 | + //控制 | ||
| 1345 | + JZsdk_Uart_OutPutPower_Control(UART_DEV_2, FrameSequence, Value); | ||
| 1346 | +} | ||
| 1347 | + | ||
| 1348 | +/********* | ||
| 1349 | + * | ||
| 1350 | + * 对外电源查询 | ||
| 1351 | + * | ||
| 1352 | +**********/ | ||
| 1353 | +static int Uart_DEV2_RecvDeal_Checkstatus_OutPutPower(char *getbuf) | ||
| 1354 | +{ | ||
| 1355 | + printf("对外电源查询\n"); | ||
| 1356 | + | ||
| 1357 | + //获取帧的序列号 | ||
| 1358 | + int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | ||
| 1359 | + | ||
| 1360 | + //获取本地数值 | ||
| 1361 | + JZsdk_Uart_Checkstatus_OutPutPower(UART_DEV_2, FrameSequence); | ||
| 1362 | +} | ||
| 1363 | + | ||
| 1313 | /******************************************************************************************************************************* | 1364 | /******************************************************************************************************************************* |
| 1314 | * | 1365 | * |
| 1315 | * 警灯部分 | 1366 | * 警灯部分 |
| @@ -1322,7 +1373,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | @@ -1322,7 +1373,7 @@ static int Uart_DEV2_RecvDeal_SearchLight_SubscriptionControl(char *getbuf) | ||
| 1322 | **********/ | 1373 | **********/ |
| 1323 | static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf) | 1374 | static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf) |
| 1324 | { | 1375 | { |
| 1325 | - USER_LOG_INFO("警灯模式控制\n"); | 1376 | + JZSDK_LOG_INFO("警灯模式控制\n"); |
| 1326 | //获取帧的序列号 | 1377 | //获取帧的序列号 |
| 1327 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1378 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1328 | 1379 | ||
| @@ -1350,7 +1401,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf) | @@ -1350,7 +1401,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_ModeControl(char *getbuf) | ||
| 1350 | **********/ | 1401 | **********/ |
| 1351 | static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf) | 1402 | static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf) |
| 1352 | { | 1403 | { |
| 1353 | - USER_LOG_INFO("警灯颜色选择\n"); | 1404 | + JZSDK_LOG_INFO("警灯颜色选择\n"); |
| 1354 | //获取帧的序列号 | 1405 | //获取帧的序列号 |
| 1355 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1406 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1356 | 1407 | ||
| @@ -1378,7 +1429,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf) | @@ -1378,7 +1429,7 @@ static int Uart_DEV2_RecvDeal_WarningLight_SetColor(char *getbuf) | ||
| 1378 | **********/ | 1429 | **********/ |
| 1379 | static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | 1430 | static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) |
| 1380 | { | 1431 | { |
| 1381 | - USER_LOG_INFO("警灯状态查询\n"); | 1432 | + JZSDK_LOG_INFO("警灯状态查询\n"); |
| 1382 | //1、获取帧的序列号 | 1433 | //1、获取帧的序列号 |
| 1383 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1434 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1384 | 1435 | ||
| @@ -1394,7 +1445,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | @@ -1394,7 +1445,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightStatus(char *getbuf) | ||
| 1394 | **********/ | 1445 | **********/ |
| 1395 | static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | 1446 | static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) |
| 1396 | { | 1447 | { |
| 1397 | - USER_LOG_INFO("警灯颜色查询\n"); | 1448 | + JZSDK_LOG_INFO("警灯颜色查询\n"); |
| 1398 | //1、获取帧的序列号 | 1449 | //1、获取帧的序列号 |
| 1399 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1450 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1400 | 1451 | ||
| @@ -1433,7 +1484,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | @@ -1433,7 +1484,7 @@ static int Uart_DEV2_RecvDeal_CheckStatus_WarningLightColor(char *getbuf) | ||
| 1433 | **********/ | 1484 | **********/ |
| 1434 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | 1485 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) |
| 1435 | { | 1486 | { |
| 1436 | - USER_LOG_INFO("收到灯光频率\n"); | 1487 | + JZSDK_LOG_INFO("收到灯光频率\n"); |
| 1437 | //获取帧的序列号 | 1488 | //获取帧的序列号 |
| 1438 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1489 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1439 | 1490 | ||
| @@ -1451,7 +1502,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | @@ -1451,7 +1502,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Frequency(char *getbuf) | ||
| 1451 | **********/ | 1502 | **********/ |
| 1452 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | 1503 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf) |
| 1453 | { | 1504 | { |
| 1454 | - USER_LOG_INFO("收到灯光模式\n"); | 1505 | + JZSDK_LOG_INFO("收到灯光模式\n"); |
| 1455 | //获取帧的序列号 | 1506 | //获取帧的序列号 |
| 1456 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1507 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1457 | 1508 | ||
| @@ -1469,7 +1520,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | @@ -1469,7 +1520,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Mode(char *getbuf) | ||
| 1469 | **********/ | 1520 | **********/ |
| 1470 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | 1521 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) |
| 1471 | { | 1522 | { |
| 1472 | - USER_LOG_INFO("收到灯光亮度\n"); | 1523 | + JZSDK_LOG_INFO("收到灯光亮度\n"); |
| 1473 | //获取帧的序列号 | 1524 | //获取帧的序列号 |
| 1474 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1525 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1475 | 1526 | ||
| @@ -1488,7 +1539,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | @@ -1488,7 +1539,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Lumen(char *getbuf) | ||
| 1488 | **********/ | 1539 | **********/ |
| 1489 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | 1540 | static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) |
| 1490 | { | 1541 | { |
| 1491 | - USER_LOG_INFO("收到探照灯温度\n"); | 1542 | + JZSDK_LOG_INFO("收到探照灯温度\n"); |
| 1492 | //获取帧的序列号 | 1543 | //获取帧的序列号 |
| 1493 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1544 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1494 | 1545 | ||
| @@ -1507,7 +1558,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | @@ -1507,7 +1558,7 @@ static int Uart_DEV2_RecvDeal_ObtainSearchLight_Temperature(char *getbuf) | ||
| 1507 | **********/ | 1558 | **********/ |
| 1508 | static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | 1559 | static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf) |
| 1509 | { | 1560 | { |
| 1510 | - USER_LOG_INFO("收到云台俯仰\n"); | 1561 | + JZSDK_LOG_INFO("收到云台俯仰\n"); |
| 1511 | //获取帧的序列号 | 1562 | //获取帧的序列号 |
| 1512 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1563 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1513 | 1564 | ||
| @@ -1538,7 +1589,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | @@ -1538,7 +1589,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbal_Pitch(char *getbuf) | ||
| 1538 | **********/ | 1589 | **********/ |
| 1539 | static int Uart_DEV2_RecvDeal_ObtainGimbal_Yaw(char *getbuf) | 1590 | static int Uart_DEV2_RecvDeal_ObtainGimbal_Yaw(char *getbuf) |
| 1540 | { | 1591 | { |
| 1541 | - USER_LOG_INFO("收到云台航向\n"); | 1592 | + JZSDK_LOG_INFO("收到云台航向\n"); |
| 1542 | //获取帧的序列号 | 1593 | //获取帧的序列号 |
| 1543 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1594 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1544 | 1595 | ||
| @@ -1576,7 +1627,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1576,7 +1627,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1576 | int signal = getbuf[9]; | 1627 | int signal = getbuf[9]; |
| 1577 | 1628 | ||
| 1578 | //2、获取云台角度绝对值 | 1629 | //2、获取云台角度绝对值 |
| 1579 | - int pitch = (int)getbuf[10] ; | 1630 | + int pitch = (((int)getbuf[10]) << 8 ) + getbuf[11]; |
| 1580 | 1631 | ||
| 1581 | //3、拼接得到云台值 | 1632 | //3、拼接得到云台值 |
| 1582 | if (signal == 0x00) | 1633 | if (signal == 0x00) |
| @@ -1598,7 +1649,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | @@ -1598,7 +1649,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalPitchFineTuning(char *getbuf) | ||
| 1598 | **********/ | 1649 | **********/ |
| 1599 | static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf) | 1650 | static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf) |
| 1600 | { | 1651 | { |
| 1601 | - USER_LOG_INFO("收到警灯状态\n"); | 1652 | + JZSDK_LOG_INFO("收到警灯状态\n"); |
| 1602 | //获取帧的序列号 | 1653 | //获取帧的序列号 |
| 1603 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1654 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1604 | 1655 | ||
| @@ -1617,7 +1668,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf) | @@ -1617,7 +1668,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Status(char *getbuf) | ||
| 1617 | **********/ | 1668 | **********/ |
| 1618 | static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf) | 1669 | static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf) |
| 1619 | { | 1670 | { |
| 1620 | - USER_LOG_INFO("收到警灯颜色\n"); | 1671 | + JZSDK_LOG_INFO("收到警灯颜色\n"); |
| 1621 | //获取帧的序列号 | 1672 | //获取帧的序列号 |
| 1622 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1673 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1623 | 1674 | ||
| @@ -1636,7 +1687,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf) | @@ -1636,7 +1687,7 @@ static int Uart_DEV2_RecvDeal_ObtainWaringlight_Color(char *getbuf) | ||
| 1636 | **********/ | 1687 | **********/ |
| 1637 | static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf) | 1688 | static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf) |
| 1638 | { | 1689 | { |
| 1639 | - USER_LOG_INFO("收到产品序列号\n"); | 1690 | + JZSDK_LOG_INFO("收到产品序列号\n"); |
| 1640 | //获取帧的序列号 | 1691 | //获取帧的序列号 |
| 1641 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1692 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1642 | 1693 | ||
| @@ -1667,7 +1718,7 @@ static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf) | @@ -1667,7 +1718,7 @@ static int Uart_DEV2_RecvDeal_ObtainSerialNumber(char *getbuf) | ||
| 1667 | **********/ | 1718 | **********/ |
| 1668 | static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | 1719 | static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf) |
| 1669 | { | 1720 | { |
| 1670 | - USER_LOG_INFO("查询当前从设备名\n"); | 1721 | + JZSDK_LOG_INFO("查询当前从设备名\n"); |
| 1671 | 1722 | ||
| 1672 | //获取帧的序列号 | 1723 | //获取帧的序列号 |
| 1673 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1724 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1696,7 +1747,7 @@ static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | @@ -1696,7 +1747,7 @@ static int Uart_DEV2_RecvDeal_QuerySecondaryDeviceName(char *getbuf) | ||
| 1696 | **********/ | 1747 | **********/ |
| 1697 | static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf) | 1748 | static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf) |
| 1698 | { | 1749 | { |
| 1699 | - USER_LOG_INFO("设置云台最大值最小值\n"); | 1750 | + JZSDK_LOG_INFO("设置云台最大值最小值\n"); |
| 1700 | //获取帧的序列号 | 1751 | //获取帧的序列号 |
| 1701 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1752 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1702 | 1753 | ||
| @@ -1723,7 +1774,7 @@ static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf) | @@ -1723,7 +1774,7 @@ static int Uart_DEV2_RecvDeal_SetGimbalRange(char *getbuf) | ||
| 1723 | **********/ | 1774 | **********/ |
| 1724 | static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf) | 1775 | static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf) |
| 1725 | { | 1776 | { |
| 1726 | - USER_LOG_INFO("设置云台联动\n"); | 1777 | + JZSDK_LOG_INFO("设置云台联动\n"); |
| 1727 | 1778 | ||
| 1728 | //获取帧的序列号 | 1779 | //获取帧的序列号 |
| 1729 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1780 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1743,7 +1794,7 @@ static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf) | @@ -1743,7 +1794,7 @@ static int Uart_DEV2_RecvDeal_GimbalLinkageControl(char *getbuf) | ||
| 1743 | **********/ | 1794 | **********/ |
| 1744 | static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | 1795 | static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) |
| 1745 | { | 1796 | { |
| 1746 | - USER_LOG_INFO("收到查询是否开启云台联动\n"); | 1797 | + JZSDK_LOG_INFO("收到查询是否开启云台联动\n"); |
| 1747 | 1798 | ||
| 1748 | //获取帧的序列号 | 1799 | //获取帧的序列号 |
| 1749 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1800 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| @@ -1777,7 +1828,7 @@ static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | @@ -1777,7 +1828,7 @@ static int Uart_DEV2_RecvDeal_Checkstatus_GimbalLinkage(char *getbuf) | ||
| 1777 | **********/ | 1828 | **********/ |
| 1778 | static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | 1829 | static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) |
| 1779 | { | 1830 | { |
| 1780 | - USER_LOG_INFO("收到从设备名\n"); | 1831 | + JZSDK_LOG_INFO("收到从设备名\n"); |
| 1781 | //获取帧的序列号 | 1832 | //获取帧的序列号 |
| 1782 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1833 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1783 | 1834 | ||
| @@ -1809,7 +1860,7 @@ static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | @@ -1809,7 +1860,7 @@ static int Uart_DEV2_RecvDeal_ObtainSecondaryDeviceName(char *getbuf) | ||
| 1809 | **********/ | 1860 | **********/ |
| 1810 | static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf) | 1861 | static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf) |
| 1811 | { | 1862 | { |
| 1812 | - USER_LOG_INFO("收到云台联动值\n"); | 1863 | + JZSDK_LOG_INFO("收到云台联动值\n"); |
| 1813 | //获取帧的序列号 | 1864 | //获取帧的序列号 |
| 1814 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); | 1865 | int FrameSequence = JZsdk_Get_FrameSequence(getbuf); |
| 1815 | 1866 | ||
| @@ -1844,7 +1895,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf) | @@ -1844,7 +1895,7 @@ static int Uart_DEV2_RecvDeal_ObtainGimbalLinkage(char *getbuf) | ||
| 1844 | **********/ | 1895 | **********/ |
| 1845 | static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf) | 1896 | static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf) |
| 1846 | { | 1897 | { |
| 1847 | - USER_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); | 1898 | + JZSDK_LOG_ERROR("帧指令错误:帧错误或者是帧无对应操作\n"); |
| 1848 | //无法正常获取帧的序列号 | 1899 | //无法正常获取帧的序列号 |
| 1849 | //回复操作失败 | 1900 | //回复操作失败 |
| 1850 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, 0x00); | 1901 | JZsdk_Uart_SendDeal_Reply_Failure(UART_DEV_2, 0x00); |
| @@ -1859,7 +1910,7 @@ static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf) | @@ -1859,7 +1910,7 @@ static int Uart_DEV2_RecvDeal_FrameErrorReply(char *getbuf) | ||
| 1859 | **********/ | 1910 | **********/ |
| 1860 | static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf) | 1911 | static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf) |
| 1861 | { | 1912 | { |
| 1862 | - USER_LOG_INFO("接受到操作成功\n"); | 1913 | + JZSDK_LOG_INFO("接受到操作成功\n"); |
| 1863 | } | 1914 | } |
| 1864 | 1915 | ||
| 1865 | /********* | 1916 | /********* |
| @@ -1870,7 +1921,7 @@ static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf) | @@ -1870,7 +1921,7 @@ static int Uart_DEV2_RecvDeal_OperationSuccessful(char *getbuf) | ||
| 1870 | **********/ | 1921 | **********/ |
| 1871 | static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf) | 1922 | static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf) |
| 1872 | { | 1923 | { |
| 1873 | - USER_LOG_INFO("接受到操作失败\n"); | 1924 | + JZSDK_LOG_INFO("接受到操作失败\n"); |
| 1874 | } | 1925 | } |
| 1875 | /******************************************************************************************************** | 1926 | /******************************************************************************************************** |
| 1876 | ********* ********| | 1927 | ********* ********| |
| @@ -1887,7 +1938,7 @@ static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf) | @@ -1887,7 +1938,7 @@ static int Uart_DEV2_RecvDeal_OperationFailed(char *getbuf) | ||
| 1887 | *********************************************************************************************************/ | 1938 | *********************************************************************************************************/ |
| 1888 | int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) | 1939 | int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int len) |
| 1889 | { | 1940 | { |
| 1890 | - USER_LOG_INFO("串口设备2号,接受到的模式为:%x",Receive_mode); | 1941 | + JZSDK_LOG_INFO("串口设备2号,接受到的模式为:%x",Receive_mode); |
| 1891 | switch (Receive_mode) | 1942 | switch (Receive_mode) |
| 1892 | { | 1943 | { |
| 1893 | /******************************************************************************************************************************* | 1944 | /******************************************************************************************************************************* |
| @@ -2195,9 +2246,20 @@ int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le | @@ -2195,9 +2246,20 @@ int Uart_DEV2_RecvDeal_RecvDeal(int Receive_mode, unsigned char *getdata, int le | ||
| 2195 | 2246 | ||
| 2196 | //序列号查询 | 2247 | //序列号查询 |
| 2197 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: | 2248 | case JZ_INSCODE_5AFRAME_CHECKSTATUS_SERIALNUMBER: |
| 2249 | + Uart_DEV2_RecvDeal_CheckStatus_SerialNumber(getdata); | ||
| 2250 | + break; | ||
| 2198 | 2251 | ||
| 2252 | + //向外供电开关 | ||
| 2253 | + case JZ_INSCODE_5AFRAME_OUTPUTPOWER_CONTROL: | ||
| 2254 | + Uart_DEV2_RecvDeal_OutPutPower_Control(getdata); | ||
| 2199 | break; | 2255 | break; |
| 2200 | 2256 | ||
| 2257 | + //查询向外供电情况 | ||
| 2258 | + case JZ_INSCODE_5AFRAME_CHECKSTATUS_OUTPUTPOWER: | ||
| 2259 | + Uart_DEV2_RecvDeal_Checkstatus_OutPutPower(getdata); | ||
| 2260 | + break; | ||
| 2261 | + | ||
| 2262 | + | ||
| 2201 | 2263 | ||
| 2202 | /******************************************************************************************************************************* | 2264 | /******************************************************************************************************************************* |
| 2203 | * | 2265 | * |
| @@ -2586,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV2(unsigned char *getbuf, int len) | @@ -2586,7 +2648,7 @@ int JZsdk_Uart_RecvDeal_CharmDeal_Uart_DEV2(unsigned char *getbuf, int len) | ||
| 2586 | * ****************/ | 2648 | * ****************/ |
| 2587 | int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value) | 2649 | int JZsdk_Uart_RecvDeal_Set_UART_DEV2_Receive_mode(int value) |
| 2588 | { | 2650 | { |
| 2589 | - USER_LOG_INFO("串口设备2号,二次修改接收模式%x\n",value); | 2651 | + JZSDK_LOG_INFO("串口设备2号,二次修改接收模式%x\n",value); |
| 2590 | UART_DEV2_Receive_mode = value; | 2652 | UART_DEV2_Receive_mode = value; |
| 2591 | return 0; | 2653 | return 0; |
| 2592 | } | 2654 | } |
| @@ -96,7 +96,30 @@ int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence | @@ -96,7 +96,30 @@ int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence | ||
| 96 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | 96 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | +//发送当前设备序列号 | ||
| 100 | +int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber) | ||
| 101 | +{ | ||
| 102 | + char sendbuf[256]; | ||
| 103 | + int send_buf_len; | ||
| 104 | + | ||
| 105 | + //1、获取帧样板 | ||
| 106 | + JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_SERIALNUMBER , sendbuf, &send_buf_len); | ||
| 107 | + | ||
| 108 | + //2、写入数据 | ||
| 109 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 99 | 110 | ||
| 111 | + for (int i = 0; i < 14; i++) | ||
| 112 | + { | ||
| 113 | + sendbuf[9+i] = SerialNumber[i]; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + sendbuf[21] = 0x00; | ||
| 117 | + sendbuf[22] = 0x23; | ||
| 118 | + sendbuf[4] = 0x17; | ||
| 119 | + | ||
| 120 | + //3、发送帧 | ||
| 121 | + JZsdk_Uart_SendDeal_SendOreder(UartPort ,sendbuf, send_buf_len); | ||
| 122 | +} | ||
| 100 | 123 | ||
| 101 | 124 | ||
| 102 | //发送歌曲名字 | 125 | //发送歌曲名字 |
| @@ -423,7 +446,8 @@ int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTun | @@ -423,7 +446,8 @@ int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTun | ||
| 423 | sendbuf[9] = 0x00; | 446 | sendbuf[9] = 0x00; |
| 424 | } | 447 | } |
| 425 | 448 | ||
| 426 | - sendbuf[10] = (PitchFineTuning & 0xff); | 449 | + sendbuf[10] = ((PitchFineTuning>>8) & 0xff); |
| 450 | + sendbuf[11] = (PitchFineTuning & 0xff); | ||
| 427 | 451 | ||
| 428 | //3、发送帧 | 452 | //3、发送帧 |
| 429 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | 453 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); |
| @@ -467,7 +491,8 @@ int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSeque | @@ -467,7 +491,8 @@ int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSeque | ||
| 467 | sendbuf[9] = 0x00; | 491 | sendbuf[9] = 0x00; |
| 468 | } | 492 | } |
| 469 | 493 | ||
| 470 | - sendbuf[10] = (FineTunigPitch & 0xff); | 494 | + sendbuf[10] = ((FineTunigPitch>>8) & 0xff); |
| 495 | + sendbuf[11] = (FineTunigPitch & 0xff); | ||
| 471 | 496 | ||
| 472 | //3、发送帧 | 497 | //3、发送帧 |
| 473 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | 498 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); |
| @@ -526,6 +551,24 @@ int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int | @@ -526,6 +551,24 @@ int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int | ||
| 526 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | 551 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); |
| 527 | } | 552 | } |
| 528 | 553 | ||
| 554 | +//发送云台最大最小值帧 | ||
| 555 | +int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | ||
| 556 | +{ | ||
| 557 | + printf("发送云台最大最小值帧\n"); | ||
| 558 | + char sendbuf[256]; | ||
| 559 | + int send_buf_len; | ||
| 560 | + | ||
| 561 | + //1、获取帧样板 | ||
| 562 | + JZsdk_GetFrameTemplate(JZ_INSCODE_6AFRAME_SET_GIMBAL_MAXMIN_RANGE, sendbuf, &send_buf_len); | ||
| 563 | + | ||
| 564 | + //2、写入数据 | ||
| 565 | + sendbuf[6] = FrameSequence; //帧序列 | ||
| 566 | + sendbuf[10] = value; | ||
| 567 | + | ||
| 568 | + //3、发送帧 | ||
| 569 | + JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | ||
| 570 | +} | ||
| 571 | + | ||
| 529 | /**************************************************************************************************************************************************** | 572 | /**************************************************************************************************************************************************** |
| 530 | * | 573 | * |
| 531 | * 探照灯部分 | 574 | * 探照灯部分 |
| @@ -903,3 +946,25 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | @@ -903,3 +946,25 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | ||
| 903 | //3、发送帧 | 946 | //3、发送帧 |
| 904 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | 947 | JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); |
| 905 | } | 948 | } |
| 949 | + | ||
| 950 | +/************* | ||
| 951 | + * | ||
| 952 | + * 发送对外电源状态 | ||
| 953 | + * | ||
| 954 | + * **************/ | ||
| 955 | +int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status) | ||
| 956 | +{ | ||
| 957 | + printf("发送对外电源状态帧\n"); | ||
| 958 | + | ||
| 959 | + char sendbuf[256]; | ||
| 960 | + int send_buf_len; | ||
| 961 | + | ||
| 962 | + //1、获取帧样板 | ||
| 963 | + JZsdk_GetFrameTemplate(JZ_INSCODE_5BFRAME_CHECKSTATUS_OUTPUTPOWER, sendbuf, &send_buf_len); | ||
| 964 | + | ||
| 965 | + //2、写入数据 | ||
| 966 | + sendbuf[9] = status; | ||
| 967 | + | ||
| 968 | + //3、发送帧 | ||
| 969 | + JZsdk_Uart_SendDeal_SendOreder(Uartport ,sendbuf, send_buf_len); | ||
| 970 | +} |
| @@ -47,6 +47,7 @@ int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, | @@ -47,6 +47,7 @@ int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, | ||
| 47 | int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); | 47 | int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); |
| 48 | int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int value); | 48 | int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int value); |
| 49 | int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); | 49 | int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); |
| 50 | +int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value); | ||
| 50 | 51 | ||
| 51 | 52 | ||
| 52 | int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion); | 53 | 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); | @@ -62,6 +63,8 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value); | ||
| 62 | int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mode); | 63 | int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mode); |
| 63 | int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int color2); | 64 | int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int color2); |
| 64 | 65 | ||
| 66 | +int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber); | ||
| 67 | + | ||
| 65 | 68 | ||
| 66 | 69 | ||
| 67 | 70 | ||
| @@ -86,6 +89,8 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | @@ -86,6 +89,8 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | ||
| 86 | int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport); | 89 | int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport); |
| 87 | int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport); | 90 | int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport); |
| 88 | 91 | ||
| 92 | +int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status); | ||
| 93 | + | ||
| 89 | 94 | ||
| 90 | /* Exported functions --------------------------------------------------------*/ | 95 | /* Exported functions --------------------------------------------------------*/ |
| 91 | 96 |
| @@ -11,25 +11,25 @@ | @@ -11,25 +11,25 @@ | ||
| 11 | #include "JZsdk_Uart_Recv/JZsdk_Uart_RecvDeal.h" | 11 | #include "JZsdk_Uart_Recv/JZsdk_Uart_RecvDeal.h" |
| 12 | #include "JZsdkLib.h" | 12 | #include "JZsdkLib.h" |
| 13 | 13 | ||
| 14 | -//串口参数结构体 | 14 | +// 串口参数结构体 |
| 15 | typedef struct | 15 | typedef struct |
| 16 | { | 16 | { |
| 17 | - int UartFd; //串口识别符 | ||
| 18 | - char Message[1024]; //传递的字符串 | ||
| 19 | - int MessageLength; //字符串的长度 | 17 | + int UartFd; // 串口识别符 |
| 18 | + char Message[1024]; // 传递的字符串 | ||
| 19 | + int MessageLength; // 字符串的长度 | ||
| 20 | + int ResLen; //剩余长度 | ||
| 20 | pthread_mutex_t mutex; // 互斥锁 | 21 | pthread_mutex_t mutex; // 互斥锁 |
| 21 | pthread_cond_t cond; // 条件变量 | 22 | pthread_cond_t cond; // 条件变量 |
| 22 | -}s_SerialArgs; | 23 | +} s_SerialArgs; |
| 23 | 24 | ||
| 24 | static int Uart_4G_fd; | 25 | static int Uart_4G_fd; |
| 25 | static int Uart_DEV1_fd; | 26 | static int Uart_DEV1_fd; |
| 26 | static int Uart_DEV2_fd; | 27 | static int Uart_DEV2_fd; |
| 27 | 28 | ||
| 28 | static void *UartDeal_rece(void *arg); | 29 | static void *UartDeal_rece(void *arg); |
| 29 | -static void* UartDeal_deal(void *arg); | 30 | +static void *UartDeal_deal(void *arg); |
| 30 | static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getbufLen); | 31 | static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getbufLen); |
| 31 | 32 | ||
| 32 | - | ||
| 33 | /********************* | 33 | /********************* |
| 34 | * | 34 | * |
| 35 | * 串口接收线程 | 35 | * 串口接收线程 |
| @@ -45,9 +45,9 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | @@ -45,9 +45,9 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | ||
| 45 | int ret = 0; | 45 | int ret = 0; |
| 46 | pthread_t Uart_rece_task; | 46 | pthread_t Uart_rece_task; |
| 47 | 47 | ||
| 48 | - pthread_attr_t task_attribute; //线程属性 | ||
| 49 | - pthread_attr_init(&task_attribute); //初始化线程属性 | ||
| 50 | - pthread_attr_setdetachstate(&task_attribute, PTHREAD_CREATE_DETACHED); //设置线程属性 | 48 | + pthread_attr_t task_attribute; // 线程属性 |
| 49 | + pthread_attr_init(&task_attribute); // 初始化线程属性 | ||
| 50 | + pthread_attr_setdetachstate(&task_attribute, PTHREAD_CREATE_DETACHED); // 设置线程属性 | ||
| 51 | 51 | ||
| 52 | if (Uart_Dev_name == UART_DEV_1) | 52 | if (Uart_Dev_name == UART_DEV_1) |
| 53 | { | 53 | { |
| @@ -62,7 +62,7 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | @@ -62,7 +62,7 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | ||
| 62 | Uart_4G_fd = Uart_fd; | 62 | Uart_4G_fd = Uart_fd; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | - s_SerialArgs* parameter = (s_SerialArgs*)malloc(sizeof(s_SerialArgs)); | 65 | + s_SerialArgs *parameter = (s_SerialArgs *)malloc(sizeof(s_SerialArgs)); |
| 66 | parameter->UartFd = Uart_fd; | 66 | parameter->UartFd = Uart_fd; |
| 67 | parameter->MessageLength = 0; | 67 | parameter->MessageLength = 0; |
| 68 | memset(parameter->Message, 0, sizeof(parameter->Message)); | 68 | memset(parameter->Message, 0, sizeof(parameter->Message)); |
| @@ -72,28 +72,26 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | @@ -72,28 +72,26 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | ||
| 72 | // 创建串口数据接收线程 | 72 | // 创建串口数据接收线程 |
| 73 | pthread_t receiveThread; | 73 | pthread_t receiveThread; |
| 74 | pthread_t SerialDealThread; | 74 | pthread_t SerialDealThread; |
| 75 | - pthread_attr_t task_attribute1; //线程属性 | ||
| 76 | - pthread_attr_t task_attribute2; //线程属性 | ||
| 77 | - pthread_attr_setdetachstate(&task_attribute1, PTHREAD_CREATE_DETACHED); //设置线程分离属性 | ||
| 78 | - pthread_attr_setdetachstate(&task_attribute2, PTHREAD_CREATE_DETACHED); //设置线程分离属性 | 75 | + pthread_attr_t task_attribute1; // 线程属性 |
| 76 | + pthread_attr_t task_attribute2; // 线程属性 | ||
| 77 | + pthread_attr_setdetachstate(&task_attribute1, PTHREAD_CREATE_DETACHED); // 设置线程分离属性 | ||
| 78 | + pthread_attr_setdetachstate(&task_attribute2, PTHREAD_CREATE_DETACHED); // 设置线程分离属性 | ||
| 79 | 79 | ||
| 80 | pthread_attr_init(&task_attribute1); | 80 | pthread_attr_init(&task_attribute1); |
| 81 | pthread_attr_init(&task_attribute2); | 81 | pthread_attr_init(&task_attribute2); |
| 82 | 82 | ||
| 83 | - | ||
| 84 | if (pthread_create(&receiveThread, &task_attribute1, UartDeal_rece, parameter) != 0) | 83 | if (pthread_create(&receiveThread, &task_attribute1, UartDeal_rece, parameter) != 0) |
| 85 | { | 84 | { |
| 86 | - USER_LOG_ERROR("Failed to create receive thread"); | 85 | + JZSDK_LOG_ERROR("Failed to create receive thread"); |
| 87 | return 1; | 86 | return 1; |
| 88 | } | 87 | } |
| 89 | 88 | ||
| 90 | // 创建串口数据处理线程 | 89 | // 创建串口数据处理线程 |
| 91 | if (pthread_create(&SerialDealThread, &task_attribute2, UartDeal_deal, parameter) != 0) | 90 | if (pthread_create(&SerialDealThread, &task_attribute2, UartDeal_deal, parameter) != 0) |
| 92 | { | 91 | { |
| 93 | - USER_LOG_ERROR("Failed to create receive thread"); | 92 | + JZSDK_LOG_ERROR("Failed to create receive thread"); |
| 94 | return 1; | 93 | return 1; |
| 95 | } | 94 | } |
| 96 | - | ||
| 97 | } | 95 | } |
| 98 | /*** | 96 | /*** |
| 99 | * | 97 | * |
| @@ -103,24 +101,26 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | @@ -103,24 +101,26 @@ int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name) | ||
| 103 | static void *UartDeal_rece(void *arg) | 101 | static void *UartDeal_rece(void *arg) |
| 104 | { | 102 | { |
| 105 | 103 | ||
| 106 | - s_SerialArgs *args = (s_SerialArgs*)arg; | 104 | + s_SerialArgs *args = (s_SerialArgs *)arg; |
| 107 | 105 | ||
| 108 | fd_set fs_read; | 106 | fd_set fs_read; |
| 109 | - static int ResidualLength = 0; //未处理数据长度 | 107 | + static int ResidualLength = 0; // 未处理数据长度 |
| 110 | 108 | ||
| 111 | int Uart_fd = args->UartFd; | 109 | int Uart_fd = args->UartFd; |
| 112 | 110 | ||
| 113 | FD_ZERO(&fs_read); | 111 | FD_ZERO(&fs_read); |
| 114 | FD_SET(Uart_fd, &fs_read); | 112 | FD_SET(Uart_fd, &fs_read); |
| 115 | 113 | ||
| 116 | - memset(args->Message,0,sizeof(args->Message)); //清空接收数组 | 114 | + memset(args->Message, 0, sizeof(args->Message)); // 清空接收数组 |
| 115 | + args->ResLen = 0; | ||
| 116 | + args->MessageLength = 0; | ||
| 117 | 117 | ||
| 118 | while (1) | 118 | while (1) |
| 119 | { | 119 | { |
| 120 | 120 | ||
| 121 | - //检查fs_read套节字是否有数据 | ||
| 122 | - select(Uart_fd+1, &fs_read, NULL, NULL, NULL); | ||
| 123 | - delayMs(3); //加多了可能导致实时播放难恢复,以及声音间隔 3ms32字节 会向上约1个3ms opus一帧80字节 | 121 | + // 检查fs_read套节字是否有数据 |
| 122 | + select(Uart_fd + 1, &fs_read, NULL, NULL, NULL); | ||
| 123 | + delayMs(3); // 加多了可能导致实时播放难恢复,以及声音间隔 3ms32字节 会向上约1个3ms opus一帧80字节 | ||
| 124 | 124 | ||
| 125 | if (FD_ISSET(Uart_fd, &fs_read)) | 125 | if (FD_ISSET(Uart_fd, &fs_read)) |
| 126 | { | 126 | { |
| @@ -128,15 +128,14 @@ static void *UartDeal_rece(void *arg) | @@ -128,15 +128,14 @@ static void *UartDeal_rece(void *arg) | ||
| 128 | // 如果有数据就加锁 | 128 | // 如果有数据就加锁 |
| 129 | pthread_mutex_lock(&args->mutex); | 129 | pthread_mutex_lock(&args->mutex); |
| 130 | 130 | ||
| 131 | - //1、读取串口内容 ret 接收长度 getbuf 获取的字符 | 131 | + // 1、读取串口内容 ret 接收长度 getbuf 获取的字符 |
| 132 | ResidualLength = args->MessageLength; | 132 | ResidualLength = args->MessageLength; |
| 133 | - args->MessageLength = read(Uart_fd ,&(args->Message[args->MessageLength]), ( sizeof(args->Message) - ResidualLength) ) + ResidualLength; | 133 | + args->MessageLength = read(Uart_fd, &(args->Message[args->MessageLength]), (sizeof(args->Message) - ResidualLength)) + ResidualLength; |
| 134 | 134 | ||
| 135 | // 通知线程 | 135 | // 通知线程 |
| 136 | pthread_cond_signal(&args->cond); | 136 | pthread_cond_signal(&args->cond); |
| 137 | pthread_mutex_unlock(&args->mutex); // 解锁 | 137 | pthread_mutex_unlock(&args->mutex); // 解锁 |
| 138 | } | 138 | } |
| 139 | - | ||
| 140 | } | 139 | } |
| 141 | } | 140 | } |
| 142 | 141 | ||
| @@ -146,11 +145,11 @@ static void *UartDeal_rece(void *arg) | @@ -146,11 +145,11 @@ static void *UartDeal_rece(void *arg) | ||
| 146 | * | 145 | * |
| 147 | * ***/ | 146 | * ***/ |
| 148 | // 串口数据处理线程函数 | 147 | // 串口数据处理线程函数 |
| 149 | -static void* UartDeal_deal(void* arg) | 148 | +static void *UartDeal_deal(void *arg) |
| 150 | { | 149 | { |
| 151 | - s_SerialArgs *args = (s_SerialArgs*)arg; | 150 | + s_SerialArgs *args = (s_SerialArgs *)arg; |
| 152 | 151 | ||
| 153 | - static int ResidualLength = 0; //未处理数据长度 | 152 | + static int ResidualLength = 0; // 未处理数据长度 |
| 154 | 153 | ||
| 155 | while (1) | 154 | while (1) |
| 156 | { | 155 | { |
| @@ -158,19 +157,39 @@ static void* UartDeal_deal(void* arg) | @@ -158,19 +157,39 @@ static void* UartDeal_deal(void* arg) | ||
| 158 | // 加锁 | 157 | // 加锁 |
| 159 | pthread_mutex_lock(&args->mutex); | 158 | pthread_mutex_lock(&args->mutex); |
| 160 | 159 | ||
| 161 | - //等候接收线程的通知 | 160 | + // 等候接收线程的通知 |
| 162 | pthread_cond_wait(&args->cond, &args->mutex); | 161 | pthread_cond_wait(&args->cond, &args->mutex); |
| 163 | 162 | ||
| 164 | - while (args->MessageLength > 0) | 163 | + if (args->MessageLength > 0) |
| 165 | { | 164 | { |
| 165 | + //清除错误的多余半帧 | ||
| 166 | + if (args->Message[args->ResLen] == 0x5A && (args->ResLen != 0) ) //证明前面有半段帧,但是第二轮也没给补上 | ||
| 167 | + { | ||
| 168 | + int temp_num; | ||
| 169 | + temp_num = args->MessageLength - args->ResLen; | ||
| 170 | + if (temp_num < 0) | ||
| 171 | + { | ||
| 172 | + temp_num = 0; | ||
| 173 | + } | ||
| 166 | 174 | ||
| 167 | - //处理数据 | 175 | + memcpy(args->Message, &(args->Message[args->ResLen]), temp_num); |
| 176 | + memset(&args->Message[temp_num], 0, (args->MessageLength - temp_num)); | ||
| 177 | + args->MessageLength = temp_num; | ||
| 178 | + args->ResLen = 0; | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + // 处理数据 | ||
| 168 | ResidualLength = UartDeal_Recv_interface(args->UartFd, args->Message, args->MessageLength); | 182 | ResidualLength = UartDeal_Recv_interface(args->UartFd, args->Message, args->MessageLength); |
| 169 | 183 | ||
| 170 | - memcpy(args->Message, &(args->Message[args->MessageLength-ResidualLength]), ResidualLength); | 184 | + memcpy(args->Message, &(args->Message[args->MessageLength - ResidualLength]), ResidualLength); |
| 171 | memset(&(args->Message[ResidualLength]), 0, (sizeof(args->Message) - ResidualLength)); | 185 | memset(&(args->Message[ResidualLength]), 0, (sizeof(args->Message) - ResidualLength)); |
| 172 | args->MessageLength = ResidualLength; | 186 | args->MessageLength = ResidualLength; |
| 173 | - | 187 | + args->ResLen = ResidualLength; |
| 188 | + } | ||
| 189 | + else | ||
| 190 | + { | ||
| 191 | + memset(args->Message, 0, sizeof(args->Message)); | ||
| 192 | + args->MessageLength = 0; | ||
| 174 | } | 193 | } |
| 175 | 194 | ||
| 176 | pthread_mutex_unlock(&args->mutex); // 解锁 | 195 | pthread_mutex_unlock(&args->mutex); // 解锁 |
| @@ -179,7 +198,7 @@ static void* UartDeal_deal(void* arg) | @@ -179,7 +198,7 @@ static void* UartDeal_deal(void* arg) | ||
| 179 | 198 | ||
| 180 | /* | 199 | /* |
| 181 | 200 | ||
| 182 | - 数据排出函数 | 201 | + 数据排出函数s |
| 183 | 202 | ||
| 184 | */ | 203 | */ |
| 185 | static int UartDeal_Recv_Ouput(int Uart_fd, unsigned char *getbuf, int ReadLen) | 204 | static int UartDeal_Recv_Ouput(int Uart_fd, unsigned char *getbuf, int ReadLen) |
| @@ -198,7 +217,7 @@ static int UartDeal_Recv_Ouput(int Uart_fd, unsigned char *getbuf, int ReadLen) | @@ -198,7 +217,7 @@ static int UartDeal_Recv_Ouput(int Uart_fd, unsigned char *getbuf, int ReadLen) | ||
| 198 | } | 217 | } |
| 199 | else | 218 | else |
| 200 | { | 219 | { |
| 201 | - USER_LOG_ERROR("接收到的数据不是从正常串口来的"); | 220 | + JZSDK_LOG_ERROR("接收到的数据不是从正常串口来的"); |
| 202 | return 0; | 221 | return 0; |
| 203 | } | 222 | } |
| 204 | } | 223 | } |
| @@ -212,66 +231,66 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | @@ -212,66 +231,66 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | ||
| 212 | { | 231 | { |
| 213 | if (Uart_fd == Uart_DEV1_fd) | 232 | if (Uart_fd == Uart_DEV1_fd) |
| 214 | { | 233 | { |
| 215 | - USER_LOG_INFO("串口-设备1号,接受到数据len: %d", getbufLen); | 234 | + JZSDK_LOG_INFO("串口-设备1号,接受到数据len: %d", getbufLen); |
| 216 | } | 235 | } |
| 217 | else if (Uart_fd == Uart_DEV2_fd) | 236 | else if (Uart_fd == Uart_DEV2_fd) |
| 218 | { | 237 | { |
| 219 | - USER_LOG_INFO("串口-设备2号,接受到数据len: %d ", getbufLen); | 238 | + JZSDK_LOG_INFO("串口-设备2号,接受到数据len: %d ", getbufLen); |
| 220 | } | 239 | } |
| 221 | else if (Uart_fd == Uart_4G_fd) | 240 | else if (Uart_fd == Uart_4G_fd) |
| 222 | { | 241 | { |
| 223 | - USER_LOG_INFO("串口-设备4G,接受到数据len: %d ", getbufLen); | 242 | + JZSDK_LOG_INFO("串口-设备4G,接受到数据len: %d ", getbufLen); |
| 224 | } | 243 | } |
| 225 | else | 244 | else |
| 226 | { | 245 | { |
| 227 | - USER_LOG_ERROR("接收到的数据不是从正常串口来的"); | 246 | + JZSDK_LOG_ERROR("接收到的数据不是从正常串口来的"); |
| 228 | return 0; | 247 | return 0; |
| 229 | } | 248 | } |
| 230 | 249 | ||
| 231 | - //是否要打印内容 | 250 | + // // 是否要打印内容 |
| 232 | // printf("getbuf: %s\n", getbuf); | 251 | // printf("getbuf: %s\n", getbuf); |
| 233 | - // for (int i = 0; i < len; i++) | 252 | + // for (int i = 0; i < getbufLen; i++) |
| 234 | // { | 253 | // { |
| 235 | - // printf("%x ",getbuf[i]); | 254 | + // printf("%x ", getbuf[i]); |
| 236 | // } | 255 | // } |
| 237 | // printf("\n"); | 256 | // printf("\n"); |
| 238 | 257 | ||
| 239 | - int HaveReadLen = 0; //已读长度 | ||
| 240 | - int HaveDealLen = 0; //已处理长度 | ||
| 241 | - int FrameFlag = 0; //帧标志 | 258 | + int HaveReadLen = 0; // 已读长度 |
| 259 | + int HaveDealLen = 0; // 已处理长度 | ||
| 260 | + int FrameFlag = 0; // 帧标志 | ||
| 242 | int FrameLen = 0; | 261 | int FrameLen = 0; |
| 243 | 262 | ||
| 244 | - //检索出帧数据 | 263 | + // 检索出帧数据 |
| 245 | 264 | ||
| 246 | - //遍历数据找帧头,直到数据的倒数第4位,如果这里有帧,帧存在帧头3位+数据长度两位 | 265 | + // 遍历数据找帧头,直到数据的倒数第4位,如果这里有帧,帧存在帧头3位+数据长度两位 |
| 247 | for (HaveReadLen = 0; HaveReadLen < getbufLen - 4; HaveReadLen++) | 266 | for (HaveReadLen = 0; HaveReadLen < getbufLen - 4; HaveReadLen++) |
| 248 | { | 267 | { |
| 249 | - //1、如果找到 5A 5B 6A 6B 判断是否是帧 | 268 | + // 1、如果找到 5A 5B 6A 6B 判断是否是帧 |
| 250 | switch (getbuf[HaveReadLen]) | 269 | switch (getbuf[HaveReadLen]) |
| 251 | { | 270 | { |
| 252 | case 0x5A: | 271 | case 0x5A: |
| 253 | - if (getbuf[HaveReadLen+1] == 0x5A || getbuf[HaveReadLen+2] == 0x77) | 272 | + if (getbuf[HaveReadLen + 1] == 0x5A || getbuf[HaveReadLen + 2] == 0x77) |
| 254 | { | 273 | { |
| 255 | FrameFlag = 0x5A; | 274 | FrameFlag = 0x5A; |
| 256 | } | 275 | } |
| 257 | break; | 276 | break; |
| 258 | 277 | ||
| 259 | case 0x5B: | 278 | case 0x5B: |
| 260 | - if (getbuf[HaveReadLen+1] == 0x5B || getbuf[HaveReadLen+2] == 0x77) | 279 | + if (getbuf[HaveReadLen + 1] == 0x5B || getbuf[HaveReadLen + 2] == 0x77) |
| 261 | { | 280 | { |
| 262 | FrameFlag = 0x5B; | 281 | FrameFlag = 0x5B; |
| 263 | } | 282 | } |
| 264 | break; | 283 | break; |
| 265 | 284 | ||
| 266 | case 0x6A: | 285 | case 0x6A: |
| 267 | - if (getbuf[HaveReadLen+1] == 0x6A || getbuf[HaveReadLen+2] == 0x77) | 286 | + if (getbuf[HaveReadLen + 1] == 0x6A || getbuf[HaveReadLen + 2] == 0x77) |
| 268 | { | 287 | { |
| 269 | FrameFlag = 0x6A; | 288 | FrameFlag = 0x6A; |
| 270 | } | 289 | } |
| 271 | break; | 290 | break; |
| 272 | 291 | ||
| 273 | case 0x6B: | 292 | case 0x6B: |
| 274 | - if (getbuf[HaveReadLen+1] == 0x6B || getbuf[HaveReadLen+2] == 0x77) | 293 | + if (getbuf[HaveReadLen + 1] == 0x6B || getbuf[HaveReadLen + 2] == 0x77) |
| 275 | { | 294 | { |
| 276 | FrameFlag = 0x6B; | 295 | FrameFlag = 0x6B; |
| 277 | } | 296 | } |
| @@ -281,28 +300,28 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | @@ -281,28 +300,28 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | ||
| 281 | break; | 300 | break; |
| 282 | } | 301 | } |
| 283 | 302 | ||
| 284 | - //2、如果没有帧头,直接continue | 303 | + // 2、如果没有帧头,直接continue |
| 285 | if (FrameFlag == 0) | 304 | if (FrameFlag == 0) |
| 286 | { | 305 | { |
| 287 | continue; | 306 | continue; |
| 288 | } | 307 | } |
| 289 | 308 | ||
| 290 | - //3、如果有帧头,则先判断前面有没有多余的数据残留,并将其排出到处理线程 | ||
| 291 | - if ( (HaveReadLen - HaveDealLen) > 0) | 309 | + // 3、如果有帧头,则先判断前面有没有多余的数据残留,并将其排出到处理线程 |
| 310 | + if ((HaveReadLen - HaveDealLen) > 0) | ||
| 292 | { | 311 | { |
| 293 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); | 312 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); |
| 294 | HaveDealLen = HaveReadLen; | 313 | HaveDealLen = HaveReadLen; |
| 295 | } | 314 | } |
| 296 | 315 | ||
| 297 | - //4、检查帧长度是否超过数组剩余内容 | 316 | + // 4、检查帧长度是否超过数组剩余内容 |
| 298 | FrameLen = (getbuf[3] << 8) + getbuf[4]; | 317 | FrameLen = (getbuf[3] << 8) + getbuf[4]; |
| 299 | if (FrameLen > (getbufLen - HaveReadLen)) | 318 | if (FrameLen > (getbufLen - HaveReadLen)) |
| 300 | { | 319 | { |
| 301 | - //直接跳出for循环 | 320 | + // 直接跳出for循环 |
| 302 | break; | 321 | break; |
| 303 | } | 322 | } |
| 304 | 323 | ||
| 305 | - //5、以上检查都没问题,则正常输出帧 | 324 | + // 5、以上检查都没问题,则正常输出帧 |
| 306 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveReadLen], FrameLen); | 325 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveReadLen], FrameLen); |
| 307 | HaveReadLen = HaveReadLen + FrameLen; | 326 | HaveReadLen = HaveReadLen + FrameLen; |
| 308 | FrameLen = 0; | 327 | FrameLen = 0; |
| @@ -310,113 +329,112 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | @@ -310,113 +329,112 @@ static int UartDeal_Recv_interface(int Uart_fd, unsigned char *getbuf, int getb | ||
| 310 | FrameFlag = 0; | 329 | FrameFlag = 0; |
| 311 | } | 330 | } |
| 312 | 331 | ||
| 313 | - //如果没有数据残留了 | 332 | + // 如果没有数据残留了 |
| 314 | if (HaveDealLen >= getbufLen) | 333 | if (HaveDealLen >= getbufLen) |
| 315 | { | 334 | { |
| 316 | - //printf("HaveReadLen:%d HaveDealLen%d getbufLen:%d\n",HaveReadLen,HaveDealLen,getbufLen); | 335 | + // printf("HaveReadLen:%d HaveDealLen%d getbufLen:%d\n",HaveReadLen,HaveDealLen,getbufLen); |
| 317 | return 0; | 336 | return 0; |
| 318 | } | 337 | } |
| 319 | 338 | ||
| 320 | - //如果是有帧头的情况跳出的,说明是帧被切了,需要返回帧长度给接收线程 | 339 | + // 如果是有帧头的情况跳出的,说明是帧被切了,需要返回帧长度给接收线程 |
| 321 | if (FrameFlag != 0) | 340 | if (FrameFlag != 0) |
| 322 | { | 341 | { |
| 323 | - //1、判断帧的长度会不会不合理,帧的长度最大为文件名帧,其长度为9+2+128 | ||
| 324 | - if (FrameLen > (9+2+128) ) | 342 | + // 1、判断帧的长度会不会不合理,帧的长度最大为文件名帧,其长度为9+2+128 |
| 343 | + if (FrameLen > (9 + 2 + 128)) | ||
| 325 | { | 344 | { |
| 326 | - //将其排出不返回 | ||
| 327 | - UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveReadLen], (getbufLen-HaveReadLen)); | 345 | + // 将其排出不返回 |
| 346 | + UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveReadLen], (getbufLen - HaveReadLen)); | ||
| 328 | HaveDealLen = HaveReadLen; | 347 | HaveDealLen = HaveReadLen; |
| 329 | return 0; | 348 | return 0; |
| 330 | } | 349 | } |
| 331 | 350 | ||
| 332 | - //2、如果合理,则返回剩余长度 | ||
| 333 | - return (getbufLen-HaveDealLen); | 351 | + // 2、如果合理,则返回剩余长度 |
| 352 | + return (getbufLen - HaveDealLen); | ||
| 334 | } | 353 | } |
| 335 | 354 | ||
| 336 | - //如果是没有帧头的情况下跳出的 | ||
| 337 | - //1、先检查 未经检查最后 最后4 3位 | ||
| 338 | - for ( ; HaveReadLen < getbufLen - 2; HaveReadLen++) | 355 | + // 如果是没有帧头的情况下跳出的 |
| 356 | + // 1、先检查 未经检查最后 最后4 3位 | ||
| 357 | + for (; HaveReadLen < getbufLen - 2; HaveReadLen++) | ||
| 339 | { | 358 | { |
| 340 | - if ( (getbuf[HaveReadLen] == 0x5A && getbuf[HaveReadLen+1] == 0x5A &&getbuf[HaveReadLen+2] == 0x77) || | ||
| 341 | - (getbuf[HaveReadLen] == 0x5B && getbuf[HaveReadLen+1] == 0x5B &&getbuf[HaveReadLen+2] == 0x77) || | ||
| 342 | - (getbuf[HaveReadLen] == 0x6A && getbuf[HaveReadLen+1] == 0x6A &&getbuf[HaveReadLen+2] == 0x77) || | ||
| 343 | - (getbuf[HaveReadLen] == 0x6B && getbuf[HaveReadLen+1] == 0x6B &&getbuf[HaveReadLen+2] == 0x77) ) | 359 | + if ((getbuf[HaveReadLen] == 0x5A && getbuf[HaveReadLen + 1] == 0x5A && getbuf[HaveReadLen + 2] == 0x77) || |
| 360 | + (getbuf[HaveReadLen] == 0x5B && getbuf[HaveReadLen + 1] == 0x5B && getbuf[HaveReadLen + 2] == 0x77) || | ||
| 361 | + (getbuf[HaveReadLen] == 0x6A && getbuf[HaveReadLen + 1] == 0x6A && getbuf[HaveReadLen + 2] == 0x77) || | ||
| 362 | + (getbuf[HaveReadLen] == 0x6B && getbuf[HaveReadLen + 1] == 0x6B && getbuf[HaveReadLen + 2] == 0x77)) | ||
| 344 | { | 363 | { |
| 345 | - if ( (HaveReadLen - HaveDealLen) > 0) | 364 | + if ((HaveReadLen - HaveDealLen) > 0) |
| 346 | { | 365 | { |
| 347 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); | 366 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); |
| 348 | HaveDealLen = HaveReadLen; | 367 | HaveDealLen = HaveReadLen; |
| 349 | } | 368 | } |
| 350 | 369 | ||
| 351 | - return (getbufLen-HaveDealLen); | 370 | + return (getbufLen - HaveDealLen); |
| 352 | } | 371 | } |
| 353 | } | 372 | } |
| 354 | 373 | ||
| 355 | - //2、检查最后两位 | ||
| 356 | - if ( (getbuf[HaveReadLen] == 0x5A && getbuf[HaveReadLen+1] == 0x5A ) || | ||
| 357 | - (getbuf[HaveReadLen] == 0x5B && getbuf[HaveReadLen+1] == 0x5B ) || | ||
| 358 | - (getbuf[HaveReadLen] == 0x6A && getbuf[HaveReadLen+1] == 0x6A ) || | ||
| 359 | - (getbuf[HaveReadLen] == 0x6B && getbuf[HaveReadLen+1] == 0x6B ) ) | 374 | + // 2、检查最后两位 |
| 375 | + if ((getbuf[HaveReadLen] == 0x5A && getbuf[HaveReadLen + 1] == 0x5A) || | ||
| 376 | + (getbuf[HaveReadLen] == 0x5B && getbuf[HaveReadLen + 1] == 0x5B) || | ||
| 377 | + (getbuf[HaveReadLen] == 0x6A && getbuf[HaveReadLen + 1] == 0x6A) || | ||
| 378 | + (getbuf[HaveReadLen] == 0x6B && getbuf[HaveReadLen + 1] == 0x6B)) | ||
| 360 | { | 379 | { |
| 361 | - if ( (HaveReadLen - HaveDealLen) > 0) | 380 | + if ((HaveReadLen - HaveDealLen) > 0) |
| 362 | { | 381 | { |
| 363 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); | 382 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); |
| 364 | HaveDealLen = HaveReadLen; | 383 | HaveDealLen = HaveReadLen; |
| 365 | } | 384 | } |
| 366 | 385 | ||
| 367 | - return (getbufLen-HaveDealLen); | 386 | + return (getbufLen - HaveDealLen); |
| 368 | } | 387 | } |
| 369 | HaveReadLen++; | 388 | HaveReadLen++; |
| 370 | 389 | ||
| 371 | - //1、检查最后一位 | ||
| 372 | - if ( getbuf[HaveReadLen] == 0x5A || | 390 | + // 1、检查最后一位 |
| 391 | + if (getbuf[HaveReadLen] == 0x5A || | ||
| 373 | getbuf[HaveReadLen] == 0x5B || | 392 | getbuf[HaveReadLen] == 0x5B || |
| 374 | getbuf[HaveReadLen] == 0x6A || | 393 | getbuf[HaveReadLen] == 0x6A || |
| 375 | - getbuf[HaveReadLen] == 0x6B ) | 394 | + getbuf[HaveReadLen] == 0x6B) |
| 376 | { | 395 | { |
| 377 | - if ( (HaveReadLen - HaveDealLen) > 0) | 396 | + if ((HaveReadLen - HaveDealLen) > 0) |
| 378 | { | 397 | { |
| 379 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); | 398 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); |
| 380 | HaveDealLen = HaveReadLen; | 399 | HaveDealLen = HaveReadLen; |
| 381 | } | 400 | } |
| 382 | 401 | ||
| 383 | - return (getbufLen-HaveDealLen); | 402 | + return (getbufLen - HaveDealLen); |
| 384 | } | 403 | } |
| 385 | HaveReadLen++; | 404 | HaveReadLen++; |
| 386 | 405 | ||
| 387 | - //都检查完了,还是没有帧头在里面, 将剩余的所有数据排出 | 406 | + // 都检查完了,还是没有帧头在里面, 将剩余的所有数据排出 |
| 388 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); | 407 | UartDeal_Recv_Ouput(Uart_fd, &getbuf[HaveDealLen], (HaveReadLen - HaveDealLen)); |
| 389 | 408 | ||
| 390 | - //printf("HaveReadLen:%d HaveDealLen%d getbufLen:%d\n",HaveReadLen,HaveDealLen,getbufLen); | 409 | + // printf("HaveReadLen:%d HaveDealLen%d getbufLen:%d\n",HaveReadLen,HaveDealLen,getbufLen); |
| 391 | 410 | ||
| 392 | return 0; | 411 | return 0; |
| 393 | } | 412 | } |
| 394 | 413 | ||
| 395 | - | ||
| 396 | /**************** | 414 | /**************** |
| 397 | * | 415 | * |
| 398 | * | 416 | * |
| 399 | * 发送函数 | 417 | * 发送函数 |
| 400 | * | 418 | * |
| 401 | * ****************/ | 419 | * ****************/ |
| 402 | -int JZsdk_Uart_UartSend(int UartPort ,unsigned char *send, int num) | 420 | +int JZsdk_Uart_UartSend(int UartPort, unsigned char *send, int num) |
| 403 | { | 421 | { |
| 404 | if (UartPort == UART_4G) | 422 | if (UartPort == UART_4G) |
| 405 | { | 423 | { |
| 406 | printf("向4G设备发送\n"); | 424 | printf("向4G设备发送\n"); |
| 407 | - write(Uart_4G_fd,send, num); | 425 | + write(Uart_4G_fd, send, num); |
| 408 | return 0; | 426 | return 0; |
| 409 | } | 427 | } |
| 410 | else if (UartPort == UART_DEV_1) | 428 | else if (UartPort == UART_DEV_1) |
| 411 | { | 429 | { |
| 412 | printf("向串口1号设备发送\n"); | 430 | printf("向串口1号设备发送\n"); |
| 413 | - write(Uart_DEV1_fd,send, num); | 431 | + write(Uart_DEV1_fd, send, num); |
| 414 | return 0; | 432 | return 0; |
| 415 | } | 433 | } |
| 416 | else if (UartPort == UART_DEV_2) | 434 | else if (UartPort == UART_DEV_2) |
| 417 | { | 435 | { |
| 418 | printf("向串口2号设备发送\n"); | 436 | printf("向串口2号设备发送\n"); |
| 419 | - write(Uart_DEV2_fd,send, num); | 437 | + write(Uart_DEV2_fd, send, num); |
| 420 | return 0; | 438 | return 0; |
| 421 | } | 439 | } |
| 422 | } | 440 | } |
| @@ -4,7 +4,12 @@ | @@ -4,7 +4,12 @@ | ||
| 4 | 4 | ||
| 5 | #include <pthread.h> | 5 | #include <pthread.h> |
| 6 | 6 | ||
| 7 | -#include "Gimbal_UartDeal.h" | 7 | +#include "Gimbal_H3_H150ST_UartDeal.h" |
| 8 | +#include "Gimbal_H3_H150ST.h" | ||
| 9 | +#include "BaseConfig.h" | ||
| 10 | + | ||
| 11 | +#include "UartConnection/UartConnection.h" | ||
| 12 | + | ||
| 8 | 13 | ||
| 9 | /* Private constants ---------------------------------------------------------*/ | 14 | /* Private constants ---------------------------------------------------------*/ |
| 10 | #define MOTOR_FILE_PATH "/root/motor" | 15 | #define MOTOR_FILE_PATH "/root/motor" |
| @@ -22,6 +27,17 @@ static int H3_H150ST_motor_precise_adjustment_pitch =0;//默认H3微调值为0 | @@ -22,6 +27,17 @@ static int H3_H150ST_motor_precise_adjustment_pitch =0;//默认H3微调值为0 | ||
| 22 | static void *H3_H150ST_Motor_control(void *arg); | 27 | static void *H3_H150ST_Motor_control(void *arg); |
| 23 | static void H3_H150ST_Write_MotorAdjustmentPitch(int MotorAdjustmentPitch); | 28 | static void H3_H150ST_Write_MotorAdjustmentPitch(int MotorAdjustmentPitch); |
| 24 | static int H3_H150ST_Read_MotorAdjustmentPitch(void); | 29 | static int H3_H150ST_Read_MotorAdjustmentPitch(void); |
| 30 | + | ||
| 31 | +T_JZsdkReturnCode Gimbal_H3_H150ST_init_motor() | ||
| 32 | +{ | ||
| 33 | + int Uart_fd = 0; | ||
| 34 | + //1、串口初始化 | ||
| 35 | + Uart_fd = UartConnection_UartEnabled(GIMBAL_UART_NUM, GIMBAL_UART_BITRATE); | ||
| 36 | + | ||
| 37 | + //2、串口接收初始化 | ||
| 38 | + Gimbal_H3_H150ST_UartDeal_Receive(Uart_fd); | ||
| 39 | +} | ||
| 40 | + | ||
| 25 | //设置角度 | 41 | //设置角度 |
| 26 | int H3_H150ST_Gimbal_SetAngle(int angle) | 42 | int H3_H150ST_Gimbal_SetAngle(int angle) |
| 27 | { | 43 | { |
| @@ -49,6 +65,9 @@ static void *H3_H150ST_Motor_control(void *arg) | @@ -49,6 +65,9 @@ static void *H3_H150ST_Motor_control(void *arg) | ||
| 49 | //传入的角度 -900~0 | 65 | //传入的角度 -900~0 |
| 50 | int angle = *(int*)arg; | 66 | int angle = *(int*)arg; |
| 51 | 67 | ||
| 68 | + //调整云台微调值 | ||
| 69 | + angle = angle + H3_H150ST_motor_precise_adjustment_pitch; | ||
| 70 | + | ||
| 52 | //调整为PWM值 1000~2000 | 71 | //调整为PWM值 1000~2000 |
| 53 | int angle_PWM = 0; | 72 | int angle_PWM = 0; |
| 54 | 73 | ||
| @@ -66,11 +85,45 @@ static void *H3_H150ST_Motor_control(void *arg) | @@ -66,11 +85,45 @@ static void *H3_H150ST_Motor_control(void *arg) | ||
| 66 | char send_angle[]={0x5a,0x00,0x00,0xa5}; | 85 | char send_angle[]={0x5a,0x00,0x00,0xa5}; |
| 67 | send_angle[1]=(char )(angle_PWM); | 86 | send_angle[1]=(char )(angle_PWM); |
| 68 | send_angle[2]=(char )(angle_PWM>>8); | 87 | send_angle[2]=(char )(angle_PWM>>8); |
| 69 | - Gimbal_UartSend(send_angle, 4); | 88 | + Gimbal_H3_H150ST_UartDeal_UartSend(send_angle, 4); |
| 70 | 89 | ||
| 71 | free(arg); // 在线程函数中释放动态内存 | 90 | free(arg); // 在线程函数中释放动态内存 |
| 72 | } | 91 | } |
| 73 | 92 | ||
| 93 | +//H150ST云台范围 | ||
| 94 | +T_JZsdkReturnCode H3_H150ST_SetGimbalRange(int Range) | ||
| 95 | +{ | ||
| 96 | + uint8_t set_min_motor[]={0x4A,0x00,0x00,0xA4}; | ||
| 97 | + uint8_t set_max_motor[]={0x6A,0x00,0x00,0xA6}; | ||
| 98 | + | ||
| 99 | + if (Range == 0xFF) | ||
| 100 | + { | ||
| 101 | + printf("设置H150ST云台最大值\n"); | ||
| 102 | + Gimbal_H3_H150ST_UartDeal_UartSend(set_max_motor, 4); | ||
| 103 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 104 | + } | ||
| 105 | + else if (Range == 0x00) | ||
| 106 | + { | ||
| 107 | + printf("设置H150ST云台最小值\n"); | ||
| 108 | + Gimbal_H3_H150ST_UartDeal_UartSend(set_min_motor, 4); | ||
| 109 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +//云台微调 | ||
| 116 | +T_JZsdkReturnCode Gimbal_H3_H150ST_set_PitchFineTuning(int Pitch) | ||
| 117 | +{ | ||
| 118 | + //微调的角度值 提高Pitch | ||
| 119 | + H3_H150ST_motor_precise_adjustment_pitch += Pitch; | ||
| 120 | + | ||
| 121 | + //写入本地文件 | ||
| 122 | + H3_H150ST_Write_MotorAdjustmentPitch(H3_H150ST_motor_precise_adjustment_pitch); | ||
| 123 | + | ||
| 124 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 125 | + | ||
| 126 | +} | ||
| 74 | 127 | ||
| 75 | //微调向上 | 128 | //微调向上 |
| 76 | void H3_H150ST_gimbal_up(void) | 129 | void H3_H150ST_gimbal_up(void) |
| @@ -92,6 +145,12 @@ void H3_H150ST_gimbal_down(void) | @@ -92,6 +145,12 @@ void H3_H150ST_gimbal_down(void) | ||
| 92 | H3_H150ST_Write_MotorAdjustmentPitch(H3_H150ST_motor_precise_adjustment_pitch); | 145 | H3_H150ST_Write_MotorAdjustmentPitch(H3_H150ST_motor_precise_adjustment_pitch); |
| 93 | } | 146 | } |
| 94 | 147 | ||
| 148 | +//查询云台微调值 | ||
| 149 | +int Gimbal_H3_H150ST_CheckStatus_GimbalFineTuning(int *AdjustmentPitch) | ||
| 150 | +{ | ||
| 151 | + *AdjustmentPitch = H3_H150ST_motor_precise_adjustment_pitch; | ||
| 152 | +} | ||
| 153 | + | ||
| 95 | //从文件中读出电机微调值 | 154 | //从文件中读出电机微调值 |
| 96 | static int H3_H150ST_Read_MotorAdjustmentPitch(void) | 155 | static int H3_H150ST_Read_MotorAdjustmentPitch(void) |
| 97 | { | 156 | { |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | #define GIMBAL_H3_H150ST_H | 11 | #define GIMBAL_H3_H150ST_H |
| 12 | 12 | ||
| 13 | /* Includes ------------------------------------------------------------------*/ | 13 | /* Includes ------------------------------------------------------------------*/ |
| 14 | +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
| 14 | 15 | ||
| 15 | #ifdef __cplusplus | 16 | #ifdef __cplusplus |
| 16 | extern "C" { | 17 | extern "C" { |
| @@ -23,6 +24,10 @@ extern "C" { | @@ -23,6 +24,10 @@ extern "C" { | ||
| 23 | 24 | ||
| 24 | /* Exported functions --------------------------------------------------------*/ | 25 | /* Exported functions --------------------------------------------------------*/ |
| 25 | int H3_H150ST_Gimbal_SetAngle(int angle); | 26 | int H3_H150ST_Gimbal_SetAngle(int angle); |
| 27 | +int Gimbal_H3_H150ST_CheckStatus_GimbalFineTuning(int *AdjustmentPitch); | ||
| 28 | +T_JZsdkReturnCode Gimbal_H3_H150ST_init_motor(); | ||
| 29 | +T_JZsdkReturnCode H3_H150ST_SetGimbalRange(int Range); | ||
| 30 | +T_JZsdkReturnCode Gimbal_H3_H150ST_set_PitchFineTuning(int Pitch); | ||
| 26 | 31 | ||
| 27 | 32 | ||
| 28 | #ifdef __cplusplus | 33 | #ifdef __cplusplus |
| @@ -17,7 +17,7 @@ static int Gimbal_Uart_fd = 0; | @@ -17,7 +17,7 @@ static int Gimbal_Uart_fd = 0; | ||
| 17 | 创建一个接收Gimbal的接收线程 | 17 | 创建一个接收Gimbal的接收线程 |
| 18 | 18 | ||
| 19 | ******************************************************************/ | 19 | ******************************************************************/ |
| 20 | -int Gimbal_UartDeal_Receive(int Uart_fd) | 20 | +int Gimbal_H3_H150ST_UartDeal_Receive(int Uart_fd) |
| 21 | { | 21 | { |
| 22 | int ret = 0; | 22 | int ret = 0; |
| 23 | pthread_t Uart_rece_task; | 23 | pthread_t Uart_rece_task; |
| @@ -70,15 +70,6 @@ static void *UartDeal_rece(void *arg) | @@ -70,15 +70,6 @@ static void *UartDeal_rece(void *arg) | ||
| 70 | //1、读取串口内容 ret 接收长度 getbuf 获取的字符 | 70 | //1、读取串口内容 ret 接收长度 getbuf 获取的字符 |
| 71 | memset(getbuf,0,sizeof(getbuf)); //清空接收数组 | 71 | memset(getbuf,0,sizeof(getbuf)); //清空接收数组 |
| 72 | ret = read(Gimbal_Uart_fd,getbuf,sizeof(getbuf)); | 72 | ret = read(Gimbal_Uart_fd,getbuf,sizeof(getbuf)); |
| 73 | - | ||
| 74 | - //printf("Gimbalret: %d Gimbalgetbuf: %s\n", ret, getbuf); | ||
| 75 | - // for (int i = 0; i < ret; i++) | ||
| 76 | - // { | ||
| 77 | - // printf("%x ",getbuf[i]); | ||
| 78 | - // } | ||
| 79 | - // printf("\n"); | ||
| 80 | - | ||
| 81 | - //Comm_4G_RecvCharmDeal(getbuf, ret); | ||
| 82 | } | 73 | } |
| 83 | } | 74 | } |
| 84 | 75 | ||
| @@ -91,7 +82,7 @@ static void *UartDeal_rece(void *arg) | @@ -91,7 +82,7 @@ static void *UartDeal_rece(void *arg) | ||
| 91 | * 发送函数 | 82 | * 发送函数 |
| 92 | * | 83 | * |
| 93 | * ****************/ | 84 | * ****************/ |
| 94 | -int Gimbal_UartSend(unsigned char *send, int num) | 85 | +int Gimbal_H3_H150ST_UartDeal_UartSend(unsigned char *send, int num) |
| 95 | { | 86 | { |
| 96 | 87 | ||
| 97 | write(Gimbal_Uart_fd,send, num); | 88 | write(Gimbal_Uart_fd,send, num); |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | #define GIMBAL_UART_DEAL_H | 11 | #define GIMBAL_UART_DEAL_H |
| 12 | 12 | ||
| 13 | /* Includes ------------------------------------------------------------------*/ | 13 | /* Includes ------------------------------------------------------------------*/ |
| 14 | +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
| 14 | 15 | ||
| 15 | #ifdef __cplusplus | 16 | #ifdef __cplusplus |
| 16 | extern "C" { | 17 | extern "C" { |
| @@ -22,8 +23,8 @@ extern "C" { | @@ -22,8 +23,8 @@ extern "C" { | ||
| 22 | /* Exported types ------------------------------------------------------------*/ | 23 | /* Exported types ------------------------------------------------------------*/ |
| 23 | 24 | ||
| 24 | /* Exported functions --------------------------------------------------------*/ | 25 | /* Exported functions --------------------------------------------------------*/ |
| 25 | -int Gimbal_UartDeal_Receive(int Uart_fd); | ||
| 26 | -int Gimbal_UartSend(unsigned char *send, int num); | 26 | +int Gimbal_H3_H150ST_UartDeal_Receive(int Uart_fd); |
| 27 | +int Gimbal_H3_H150ST_UartDeal_UartSend(unsigned char *send, int num); | ||
| 27 | 28 | ||
| 28 | #ifdef __cplusplus | 29 | #ifdef __cplusplus |
| 29 | } | 30 | } |
| @@ -2,12 +2,9 @@ | @@ -2,12 +2,9 @@ | ||
| 2 | #include <string.h> | 2 | #include <string.h> |
| 3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 4 | 4 | ||
| 5 | -#include "BaseConfig.h" | ||
| 6 | -#include "Gimbal_UartDeal.h" | ||
| 7 | #include "version_choose.h" | 5 | #include "version_choose.h" |
| 8 | #include "Gimbal_H3/Gimbal_H3.h" | 6 | #include "Gimbal_H3/Gimbal_H3.h" |
| 9 | #include "Gimbal_V3S/Gimbal_V3S.h" | 7 | #include "Gimbal_V3S/Gimbal_V3S.h" |
| 10 | -#include "UartConnection/UartConnection.h" | ||
| 11 | #include "Gimbal_InAndOut.h" | 8 | #include "Gimbal_InAndOut.h" |
| 12 | #include "JZsdkLib.h" | 9 | #include "JZsdkLib.h" |
| 13 | 10 | ||
| @@ -31,12 +28,7 @@ int Gimbal_Init() | @@ -31,12 +28,7 @@ int Gimbal_Init() | ||
| 31 | { | 28 | { |
| 32 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 29 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 33 | { | 30 | { |
| 34 | - int Uart_fd = 0; | ||
| 35 | - //1、串口初始化 | ||
| 36 | - Uart_fd = UartConnection_UartEnabled(GIMBAL_UART_NUM, GIMBAL_UART_BITRATE); | ||
| 37 | - | ||
| 38 | - //2、串口接收初始化 | ||
| 39 | - Gimbal_UartDeal_Receive(Uart_fd); | 31 | + Gimbal_H3_H150ST_init_motor(); |
| 40 | } | 32 | } |
| 41 | else if (DEVICE_VERSION == JZ_H10) | 33 | else if (DEVICE_VERSION == JZ_H10) |
| 42 | { | 34 | { |
| @@ -179,13 +171,13 @@ T_JZsdkReturnCode Gimbal_SetGimbalRange(int value) | @@ -179,13 +171,13 @@ T_JZsdkReturnCode Gimbal_SetGimbalRange(int value) | ||
| 179 | 171 | ||
| 180 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 172 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 181 | { | 173 | { |
| 182 | - /* code */ | 174 | + return H3_H150ST_SetGimbalRange(value); |
| 183 | } | 175 | } |
| 184 | 176 | ||
| 185 | 177 | ||
| 186 | if (DEVICE_VERSION == JZ_U3) | 178 | if (DEVICE_VERSION == JZ_U3) |
| 187 | { | 179 | { |
| 188 | - | 180 | + return V3S_U3_SetGimbalRange(value); |
| 189 | } | 181 | } |
| 190 | 182 | ||
| 191 | if (DEVICE_VERSION == JZ_H1T) | 183 | if (DEVICE_VERSION == JZ_H1T) |
| @@ -193,7 +185,7 @@ T_JZsdkReturnCode Gimbal_SetGimbalRange(int value) | @@ -193,7 +185,7 @@ T_JZsdkReturnCode Gimbal_SetGimbalRange(int value) | ||
| 193 | /* code */ | 185 | /* code */ |
| 194 | } | 186 | } |
| 195 | 187 | ||
| 196 | - | 188 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 197 | } | 189 | } |
| 198 | 190 | ||
| 199 | //查询云台微调值 | 191 | //查询云台微调值 |
| @@ -203,13 +195,27 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalFineTuning(int *FineTunigPitch, int * | @@ -203,13 +195,27 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalFineTuning(int *FineTunigPitch, int * | ||
| 203 | 195 | ||
| 204 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 196 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 205 | { | 197 | { |
| 198 | + //1、获取微调值 | ||
| 199 | + Gimbal_H3_H150ST_CheckStatus_GimbalFineTuning(&Gimbal_PitchFineTuning); | ||
| 206 | 200 | ||
| 201 | + //2、回复微调值 | ||
| 202 | + *FineTunigPitch = Gimbal_PitchFineTuning; | ||
| 203 | + *FineTunigYaw = Gimbal_YawFineTuning; | ||
| 204 | + | ||
| 205 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 207 | } | 206 | } |
| 208 | 207 | ||
| 209 | 208 | ||
| 210 | if (DEVICE_VERSION == JZ_U3) | 209 | if (DEVICE_VERSION == JZ_U3) |
| 211 | { | 210 | { |
| 211 | + //1、获取微调值 | ||
| 212 | + Gimbal_V3S_U3_CheckStatus_GimbalFineTuning(&Gimbal_PitchFineTuning); | ||
| 212 | 213 | ||
| 214 | + //2、回复微调值 | ||
| 215 | + *FineTunigPitch = Gimbal_PitchFineTuning; | ||
| 216 | + *FineTunigYaw = Gimbal_YawFineTuning; | ||
| 217 | + | ||
| 218 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 213 | } | 219 | } |
| 214 | 220 | ||
| 215 | if (DEVICE_VERSION == JZ_H1T) | 221 | if (DEVICE_VERSION == JZ_H1T) |
| @@ -226,7 +232,7 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalFineTuning(int *FineTunigPitch, int * | @@ -226,7 +232,7 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalFineTuning(int *FineTunigPitch, int * | ||
| 226 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 232 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 227 | } | 233 | } |
| 228 | 234 | ||
| 229 | - | 235 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 230 | } | 236 | } |
| 231 | 237 | ||
| 232 | //收到云台pitch微调值 | 238 | //收到云台pitch微调值 |
| @@ -234,25 +240,24 @@ T_JZsdkReturnCode Gimbal_Obtain_GimbalFineTuning(int pitch) | @@ -234,25 +240,24 @@ T_JZsdkReturnCode Gimbal_Obtain_GimbalFineTuning(int pitch) | ||
| 234 | { | 240 | { |
| 235 | printf("收到云台pitch云台微调值\n"); | 241 | printf("收到云台pitch云台微调值\n"); |
| 236 | 242 | ||
| 237 | - Gimbal_PitchFineTuning = pitch; | ||
| 238 | - | ||
| 239 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 243 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 240 | { | 244 | { |
| 241 | - | 245 | + //无操作 |
| 242 | } | 246 | } |
| 243 | 247 | ||
| 244 | 248 | ||
| 245 | if (DEVICE_VERSION == JZ_U3) | 249 | if (DEVICE_VERSION == JZ_U3) |
| 246 | { | 250 | { |
| 247 | - | 251 | + //无操作 |
| 248 | } | 252 | } |
| 249 | 253 | ||
| 250 | if (DEVICE_VERSION == JZ_H1T) | 254 | if (DEVICE_VERSION == JZ_H1T) |
| 251 | { | 255 | { |
| 252 | - //无操作 | ||
| 253 | - //毕竟是t60s返回来的值 | 256 | + Gimbal_PitchFineTuning = pitch; |
| 254 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 257 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 255 | } | 258 | } |
| 259 | + | ||
| 260 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 256 | } | 261 | } |
| 257 | 262 | ||
| 258 | //设置云台pitch微调值 | 263 | //设置云台pitch微调值 |
| @@ -265,18 +270,18 @@ T_JZsdkReturnCode Gimbal_Set_PitchFineTuning(int DeviceName ,int pitch) | @@ -265,18 +270,18 @@ T_JZsdkReturnCode Gimbal_Set_PitchFineTuning(int DeviceName ,int pitch) | ||
| 265 | 270 | ||
| 266 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 271 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 267 | { | 272 | { |
| 268 | - | 273 | + return Gimbal_H3_H150ST_set_PitchFineTuning(pitch); |
| 269 | } | 274 | } |
| 270 | 275 | ||
| 271 | 276 | ||
| 272 | if (DEVICE_VERSION == JZ_U3) | 277 | if (DEVICE_VERSION == JZ_U3) |
| 273 | { | 278 | { |
| 274 | - | 279 | + return Gimbal_V3S_U3_set_PitchFineTuning(pitch); |
| 275 | } | 280 | } |
| 276 | 281 | ||
| 277 | if (DEVICE_VERSION == JZ_H1T) | 282 | if (DEVICE_VERSION == JZ_H1T) |
| 278 | { | 283 | { |
| 279 | - Gimbal_V3S_H1T_set_PitchFineTuning(pitch); | 284 | + return Gimbal_V3S_H1T_set_PitchFineTuning(pitch); |
| 280 | } | 285 | } |
| 281 | } | 286 | } |
| 282 | 287 | ||
| @@ -289,20 +294,22 @@ T_JZsdkReturnCode Gimbal_Set_GimbalLinkageControl(int value) | @@ -289,20 +294,22 @@ T_JZsdkReturnCode Gimbal_Set_GimbalLinkageControl(int value) | ||
| 289 | 294 | ||
| 290 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 295 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
| 291 | { | 296 | { |
| 292 | - | 297 | + //没这玩意 |
| 293 | } | 298 | } |
| 294 | 299 | ||
| 295 | if (DEVICE_VERSION == JZ_U3) | 300 | if (DEVICE_VERSION == JZ_U3) |
| 296 | { | 301 | { |
| 297 | - | 302 | + //没这玩意 |
| 298 | } | 303 | } |
| 299 | 304 | ||
| 300 | if (DEVICE_VERSION == JZ_H1T) | 305 | if (DEVICE_VERSION == JZ_H1T) |
| 301 | { | 306 | { |
| 302 | Gimbal_V3S_H1T_Set_GimbalLinkageControl(Gimbal_LinkageNum); | 307 | Gimbal_V3S_H1T_Set_GimbalLinkageControl(Gimbal_LinkageNum); |
| 308 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 303 | } | 309 | } |
| 304 | 310 | ||
| 305 | - return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 311 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
| 312 | + | ||
| 306 | } | 313 | } |
| 307 | 314 | ||
| 308 | //查询云台联动 | 315 | //查询云台联动 |
| @@ -331,6 +338,8 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalLinkage(int *value) | @@ -331,6 +338,8 @@ T_JZsdkReturnCode Gimbal_CheckStatus_GimbalLinkage(int *value) | ||
| 331 | 338 | ||
| 332 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 339 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 333 | } | 340 | } |
| 341 | + | ||
| 342 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 334 | } | 343 | } |
| 335 | 344 | ||
| 336 | //收到云台联动值 | 345 | //收到云台联动值 |
| @@ -357,6 +366,8 @@ T_JZsdkReturnCode Gimbal_Obtain_GimbalLinkage(int GimbalLinkage) | @@ -357,6 +366,8 @@ T_JZsdkReturnCode Gimbal_Obtain_GimbalLinkage(int GimbalLinkage) | ||
| 357 | //毕竟是t60s返回来的值 | 366 | //毕竟是t60s返回来的值 |
| 358 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 367 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 359 | } | 368 | } |
| 369 | + | ||
| 370 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 360 | } | 371 | } |
| 361 | 372 | ||
| 362 | 373 |
-
请 注册 或 登录 后发表评论