正在显示
39 个修改的文件
包含
1123 行增加
和
1300 行删除
@@ -78,7 +78,15 @@ | @@ -78,7 +78,15 @@ | ||
78 | "jzsdk_framecomparsion.h": "c", | 78 | "jzsdk_framecomparsion.h": "c", |
79 | "jzsdk_definingcode.h": "c", | 79 | "jzsdk_definingcode.h": "c", |
80 | "test_data_transmission.h": "c", | 80 | "test_data_transmission.h": "c", |
81 | - "halrecv_type1.h": "c" | 81 | + "halrecv_type1.h": "c", |
82 | + "halrecv_type1_recvdeal.h": "c", | ||
83 | + "halrecv.h": "c", | ||
84 | + "halsend_type1.h": "c", | ||
85 | + "halsend.h": "c", | ||
86 | + "warninglight_v3s_tfa1.h": "c", | ||
87 | + "gimbal.h": "c", | ||
88 | + "jzsdk_uart_uartdeal.h": "c", | ||
89 | + "powermanager_inandout.h": "c" | ||
82 | }, | 90 | }, |
83 | "Codegeex.GenerationPreference": "automatic", | 91 | "Codegeex.GenerationPreference": "automatic", |
84 | "C_Cpp.dimInactiveRegions": false | 92 | "C_Cpp.dimInactiveRegions": false |
@@ -43,7 +43,23 @@ typedef enum | @@ -43,7 +43,23 @@ typedef enum | ||
43 | NO_SPECIFIED = 0x1999, // 无制定设备 | 43 | NO_SPECIFIED = 0x1999, // 无制定设备 |
44 | } JZ_DEVICE_PORT_TYPE; | 44 | } JZ_DEVICE_PORT_TYPE; |
45 | 45 | ||
46 | +typedef enum | ||
47 | +{ | ||
48 | + JZ_MODULE_CONTROL_WAY_INDEPENDENT = 0x0000, // 独立控制 | ||
49 | + JZ_MODULE_CONTROL_WAY_TRANSPARENT = 0x0001, //透传控制 | ||
50 | +}JZ_MODULE_CONTROL_WAY; // 模块控制方式 | ||
51 | + | ||
52 | +typedef enum | ||
53 | +{ | ||
54 | + JZ_DATA_TRANS_TYPE_REAL_TIME_MP2 = 0x1000, // 实时mp2数据传输中 | ||
55 | + JZ_DATA_TRANS_TYPE_AUDIO_FILE = 0x1001, // 音频文件传输中 | ||
56 | + JZ_DATA_TRANS_TYPE_OPUS_FILE = 0x1002, // opus文件传输中 | ||
57 | + JZ_DATA_TRANS_TYPE_REAL_TIME_OPUS = 0x1003, // 实时opus传输中 | ||
58 | + JZ_DATA_TRANS_TYPE_TTS = 0x1004, //TTS传输模式 | ||
59 | +}JZ_DATA_TRANS_TYPE; | ||
60 | + | ||
46 | /* Exported functions --------------------------------------------------------*/ | 61 | /* Exported functions --------------------------------------------------------*/ |
62 | +unsigned char * JZsdk_DefineCode_GetPortName(int Port); | ||
47 | 63 | ||
48 | #ifdef __cplusplus | 64 | #ifdef __cplusplus |
49 | } | 65 | } |
@@ -24,28 +24,28 @@ int JZsdk_FrameComparsion(char *getdata, int len) | @@ -24,28 +24,28 @@ int JZsdk_FrameComparsion(char *getdata, int len) | ||
24 | //1、判断是否是5A帧 | 24 | //1、判断是否是5A帧 |
25 | if (getdata[0] == 0x5A && getdata[1] == 0x5A && getdata[2] == 0x77) | 25 | if (getdata[0] == 0x5A && getdata[1] == 0x5A && getdata[2] == 0x77) |
26 | { | 26 | { |
27 | - printf("JZsdk_FrameComparsion:5A帧\n"); | 27 | + //printf("JZsdk_FrameComparsion:5A帧\n"); |
28 | return JZsdk_5AFrameComparsion(getdata, len); | 28 | return JZsdk_5AFrameComparsion(getdata, len); |
29 | } | 29 | } |
30 | 30 | ||
31 | //2、判断是否是5B帧 | 31 | //2、判断是否是5B帧 |
32 | if (getdata[0] == 0x5b && getdata[1] == 0x5b && getdata[2] == 0x77) | 32 | if (getdata[0] == 0x5b && getdata[1] == 0x5b && getdata[2] == 0x77) |
33 | { | 33 | { |
34 | - printf("JZsdk_FrameComparsion:5B帧\n"); | 34 | + //printf("JZsdk_FrameComparsion:5B帧\n"); |
35 | return JZsdk_5BFrameComparsion(getdata, len); | 35 | return JZsdk_5BFrameComparsion(getdata, len); |
36 | } | 36 | } |
37 | 37 | ||
38 | //3、判断是否是6A帧 | 38 | //3、判断是否是6A帧 |
39 | if (getdata[0] == 0x6A && getdata[1] == 0x6A && getdata[2] == 0x77) | 39 | if (getdata[0] == 0x6A && getdata[1] == 0x6A && getdata[2] == 0x77) |
40 | { | 40 | { |
41 | - printf("JZsdk_FrameComparsion:6A帧\n"); | 41 | + //printf("JZsdk_FrameComparsion:6A帧\n"); |
42 | return JZsdk_6AFrameComparsion(getdata, len); | 42 | return JZsdk_6AFrameComparsion(getdata, len); |
43 | } | 43 | } |
44 | 44 | ||
45 | //4、判断是否是6B帧 | 45 | //4、判断是否是6B帧 |
46 | if (getdata[0] == 0x6b && getdata[1] == 0x6b && getdata[2] == 0x77) | 46 | if (getdata[0] == 0x6b && getdata[1] == 0x6b && getdata[2] == 0x77) |
47 | { | 47 | { |
48 | - printf("JZsdk_FrameComparsion:6B帧\n"); | 48 | + //printf("JZsdk_FrameComparsion:6B帧\n"); |
49 | return JZsdk_6BFrameComparsion(getdata, len); | 49 | return JZsdk_6BFrameComparsion(getdata, len); |
50 | } | 50 | } |
51 | 51 |
@@ -22,7 +22,7 @@ typedef struct { | @@ -22,7 +22,7 @@ typedef struct { | ||
22 | pthread_cond_t condition; // 条件变量 | 22 | pthread_cond_t condition; // 条件变量 |
23 | } t_ThreadPool; | 23 | } t_ThreadPool; |
24 | 24 | ||
25 | -t_ThreadPool TaskPool[THREAD_POOL_SIZE]; //任务池子 | 25 | +static t_ThreadPool TaskPool[THREAD_POOL_SIZE]; //任务池子 |
26 | 26 | ||
27 | static void* TaskManagement_ThreadFunction(void* arg); | 27 | static void* TaskManagement_ThreadFunction(void* arg); |
28 | 28 |
@@ -5,25 +5,25 @@ | @@ -5,25 +5,25 @@ | ||
5 | 5 | ||
6 | #include "JZsdkLib.h" | 6 | #include "JZsdkLib.h" |
7 | 7 | ||
8 | -#include "version_choose.h" | 8 | +#include "Hal_Send/HalSend.h" |
9 | + | ||
10 | +#include "BaseConfig.h" | ||
11 | + | ||
9 | #include "ircut.h" | 12 | #include "ircut.h" |
10 | -#include "Megaphone/Megaphone.h" | ||
11 | #include "Gimbal/Gimbal.h" | 13 | #include "Gimbal/Gimbal.h" |
12 | 14 | ||
13 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
14 | -#include "BaseConfig.h" | ||
15 | #include "Psdk_UI_io.h" | 15 | #include "Psdk_UI_io.h" |
16 | 16 | ||
17 | - | ||
18 | #include "Lighting_InAndOut.h" | 17 | #include "Lighting_InAndOut.h" |
19 | #include "JZsdk_network/JZsdk_network.h" | 18 | #include "JZsdk_network/JZsdk_network.h" |
20 | 19 | ||
21 | -#include "JZsdk_TaskManagement/TaskManagement.h" | ||
22 | #include "JZsdk_haldata_deal/JZsdk_data_transmisson.h" | 20 | #include "JZsdk_haldata_deal/JZsdk_data_transmisson.h" |
23 | #include "MediaProc/MediaProc.h" | 21 | #include "MediaProc/MediaProc.h" |
24 | #include "UI_control/WidegMgmt/JZsdk_Widget.h" | 22 | #include "UI_control/WidegMgmt/JZsdk_Widget.h" |
25 | #include "DeviceConfig/DeviceConfig.h" | 23 | #include "DeviceConfig/DeviceConfig.h" |
26 | 24 | ||
25 | +#include "JZsdk_Hal.h" | ||
26 | + | ||
27 | #if APP_VERSION == APP_PSDK | 27 | #if APP_VERSION == APP_PSDK |
28 | #include "fc_subscription/test_fc_subscription.h" | 28 | #include "fc_subscription/test_fc_subscription.h" |
29 | #endif | 29 | #endif |
@@ -159,16 +159,16 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -159,16 +159,16 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
159 | if (DEVICE_VERSION == TF_A1) | 159 | if (DEVICE_VERSION == TF_A1) |
160 | { | 160 | { |
161 | //串口设备1初始化 | 161 | //串口设备1初始化 |
162 | - //JZsdk_Uart_Init(UART_DEV_1); | 162 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
163 | 163 | ||
164 | //串口设备2初始化 | 164 | //串口设备2初始化 |
165 | - JZsdk_Uart_Init(UART_DEV_2); | 165 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
166 | 166 | ||
167 | //喊话器初始化 | 167 | //喊话器初始化 |
168 | Megaphone_Init(); | 168 | Megaphone_Init(); |
169 | 169 | ||
170 | //云台初始化 | 170 | //云台初始化 |
171 | - Gimbal_Init(); | 171 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
172 | 172 | ||
173 | //灯类初始化 | 173 | //灯类初始化 |
174 | Lighting_Init(); | 174 | Lighting_Init(); |
@@ -176,49 +176,49 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -176,49 +176,49 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
176 | delayMs(1000); | 176 | delayMs(1000); |
177 | 177 | ||
178 | //消息订阅初始化 | 178 | //消息订阅初始化 |
179 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 179 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
180 | } | 180 | } |
181 | 181 | ||
182 | else if (DEVICE_VERSION == JZ_H1E) | 182 | else if (DEVICE_VERSION == JZ_H1E) |
183 | { | 183 | { |
184 | //串口设备1初始化 | 184 | //串口设备1初始化 |
185 | - //JZsdk_Uart_Init(UART_DEV_1); | 185 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
186 | 186 | ||
187 | //喊话器初始化 | 187 | //喊话器初始化 |
188 | - Megaphone_Init(); | 188 | + Megaphone_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
189 | } | 189 | } |
190 | 190 | ||
191 | else if (DEVICE_VERSION == JZ_H1T) | 191 | else if (DEVICE_VERSION == JZ_H1T) |
192 | { | 192 | { |
193 | //串口设备1初始化 | 193 | //串口设备1初始化 |
194 | - //JZsdk_Uart_Init(UART_DEV_1); | 194 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
195 | 195 | ||
196 | //4g设备初始化 | 196 | //4g设备初始化 |
197 | - JZsdk_Uart_Init(UART_4G); | 197 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
198 | 198 | ||
199 | //喊话器初始化 | 199 | //喊话器初始化 |
200 | Megaphone_Init(); | 200 | Megaphone_Init(); |
201 | 201 | ||
202 | //云台初始化 | 202 | //云台初始化 |
203 | - Gimbal_Init(); | 203 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_TRANSPARENT); |
204 | } | 204 | } |
205 | 205 | ||
206 | else if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 206 | else if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
207 | { | 207 | { |
208 | //串口设备1初始化 | 208 | //串口设备1初始化 |
209 | - // JZsdk_Uart_Init(UART_DEV_1); | 209 | + // JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
210 | 210 | ||
211 | if (DEVICE_VERSION == JZ_H150T) | 211 | if (DEVICE_VERSION == JZ_H150T) |
212 | { | 212 | { |
213 | //4g设备初始化 | 213 | //4g设备初始化 |
214 | - JZsdk_Uart_Init(UART_4G); | 214 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
215 | } | 215 | } |
216 | 216 | ||
217 | //喊话器初始化 | 217 | //喊话器初始化 |
218 | Megaphone_Init(); | 218 | Megaphone_Init(); |
219 | 219 | ||
220 | //云台初始化 | 220 | //云台初始化 |
221 | - Gimbal_Init(); | 221 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
222 | 222 | ||
223 | //相机初始化 | 223 | //相机初始化 |
224 | MediaProc_Init(); | 224 | MediaProc_Init(); |
@@ -227,43 +227,43 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -227,43 +227,43 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
227 | else if (DEVICE_VERSION == JZ_H10) | 227 | else if (DEVICE_VERSION == JZ_H10) |
228 | { | 228 | { |
229 | //串口设备1初始化 | 229 | //串口设备1初始化 |
230 | - // JZsdk_Uart_Init(UART_DEV_1); | 230 | + // JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
231 | 231 | ||
232 | //喊话器初始化 | 232 | //喊话器初始化 |
233 | Megaphone_Init(); | 233 | Megaphone_Init(); |
234 | 234 | ||
235 | //云台初始化 | 235 | //云台初始化 |
236 | - Gimbal_Init(); | 236 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
237 | } | 237 | } |
238 | 238 | ||
239 | else if (DEVICE_VERSION == JZ_H10T) | 239 | else if (DEVICE_VERSION == JZ_H10T) |
240 | { | 240 | { |
241 | //串口设备1初始化 | 241 | //串口设备1初始化 |
242 | - //JZsdk_Uart_Init(UART_DEV_1); | 242 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
243 | 243 | ||
244 | //4g设备初始化 | 244 | //4g设备初始化 |
245 | - JZsdk_Uart_Init(UART_4G); | 245 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
246 | 246 | ||
247 | //喊话器初始化 | 247 | //喊话器初始化 |
248 | Megaphone_Init(); | 248 | Megaphone_Init(); |
249 | 249 | ||
250 | //云台初始化 | 250 | //云台初始化 |
251 | - Gimbal_Init(); | 251 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
252 | } | 252 | } |
253 | 253 | ||
254 | else if (DEVICE_VERSION == JZ_U3) | 254 | else if (DEVICE_VERSION == JZ_U3) |
255 | { | 255 | { |
256 | //串口设备1初始化 | 256 | //串口设备1初始化 |
257 | - //JZsdk_Uart_Init(UART_DEV_1); | 257 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
258 | 258 | ||
259 | //串口设备2初始化 | 259 | //串口设备2初始化 |
260 | - JZsdk_Uart_Init(UART_DEV_2); | 260 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
261 | 261 | ||
262 | //喊话器初始化 | 262 | //喊话器初始化 |
263 | Megaphone_Init(); | 263 | Megaphone_Init(); |
264 | 264 | ||
265 | //云台初始化 | 265 | //云台初始化 |
266 | - Gimbal_Init(); | 266 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
267 | 267 | ||
268 | //灯类初始化 | 268 | //灯类初始化 |
269 | Lighting_Init(); | 269 | Lighting_Init(); |
@@ -271,22 +271,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -271,22 +271,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
271 | delayMs(1000); | 271 | delayMs(1000); |
272 | 272 | ||
273 | //消息订阅初始化 | 273 | //消息订阅初始化 |
274 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 274 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
275 | } | 275 | } |
276 | 276 | ||
277 | else if (DEVICE_VERSION == JZ_U3S) | 277 | else if (DEVICE_VERSION == JZ_U3S) |
278 | { | 278 | { |
279 | //串口设备1初始化 | 279 | //串口设备1初始化 |
280 | - //JZsdk_Uart_Init(UART_DEV_1); | 280 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
281 | 281 | ||
282 | //串口设备2初始化 | 282 | //串口设备2初始化 |
283 | - JZsdk_Uart_Init(UART_DEV_2); | 283 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
284 | 284 | ||
285 | //喊话器初始化 | 285 | //喊话器初始化 |
286 | Megaphone_Init(); | 286 | Megaphone_Init(); |
287 | 287 | ||
288 | //云台初始化 | 288 | //云台初始化 |
289 | - Gimbal_Init(); | 289 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
290 | 290 | ||
291 | //灯类初始化 | 291 | //灯类初始化 |
292 | Lighting_Init(); | 292 | Lighting_Init(); |
@@ -297,22 +297,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -297,22 +297,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
297 | delayMs(1000); | 297 | delayMs(1000); |
298 | 298 | ||
299 | //消息订阅初始化 | 299 | //消息订阅初始化 |
300 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 300 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
301 | } | 301 | } |
302 | 302 | ||
303 | else if (DEVICE_VERSION == JZ_U3D) | 303 | else if (DEVICE_VERSION == JZ_U3D) |
304 | { | 304 | { |
305 | //串口设备1初始化 | 305 | //串口设备1初始化 |
306 | - //JZsdk_Uart_Init(UART_DEV_1); | 306 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
307 | 307 | ||
308 | //串口设备2初始化 | 308 | //串口设备2初始化 |
309 | - JZsdk_Uart_Init(UART_DEV_2); | 309 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
310 | 310 | ||
311 | //喊话器初始化 | 311 | //喊话器初始化 |
312 | Megaphone_Init(); | 312 | Megaphone_Init(); |
313 | 313 | ||
314 | //云台初始化 | 314 | //云台初始化 |
315 | - Gimbal_Init(); | 315 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
316 | 316 | ||
317 | //灯类初始化 | 317 | //灯类初始化 |
318 | Lighting_Init(); | 318 | Lighting_Init(); |
@@ -320,22 +320,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -320,22 +320,22 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
320 | delayMs(1000); | 320 | delayMs(1000); |
321 | 321 | ||
322 | //消息订阅初始化 | 322 | //消息订阅初始化 |
323 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 323 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
324 | } | 324 | } |
325 | 325 | ||
326 | else if (DEVICE_VERSION == JZ_U30) | 326 | else if (DEVICE_VERSION == JZ_U30) |
327 | { | 327 | { |
328 | //串口设备1初始化 | 328 | //串口设备1初始化 |
329 | - //JZsdk_Uart_Init(UART_DEV_1); | 329 | + //JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
330 | 330 | ||
331 | //串口设备2初始化 | 331 | //串口设备2初始化 |
332 | - JZsdk_Uart_Init(UART_DEV_2); | 332 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
333 | 333 | ||
334 | //喊话器初始化 | 334 | //喊话器初始化 |
335 | Megaphone_Init(); | 335 | Megaphone_Init(); |
336 | 336 | ||
337 | //云台初始化 | 337 | //云台初始化 |
338 | - Gimbal_Init(); | 338 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
339 | 339 | ||
340 | //灯类初始化 | 340 | //灯类初始化 |
341 | Lighting_Init(); | 341 | Lighting_Init(); |
@@ -343,7 +343,7 @@ T_JZsdkReturnCode Main_APP_Psdk() | @@ -343,7 +343,7 @@ T_JZsdkReturnCode Main_APP_Psdk() | ||
343 | delayMs(1000); | 343 | delayMs(1000); |
344 | 344 | ||
345 | //消息订阅初始化 | 345 | //消息订阅初始化 |
346 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 346 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
347 | } | 347 | } |
348 | 348 | ||
349 | else if (DEVICE_VERSION == JZ_C1) | 349 | else if (DEVICE_VERSION == JZ_C1) |
@@ -390,7 +390,7 @@ int Main_APP_Uart() | @@ -390,7 +390,7 @@ int Main_APP_Uart() | ||
390 | if (DEVICE_VERSION == JZ_H1E) | 390 | if (DEVICE_VERSION == JZ_H1E) |
391 | { | 391 | { |
392 | //串口设备1初始化 | 392 | //串口设备1初始化 |
393 | - JZsdk_Uart_Init(UART_DEV_1); | 393 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
394 | 394 | ||
395 | //喊话器初始化 | 395 | //喊话器初始化 |
396 | Megaphone_Init(); | 396 | Megaphone_Init(); |
@@ -399,16 +399,16 @@ int Main_APP_Uart() | @@ -399,16 +399,16 @@ int Main_APP_Uart() | ||
399 | if (DEVICE_VERSION == JZ_H1T) | 399 | if (DEVICE_VERSION == JZ_H1T) |
400 | { | 400 | { |
401 | //串口设备1初始化 | 401 | //串口设备1初始化 |
402 | - JZsdk_Uart_Init(UART_DEV_1); | 402 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
403 | 403 | ||
404 | //4g设备初始化 | 404 | //4g设备初始化 |
405 | - JZsdk_Uart_Init(UART_4G); | 405 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
406 | 406 | ||
407 | //喊话器初始化 | 407 | //喊话器初始化 |
408 | Megaphone_Init(); | 408 | Megaphone_Init(); |
409 | 409 | ||
410 | //云台初始化 | 410 | //云台初始化 |
411 | - Gimbal_Init(); | 411 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_TRANSPARENT); |
412 | 412 | ||
413 | // //测试增加选项 | 413 | // //测试增加选项 |
414 | // //开启循环 | 414 | // //开启循环 |
@@ -421,7 +421,7 @@ int Main_APP_Uart() | @@ -421,7 +421,7 @@ int Main_APP_Uart() | ||
421 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) | 421 | if (DEVICE_VERSION == JZ_H150S || DEVICE_VERSION == JZ_H150T) |
422 | { | 422 | { |
423 | //串口设备1初始化 | 423 | //串口设备1初始化 |
424 | - JZsdk_Uart_Init(UART_DEV_1); | 424 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
425 | 425 | ||
426 | //网口初始化 | 426 | //网口初始化 |
427 | JZsdk_NetWork_Init(); | 427 | JZsdk_NetWork_Init(); |
@@ -429,11 +429,11 @@ int Main_APP_Uart() | @@ -429,11 +429,11 @@ int Main_APP_Uart() | ||
429 | if (DEVICE_VERSION == JZ_H150T) | 429 | if (DEVICE_VERSION == JZ_H150T) |
430 | { | 430 | { |
431 | //4g设备初始化 | 431 | //4g设备初始化 |
432 | - JZsdk_Uart_Init(UART_4G); | 432 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
433 | } | 433 | } |
434 | 434 | ||
435 | //云台初始化 | 435 | //云台初始化 |
436 | - Gimbal_Init(); | 436 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
437 | 437 | ||
438 | //相机初始化 | 438 | //相机初始化 |
439 | MediaProc_Init(); | 439 | MediaProc_Init(); |
@@ -445,7 +445,7 @@ int Main_APP_Uart() | @@ -445,7 +445,7 @@ int Main_APP_Uart() | ||
445 | if (DEVICE_VERSION == JZ_H10) | 445 | if (DEVICE_VERSION == JZ_H10) |
446 | { | 446 | { |
447 | //串口设备1初始化 | 447 | //串口设备1初始化 |
448 | - JZsdk_Uart_Init(UART_DEV_1); | 448 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
449 | 449 | ||
450 | //H10和10t固定打开滤波 | 450 | //H10和10t固定打开滤波 |
451 | int filter_mode = JZ_FLAGCODE_ON; | 451 | int filter_mode = JZ_FLAGCODE_ON; |
@@ -455,16 +455,16 @@ int Main_APP_Uart() | @@ -455,16 +455,16 @@ int Main_APP_Uart() | ||
455 | Megaphone_Init(); | 455 | Megaphone_Init(); |
456 | 456 | ||
457 | //云台初始化 | 457 | //云台初始化 |
458 | - Gimbal_Init(); | 458 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
459 | } | 459 | } |
460 | 460 | ||
461 | if (DEVICE_VERSION == JZ_H10T) | 461 | if (DEVICE_VERSION == JZ_H10T) |
462 | { | 462 | { |
463 | //串口设备1初始化 | 463 | //串口设备1初始化 |
464 | - JZsdk_Uart_Init(UART_DEV_1); | 464 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
465 | 465 | ||
466 | //4g设备初始化 | 466 | //4g设备初始化 |
467 | - JZsdk_Uart_Init(UART_4G); | 467 | + JZsdk_HalPort_Init_WithDefault(UART_4G); |
468 | 468 | ||
469 | //H10和10t固定打开滤波 | 469 | //H10和10t固定打开滤波 |
470 | int filter_mode = JZ_FLAGCODE_ON; | 470 | int filter_mode = JZ_FLAGCODE_ON; |
@@ -474,22 +474,22 @@ int Main_APP_Uart() | @@ -474,22 +474,22 @@ int Main_APP_Uart() | ||
474 | Megaphone_Init(); | 474 | Megaphone_Init(); |
475 | 475 | ||
476 | //云台初始化 | 476 | //云台初始化 |
477 | - Gimbal_Init(); | 477 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
478 | } | 478 | } |
479 | 479 | ||
480 | if (DEVICE_VERSION == JZ_U3) | 480 | if (DEVICE_VERSION == JZ_U3) |
481 | { | 481 | { |
482 | //串口设备1初始化 | 482 | //串口设备1初始化 |
483 | - JZsdk_Uart_Init(UART_DEV_1); | 483 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
484 | 484 | ||
485 | //串口设备2初始化 | 485 | //串口设备2初始化 |
486 | - JZsdk_Uart_Init(UART_DEV_2); | 486 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
487 | 487 | ||
488 | //喊话器初始化 | 488 | //喊话器初始化 |
489 | Megaphone_Init(); | 489 | Megaphone_Init(); |
490 | 490 | ||
491 | //云台初始化 | 491 | //云台初始化 |
492 | - Gimbal_Init(); | 492 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
493 | 493 | ||
494 | //灯类初始化 | 494 | //灯类初始化 |
495 | Lighting_Init(); | 495 | Lighting_Init(); |
@@ -497,7 +497,7 @@ int Main_APP_Uart() | @@ -497,7 +497,7 @@ int Main_APP_Uart() | ||
497 | delayMs(1000); | 497 | delayMs(1000); |
498 | 498 | ||
499 | //消息订阅初始化 | 499 | //消息订阅初始化 |
500 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 500 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
501 | 501 | ||
502 | // //测试需要开启亮度 | 502 | // //测试需要开启亮度 |
503 | // JZsdk_Uart_SearchLight_Control(UART_DEV_1, 1); | 503 | // JZsdk_Uart_SearchLight_Control(UART_DEV_1, 1); |
@@ -508,16 +508,16 @@ int Main_APP_Uart() | @@ -508,16 +508,16 @@ int Main_APP_Uart() | ||
508 | else if (DEVICE_VERSION == JZ_U3S) | 508 | else if (DEVICE_VERSION == JZ_U3S) |
509 | { | 509 | { |
510 | //串口设备1初始化 | 510 | //串口设备1初始化 |
511 | - JZsdk_Uart_Init(UART_DEV_1); | 511 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
512 | 512 | ||
513 | //串口设备2初始化 | 513 | //串口设备2初始化 |
514 | - JZsdk_Uart_Init(UART_DEV_2); | 514 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
515 | 515 | ||
516 | //喊话器初始化 | 516 | //喊话器初始化 |
517 | Megaphone_Init(); | 517 | Megaphone_Init(); |
518 | 518 | ||
519 | //云台初始化 | 519 | //云台初始化 |
520 | - Gimbal_Init(); | 520 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
521 | 521 | ||
522 | //灯类初始化 | 522 | //灯类初始化 |
523 | Lighting_Init(); | 523 | Lighting_Init(); |
@@ -528,22 +528,22 @@ int Main_APP_Uart() | @@ -528,22 +528,22 @@ int Main_APP_Uart() | ||
528 | delayMs(1000); | 528 | delayMs(1000); |
529 | 529 | ||
530 | //消息订阅初始化 | 530 | //消息订阅初始化 |
531 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 531 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
532 | } | 532 | } |
533 | 533 | ||
534 | else if (DEVICE_VERSION == JZ_U3D) | 534 | else if (DEVICE_VERSION == JZ_U3D) |
535 | { | 535 | { |
536 | //串口设备1初始化 | 536 | //串口设备1初始化 |
537 | - JZsdk_Uart_Init(UART_DEV_1); | 537 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
538 | 538 | ||
539 | //串口设备2初始化 | 539 | //串口设备2初始化 |
540 | - JZsdk_Uart_Init(UART_DEV_2); | 540 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
541 | 541 | ||
542 | //喊话器初始化 | 542 | //喊话器初始化 |
543 | Megaphone_Init(); | 543 | Megaphone_Init(); |
544 | 544 | ||
545 | //云台初始化 | 545 | //云台初始化 |
546 | - Gimbal_Init(); | 546 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
547 | 547 | ||
548 | //灯类初始化 | 548 | //灯类初始化 |
549 | Lighting_Init(); | 549 | Lighting_Init(); |
@@ -551,7 +551,7 @@ int Main_APP_Uart() | @@ -551,7 +551,7 @@ int Main_APP_Uart() | ||
551 | delayMs(1000); | 551 | delayMs(1000); |
552 | 552 | ||
553 | //消息订阅初始化 | 553 | //消息订阅初始化 |
554 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 554 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
555 | 555 | ||
556 | // delayS(3); | 556 | // delayS(3); |
557 | 557 | ||
@@ -566,16 +566,16 @@ int Main_APP_Uart() | @@ -566,16 +566,16 @@ int Main_APP_Uart() | ||
566 | else if (DEVICE_VERSION == JZ_U30) | 566 | else if (DEVICE_VERSION == JZ_U30) |
567 | { | 567 | { |
568 | //串口设备1初始化 | 568 | //串口设备1初始化 |
569 | - JZsdk_Uart_Init(UART_DEV_1); | 569 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
570 | 570 | ||
571 | //串口设备2初始化 | 571 | //串口设备2初始化 |
572 | - JZsdk_Uart_Init(UART_DEV_2); | 572 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
573 | 573 | ||
574 | //喊话器初始化 | 574 | //喊话器初始化 |
575 | Megaphone_Init(); | 575 | Megaphone_Init(); |
576 | 576 | ||
577 | //云台初始化 | 577 | //云台初始化 |
578 | - Gimbal_Init(); | 578 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
579 | 579 | ||
580 | //灯类初始化 | 580 | //灯类初始化 |
581 | Lighting_Init(); | 581 | Lighting_Init(); |
@@ -583,25 +583,25 @@ int Main_APP_Uart() | @@ -583,25 +583,25 @@ int Main_APP_Uart() | ||
583 | delayMs(1000); | 583 | delayMs(1000); |
584 | 584 | ||
585 | //消息订阅初始化 | 585 | //消息订阅初始化 |
586 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 586 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
587 | } | 587 | } |
588 | 588 | ||
589 | if (DEVICE_VERSION == TF_A1) | 589 | if (DEVICE_VERSION == TF_A1) |
590 | { | 590 | { |
591 | //串口设备1初始化 | 591 | //串口设备1初始化 |
592 | - JZsdk_Uart_Init(UART_DEV_1); | 592 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
593 | 593 | ||
594 | //串口设备2初始化 | 594 | //串口设备2初始化 |
595 | - JZsdk_Uart_Init(UART_DEV_2); | 595 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_2); |
596 | 596 | ||
597 | //喊话器初始化 | 597 | //喊话器初始化 |
598 | Megaphone_Init(); | 598 | Megaphone_Init(); |
599 | 599 | ||
600 | //云台初始化 | 600 | //云台初始化 |
601 | - Gimbal_Init(); | 601 | + Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
602 | 602 | ||
603 | //消息订阅初始化 | 603 | //消息订阅初始化 |
604 | - JZsdk_Uart_Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); | 604 | + HalSend_type1Send_MessageSubcription_Control(UART_DEV_2, JZ_FLAGCODE_ON); |
605 | } | 605 | } |
606 | 606 | ||
607 | } | 607 | } |
@@ -609,7 +609,7 @@ int Main_APP_Uart() | @@ -609,7 +609,7 @@ int Main_APP_Uart() | ||
609 | int Main_TestAPP() | 609 | int Main_TestAPP() |
610 | { | 610 | { |
611 | //串口设备1初始化 | 611 | //串口设备1初始化 |
612 | - JZsdk_Uart_Init(UART_DEV_1); | 612 | + JZsdk_HalPort_Init_WithDefault(UART_DEV_1); |
613 | } | 613 | } |
614 | 614 | ||
615 | //JZ_FLAGCODE_GET为返回工作值,其他值为设置 | 615 | //JZ_FLAGCODE_GET为返回工作值,其他值为设置 |
JZsdk_hal/Hal_Recv/HalRecv.c
0 → 100644
1 | /** | 1 | /** |
2 | ******************************************************************** | 2 | ******************************************************************** |
3 | - * @file JZsdk_Uart_RecvDeal.h | ||
4 | - * JZsdk_Uart_RecvDeal的头文件 | 3 | + * @file HalRecv.h |
4 | + * HalRecv.c的头文件 | ||
5 | * | 5 | * |
6 | ********************************************************************* | 6 | ********************************************************************* |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | 9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ |
10 | -#ifndef JZSDK_UART_RECVDEAL_H | ||
11 | -#define JZSDK_UART_RECVDEAL_H | 10 | +#ifndef HALRECV_H |
11 | +#define HALRECV_H | ||
12 | 12 | ||
13 | /* Includes ------------------------------------------------------------------*/ | 13 | /* Includes ------------------------------------------------------------------*/ |
14 | 14 | ||
@@ -18,11 +18,14 @@ extern "C" { | @@ -18,11 +18,14 @@ extern "C" { | ||
18 | 18 | ||
19 | /* Exported constants --------------------------------------------------------*/ | 19 | /* Exported constants --------------------------------------------------------*/ |
20 | /* 常亮定义*/ | 20 | /* 常亮定义*/ |
21 | +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
22 | +#include "Hal_Recv/HalRecv_type1/HalRecv_type1.h" | ||
21 | 23 | ||
22 | /* Exported types ------------------------------------------------------------*/ | 24 | /* Exported types ------------------------------------------------------------*/ |
23 | 25 | ||
24 | /* Exported functions --------------------------------------------------------*/ | 26 | /* Exported functions --------------------------------------------------------*/ |
25 | -int JZsdk_Uart_RecvDeal_CharmDeal(int Port, unsigned char *getbuf, int len); | 27 | + |
28 | + | ||
26 | 29 | ||
27 | #ifdef __cplusplus | 30 | #ifdef __cplusplus |
28 | } | 31 | } |
@@ -189,7 +189,7 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int D | @@ -189,7 +189,7 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int D | ||
189 | HaveReadLen = HaveReadLen + FrameLen; | 189 | HaveReadLen = HaveReadLen + FrameLen; |
190 | HaveDealLen = HaveReadLen; | 190 | HaveDealLen = HaveReadLen; |
191 | 191 | ||
192 | - JZSDK_LOG_INFO("Prot:%x f_len%d h_r%d [h_r]:%x get%d",Port,FrameLen ,HaveReadLen, Data[HaveReadLen-1], DataLen); | 192 | + //JZSDK_LOG_INFO("Prot:%x f_len%d h_r%d [h_r]:%x get%d",Port,FrameLen ,HaveReadLen, Data[HaveReadLen-1], DataLen); |
193 | 193 | ||
194 | FrameLen = 0; | 194 | FrameLen = 0; |
195 | FrameFlag = 0; | 195 | FrameFlag = 0; |
@@ -219,13 +219,14 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int D | @@ -219,13 +219,14 @@ int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int D | ||
219 | // 1、判断帧的长度会不会不合理,帧的长度最大为文件名帧,其长度为9+2+1024 | 219 | // 1、判断帧的长度会不会不合理,帧的长度最大为文件名帧,其长度为9+2+1024 |
220 | if (FrameLen > (9 + 2 + 1024)) | 220 | if (FrameLen > (9 + 2 + 1024)) |
221 | { | 221 | { |
222 | + JZSDK_LOG_ERROR("串口严重错误,接收到的帧长度位长度%d 超出最大长度%d ",FrameLen,(9 + 2 + 1024)); | ||
222 | // 将其移除数据 | 223 | // 将其移除数据 |
223 | HaveDealLen = HaveReadLen; | 224 | HaveDealLen = HaveReadLen; |
224 | ResidualLength = 0; | 225 | ResidualLength = 0; |
225 | return ResidualLength; | 226 | return ResidualLength; |
226 | } | 227 | } |
227 | 228 | ||
228 | - printf("切帧返回%d\n",(DataLen - HaveDealLen)); | 229 | + //printf("切帧返回%d\n",(DataLen - HaveDealLen)); |
229 | 230 | ||
230 | // 2、如果合理,则返回剩余长度 | 231 | // 2、如果合理,则返回剩余长度 |
231 | ResidualLength = (DataLen - HaveDealLen); | 232 | ResidualLength = (DataLen - HaveDealLen); |
@@ -23,7 +23,7 @@ extern "C" { | @@ -23,7 +23,7 @@ extern "C" { | ||
23 | 23 | ||
24 | /* Exported functions --------------------------------------------------------*/ | 24 | /* Exported functions --------------------------------------------------------*/ |
25 | 25 | ||
26 | -int HalRecv_tpye1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int DataLen, int Port); | 26 | +int HalRecv_type1_PreliminaryScreeningOfData(unsigned char *Data, unsigned int DataLen, int Port); |
27 | 27 | ||
28 | 28 | ||
29 | #ifdef __cplusplus | 29 | #ifdef __cplusplus |
此 diff 太大无法显示。
JZsdk_hal/Hal_Send/HalSend.c
0 → 100644
1 | +#include <stdio.h> | ||
2 | +#include "JZsdkLib.h" | ||
3 | + | ||
4 | +#include "JZsdk_uart/JZsdk_Uart_UartDeal.h" | ||
5 | + | ||
6 | + | ||
7 | +#define SINGLE_THREAD_SEND 0 | ||
8 | +#define MULTI_THREAD_SEND 1 | ||
9 | + | ||
10 | +/***************************** | ||
11 | + * | ||
12 | + * hal层发送接口 | ||
13 | + * | ||
14 | + * Port:发送的端口名 | ||
15 | + * Data:发送的数据 | ||
16 | + * DataLen:发送的数据长度 | ||
17 | + * SendType:发送类型 | ||
18 | + * 0:单线程发送 | ||
19 | + * 1:多线程发送 | ||
20 | + * | ||
21 | + * 成功返回 jz sdk 成功码 | ||
22 | + * *************************/ | ||
23 | +T_JZsdkReturnCode HalSend_SendData(unsigned int Port, unsigned char *Data, unsigned int DataLen, unsigned int SendType) | ||
24 | +{ | ||
25 | + T_JZsdkReturnCode ret = JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
26 | + | ||
27 | + //判断端口 | ||
28 | + switch (Port) | ||
29 | + { | ||
30 | + case UART_4G: | ||
31 | + case UART_DEV_1: | ||
32 | + case UART_DEV_2: | ||
33 | + case UART_DEV_3: | ||
34 | + case UART_DEV_4: | ||
35 | + case UART_DEV_5: | ||
36 | + if (SendType == SINGLE_THREAD_SEND) | ||
37 | + { | ||
38 | + JZsdk_Uart_UartSend(Port, Data, DataLen); | ||
39 | + } | ||
40 | + else if (SendType == MULTI_THREAD_SEND) | ||
41 | + { | ||
42 | + JZsdk_Uart_UartSend_NotTask(Port, Data, DataLen); | ||
43 | + } | ||
44 | + break; | ||
45 | + | ||
46 | + case HAL_DATA_TRANSMISSION: | ||
47 | + JZSDK_LOG_DEBUG("暂无该通道"); | ||
48 | + break; | ||
49 | + | ||
50 | + default: | ||
51 | + break; | ||
52 | + } | ||
53 | + | ||
54 | + | ||
55 | + return ret; | ||
56 | +} |
1 | /** | 1 | /** |
2 | ******************************************************************** | 2 | ******************************************************************** |
3 | - * @file Uart_Config.h | ||
4 | - * Uart_Config的头文件 | ||
5 | - * 用于管理串口的基本信息 | 3 | + * @file HalRecv.h |
4 | + * HalRecv.c的头文件 | ||
5 | + * | ||
6 | ********************************************************************* | 6 | ********************************************************************* |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | 9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ |
10 | -#ifndef UART_CONFIG_H | ||
11 | -#define UART_CONFIG_H | 10 | +#ifndef HALRECV_H |
11 | +#define HALRECV_H | ||
12 | 12 | ||
13 | /* Includes ------------------------------------------------------------------*/ | 13 | /* Includes ------------------------------------------------------------------*/ |
14 | -#include "BaseConfig.h" | 14 | +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" |
15 | +#include "Hal_Send/HalSend_type1/HalSend_type1.h" | ||
15 | 16 | ||
16 | #ifdef __cplusplus | 17 | #ifdef __cplusplus |
17 | extern "C" { | 18 | extern "C" { |
@@ -20,9 +21,13 @@ extern "C" { | @@ -20,9 +21,13 @@ extern "C" { | ||
20 | /* Exported constants --------------------------------------------------------*/ | 21 | /* Exported constants --------------------------------------------------------*/ |
21 | /* 常亮定义*/ | 22 | /* 常亮定义*/ |
22 | 23 | ||
24 | + | ||
23 | /* Exported types ------------------------------------------------------------*/ | 25 | /* Exported types ------------------------------------------------------------*/ |
24 | 26 | ||
25 | /* Exported functions --------------------------------------------------------*/ | 27 | /* Exported functions --------------------------------------------------------*/ |
28 | +T_JZsdkReturnCode HalSend_SendData(unsigned int Port, unsigned char *Data, unsigned int DataLen, unsigned int SendType); | ||
29 | + | ||
30 | + | ||
26 | 31 | ||
27 | #ifdef __cplusplus | 32 | #ifdef __cplusplus |
28 | } | 33 | } |
@@ -2,16 +2,16 @@ | @@ -2,16 +2,16 @@ | ||
2 | #include <string.h> | 2 | #include <string.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | 4 | ||
5 | -#include "../JZsdk_Uart_UartDeal.h" | ||
6 | -#include "../Uart_Config.h" | ||
7 | -#include "./JZsdk_Uart_Send.h" | ||
8 | -#include "JZsdk_TaskManagement/TaskManagement.h" | ||
9 | -#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
10 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" | 5 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" |
6 | +#include "JZsdkLib.h" | ||
7 | + | ||
8 | +#include "JZsdk_TaskManagement/TaskManagement.h" | ||
11 | 9 | ||
12 | 10 | ||
11 | +#include "Hal_Send/HalSend.h" | ||
12 | + | ||
13 | //发送主动连接帧 | 13 | //发送主动连接帧 |
14 | -int JZsdk_Uart_SendDeal_ConnectFrame(int PortNum) | 14 | +T_JZsdkReturnCode HalSend_type1Send_ConnectFrame(int PortNum) |
15 | { | 15 | { |
16 | unsigned char sendbuf[256]; | 16 | unsigned char sendbuf[256]; |
17 | int send_buf_len; | 17 | int send_buf_len; |
@@ -20,11 +20,13 @@ int JZsdk_Uart_SendDeal_ConnectFrame(int PortNum) | @@ -20,11 +20,13 @@ int JZsdk_Uart_SendDeal_ConnectFrame(int PortNum) | ||
20 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_ASKFORCONNECT , sendbuf, &send_buf_len); | 20 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_ASKFORCONNECT , sendbuf, &send_buf_len); |
21 | 21 | ||
22 | //2、发送帧 | 22 | //2、发送帧 |
23 | - JZsdk_Uart_UartSend(PortNum ,sendbuf, send_buf_len); | 23 | + HalSend_SendData(PortNum ,sendbuf, send_buf_len, 1); |
24 | + | ||
25 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
24 | } | 26 | } |
25 | 27 | ||
26 | //回复连接帧 | 28 | //回复连接帧 |
27 | -int JZsdk_Uart_SendDeal_Send_Connect(int Uartport , int FrameSequence,int Version_flag) | 29 | +T_JZsdkReturnCode HalSend_type1Send_Send_Connect(int Uartport , int FrameSequence,int Version_flag) |
28 | { | 30 | { |
29 | unsigned char sendbuf[256]; | 31 | unsigned char sendbuf[256]; |
30 | int send_buf_len; | 32 | int send_buf_len; |
@@ -39,11 +41,13 @@ int JZsdk_Uart_SendDeal_Send_Connect(int Uartport , int FrameSequence,int Versio | @@ -39,11 +41,13 @@ int JZsdk_Uart_SendDeal_Send_Connect(int Uartport , int FrameSequence,int Versio | ||
39 | sendbuf[6] = FrameSequence; //帧序列 | 41 | sendbuf[6] = FrameSequence; //帧序列 |
40 | 42 | ||
41 | //3、发送帧 | 43 | //3、发送帧 |
42 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 44 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
45 | + | ||
46 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
43 | } | 47 | } |
44 | 48 | ||
45 | //回复心跳帧 | 49 | //回复心跳帧 |
46 | -int JZsdk_Uart_SendDeal_Send_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus) | 50 | +T_JZsdkReturnCode HalSend_type1Send_Send_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus) |
47 | { | 51 | { |
48 | unsigned char sendbuf[256]; | 52 | unsigned char sendbuf[256]; |
49 | int send_buf_len; | 53 | int send_buf_len; |
@@ -58,11 +62,13 @@ int JZsdk_Uart_SendDeal_Send_HeartBeatStatus(int Uartport , int FrameSequence,in | @@ -58,11 +62,13 @@ int JZsdk_Uart_SendDeal_Send_HeartBeatStatus(int Uartport , int FrameSequence,in | ||
58 | sendbuf[6] = FrameSequence; //帧序列 | 62 | sendbuf[6] = FrameSequence; //帧序列 |
59 | 63 | ||
60 | //3、发送帧 | 64 | //3、发送帧 |
61 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 65 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
66 | + | ||
67 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
62 | } | 68 | } |
63 | 69 | ||
64 | //设置电源状态 | 70 | //设置电源状态 |
65 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_PowerStatus(int Uartport, int FrameSequence, int status) | 71 | +T_JZsdkReturnCode HalSend_type1Send_Set_PowerStatus(int Uartport, int FrameSequence, int status) |
66 | { | 72 | { |
67 | printf("发送电源状态\n"); | 73 | printf("发送电源状态\n"); |
68 | 74 | ||
@@ -76,11 +82,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_PowerStatus(int Uartport, int FrameSequenc | @@ -76,11 +82,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_PowerStatus(int Uartport, int FrameSequenc | ||
76 | sendbuf[6] = FrameSequence; //帧序列 | 82 | sendbuf[6] = FrameSequence; //帧序列 |
77 | 83 | ||
78 | //2、发送帧 | 84 | //2、发送帧 |
79 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 85 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
86 | + | ||
87 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
80 | } | 88 | } |
81 | 89 | ||
82 | -//发送心跳帧 | ||
83 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus) | 90 | +//请求心跳帧 |
91 | +T_JZsdkReturnCode HalSend_type1Send_Ask_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus) | ||
84 | { | 92 | { |
85 | printf("发送请求心跳帧\n"); | 93 | printf("发送请求心跳帧\n"); |
86 | 94 | ||
@@ -94,11 +102,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(int Uartport , int Fra | @@ -94,11 +102,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(int Uartport , int Fra | ||
94 | sendbuf[6] = FrameSequence; //帧序列 | 102 | sendbuf[6] = FrameSequence; //帧序列 |
95 | 103 | ||
96 | //2、发送帧 | 104 | //2、发送帧 |
97 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 105 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
106 | + | ||
107 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
98 | } | 108 | } |
99 | 109 | ||
100 | //发送请求时间戳帧 | 110 | //发送请求时间戳帧 |
101 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_TimeStamp(int Uartport , int FrameSequence) | 111 | +T_JZsdkReturnCode HalSend_type1Send_Ask_TimeStamp(int Uartport , int FrameSequence) |
102 | { | 112 | { |
103 | printf("发送请求时间戳帧\n"); | 113 | printf("发送请求时间戳帧\n"); |
104 | 114 | ||
@@ -111,11 +121,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_TimeStamp(int Uartport , int FrameSequ | @@ -111,11 +121,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_TimeStamp(int Uartport , int FrameSequ | ||
111 | sendbuf[6] = FrameSequence; //帧序列 | 121 | sendbuf[6] = FrameSequence; //帧序列 |
112 | 122 | ||
113 | //2、发送帧 | 123 | //2、发送帧 |
114 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 124 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
125 | + | ||
126 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
115 | } | 127 | } |
116 | 128 | ||
117 | //发送版本号 | 129 | //发送版本号 |
118 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllVersion(int Uartport, int FrameSequence, int DeviceID, int MajorVersion, int MinorVersion, int ModifyVersion, int DebugVersion) | 130 | +T_JZsdkReturnCode HalSend_type1Send_SendAllVersion(int Uartport, int FrameSequence, int DeviceID, int MajorVersion, int MinorVersion, int ModifyVersion, int DebugVersion) |
119 | { | 131 | { |
120 | printf("发送所有版本号\n"); | 132 | printf("发送所有版本号\n"); |
121 | 133 | ||
@@ -133,11 +145,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllVersion(int Uartport, int FrameSequ | @@ -133,11 +145,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllVersion(int Uartport, int FrameSequ | ||
133 | sendbuf[13] = DebugVersion; | 145 | sendbuf[13] = DebugVersion; |
134 | 146 | ||
135 | //2、发送帧 | 147 | //2、发送帧 |
136 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 148 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
149 | + | ||
150 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
137 | } | 151 | } |
138 | 152 | ||
139 | //发送序列号 | 153 | //发送序列号 |
140 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllSerialNumber(int Uartport, int FrameSequence, int DeviceID, unsigned char *SerialNumber, int SerialNumberLen) | 154 | +T_JZsdkReturnCode HalSend_type1Send_SendAllSerialNumber(int Uartport, int FrameSequence, int DeviceID, unsigned char *SerialNumber, int SerialNumberLen) |
141 | { | 155 | { |
142 | printf("发送所有序列号\n"); | 156 | printf("发送所有序列号\n"); |
143 | 157 | ||
@@ -158,11 +172,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllSerialNumber(int Uartport, int Fram | @@ -158,11 +172,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllSerialNumber(int Uartport, int Fram | ||
158 | sendbuf[4] = (send_buf_len & 0xff); | 172 | sendbuf[4] = (send_buf_len & 0xff); |
159 | 173 | ||
160 | //2、发送帧 | 174 | //2、发送帧 |
161 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 175 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
176 | + | ||
177 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
162 | } | 178 | } |
163 | 179 | ||
164 | //发送成功帧 | 180 | //发送成功帧 |
165 | -int JZsdk_Uart_SendDeal_Reply_Sucesss(int Uartport ,int FrameSequence) | 181 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Success(int Uartport ,int FrameSequence) |
166 | { | 182 | { |
167 | unsigned char sendbuf[256]; | 183 | unsigned char sendbuf[256]; |
168 | int send_buf_len; | 184 | int send_buf_len; |
@@ -174,11 +190,13 @@ int JZsdk_Uart_SendDeal_Reply_Sucesss(int Uartport ,int FrameSequence) | @@ -174,11 +190,13 @@ int JZsdk_Uart_SendDeal_Reply_Sucesss(int Uartport ,int FrameSequence) | ||
174 | sendbuf[6] = FrameSequence; //帧序列 | 190 | sendbuf[6] = FrameSequence; //帧序列 |
175 | 191 | ||
176 | //3、发送帧 | 192 | //3、发送帧 |
177 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 193 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
194 | + | ||
195 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
178 | } | 196 | } |
179 | 197 | ||
180 | //发送失败帧 | 198 | //发送失败帧 |
181 | -int JZsdk_Uart_SendDeal_Reply_Failure(int Uartport ,int FrameSequence) | 199 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Failure(int Uartport ,int FrameSequence) |
182 | { | 200 | { |
183 | unsigned char sendbuf[256]; | 201 | unsigned char sendbuf[256]; |
184 | int send_buf_len; | 202 | int send_buf_len; |
@@ -190,11 +208,11 @@ int JZsdk_Uart_SendDeal_Reply_Failure(int Uartport ,int FrameSequence) | @@ -190,11 +208,11 @@ int JZsdk_Uart_SendDeal_Reply_Failure(int Uartport ,int FrameSequence) | ||
190 | sendbuf[6] = FrameSequence; //帧序列 | 208 | sendbuf[6] = FrameSequence; //帧序列 |
191 | 209 | ||
192 | //3、发送帧 | 210 | //3、发送帧 |
193 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 211 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
194 | } | 212 | } |
195 | 213 | ||
196 | //发送校验失败帧 | 214 | //发送校验失败帧 |
197 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_CheckError(int Uartport ,int FrameSequence) | 215 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CheckError(int Uartport ,int FrameSequence) |
198 | { | 216 | { |
199 | unsigned char sendbuf[256]; | 217 | unsigned char sendbuf[256]; |
200 | int send_buf_len; | 218 | int send_buf_len; |
@@ -206,11 +224,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_CheckError(int Uartport ,int FrameSe | @@ -206,11 +224,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_CheckError(int Uartport ,int FrameSe | ||
206 | sendbuf[6] = FrameSequence; //帧序列 | 224 | sendbuf[6] = FrameSequence; //帧序列 |
207 | 225 | ||
208 | //3、发送帧 | 226 | //3、发送帧 |
209 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 227 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
210 | } | 228 | } |
211 | 229 | ||
212 | //发送解码失败帧 | 230 | //发送解码失败帧 |
213 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_DecodeError(int Uartport ,int FrameSequence) | 231 | +T_JZsdkReturnCode HalSend_type1Send_Reply_DecodeError(int Uartport ,int FrameSequence) |
214 | { | 232 | { |
215 | unsigned char sendbuf[256]; | 233 | unsigned char sendbuf[256]; |
216 | int send_buf_len; | 234 | int send_buf_len; |
@@ -222,11 +240,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_DecodeError(int Uartport ,int FrameS | @@ -222,11 +240,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_DecodeError(int Uartport ,int FrameS | ||
222 | sendbuf[6] = FrameSequence; //帧序列 | 240 | sendbuf[6] = FrameSequence; //帧序列 |
223 | 241 | ||
224 | //3、发送帧 | 242 | //3、发送帧 |
225 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 243 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
226 | } | 244 | } |
227 | 245 | ||
228 | //发送当前从设备名 | 246 | //发送当前从设备名 |
229 | -int JZsdk_Uart_SendDeal_Reply_SecondaryDeviceName(int Uartport , int device_name, int FrameSequence) | 247 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SecondaryDeviceName(int Uartport , int device_name, int FrameSequence) |
230 | { | 248 | { |
231 | unsigned char sendbuf[256]; | 249 | unsigned char sendbuf[256]; |
232 | int send_buf_len; | 250 | int send_buf_len; |
@@ -239,12 +257,12 @@ int JZsdk_Uart_SendDeal_Reply_SecondaryDeviceName(int Uartport , int device_name | @@ -239,12 +257,12 @@ int JZsdk_Uart_SendDeal_Reply_SecondaryDeviceName(int Uartport , int device_name | ||
239 | sendbuf[10] = device_name; | 257 | sendbuf[10] = device_name; |
240 | 258 | ||
241 | //3、发送帧 | 259 | //3、发送帧 |
242 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 260 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
243 | } | 261 | } |
244 | 262 | ||
245 | 263 | ||
246 | //查询当前从设备名 | 264 | //查询当前从设备名 |
247 | -int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence) | 265 | +T_JZsdkReturnCode HalSend_type1Send_QuerySecondaryDeviceName(int Uartport ,int FrameSequence) |
248 | { | 266 | { |
249 | unsigned char sendbuf[256]; | 267 | unsigned char sendbuf[256]; |
250 | int send_buf_len; | 268 | int send_buf_len; |
@@ -256,11 +274,11 @@ int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence | @@ -256,11 +274,11 @@ int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence | ||
256 | sendbuf[6] = FrameSequence; //帧序列 | 274 | sendbuf[6] = FrameSequence; //帧序列 |
257 | 275 | ||
258 | //3、发送帧 | 276 | //3、发送帧 |
259 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 277 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
260 | } | 278 | } |
261 | 279 | ||
262 | //发送当前设备序列号 | 280 | //发送当前设备序列号 |
263 | -int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber, int SerialNumberLenth) | 281 | +T_JZsdkReturnCode HalSend_type1Send_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber, int SerialNumberLenth) |
264 | { | 282 | { |
265 | unsigned char sendbuf[256]; | 283 | unsigned char sendbuf[256]; |
266 | int send_buf_len; | 284 | int send_buf_len; |
@@ -283,7 +301,7 @@ int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *Seri | @@ -283,7 +301,7 @@ int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *Seri | ||
283 | sendbuf[4] = send_buf_len; | 301 | sendbuf[4] = send_buf_len; |
284 | 302 | ||
285 | //3、发送帧 | 303 | //3、发送帧 |
286 | - JZsdk_Uart_UartSend(UartPort ,sendbuf, send_buf_len); | 304 | + HalSend_SendData(UartPort ,sendbuf, send_buf_len, 1); |
287 | } | 305 | } |
288 | 306 | ||
289 | /********* | 307 | /********* |
@@ -292,7 +310,7 @@ int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *Seri | @@ -292,7 +310,7 @@ int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *Seri | ||
292 | * | 310 | * |
293 | * | 311 | * |
294 | * *******/ | 312 | * *******/ |
295 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_DeviceMessage(int UartPort, int FrameSequence, unsigned char *message, unsigned int messageLen) | 313 | +T_JZsdkReturnCode HalSend_type1Send_DeviceMessage(int UartPort, int FrameSequence, unsigned char *message, unsigned int messageLen) |
296 | { | 314 | { |
297 | unsigned char sendbuf[300]; | 315 | unsigned char sendbuf[300]; |
298 | memset(sendbuf,0,sizeof(sendbuf)); | 316 | memset(sendbuf,0,sizeof(sendbuf)); |
@@ -308,7 +326,7 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_DeviceMessage(int UartPort, int FrameSeque | @@ -308,7 +326,7 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_DeviceMessage(int UartPort, int FrameSeque | ||
308 | sendbuf[9+messageLen + 1] = 0x23; | 326 | sendbuf[9+messageLen + 1] = 0x23; |
309 | 327 | ||
310 | //3、发送帧 | 328 | //3、发送帧 |
311 | - JZsdk_Uart_UartSend(UartPort ,sendbuf, send_buf_len); | 329 | + HalSend_SendData(UartPort ,sendbuf, send_buf_len, 1); |
312 | } | 330 | } |
313 | 331 | ||
314 | 332 | ||
@@ -317,7 +335,7 @@ struct JZsdk_MusicListSentStruct | @@ -317,7 +335,7 @@ struct JZsdk_MusicListSentStruct | ||
317 | int UartPort; | 335 | int UartPort; |
318 | int FrameSequence; | 336 | int FrameSequence; |
319 | int music_sum; | 337 | int music_sum; |
320 | - char **MusicName; | 338 | + unsigned char **MusicName; |
321 | int *MusicNameLength; | 339 | int *MusicNameLength; |
322 | }; | 340 | }; |
323 | 341 | ||
@@ -326,7 +344,7 @@ struct JZsdk_MusicListSentStruct | @@ -326,7 +344,7 @@ struct JZsdk_MusicListSentStruct | ||
326 | * 歌曲列表发送任务函数 | 344 | * 歌曲列表发送任务函数 |
327 | * | 345 | * |
328 | * ***********/ | 346 | * ***********/ |
329 | -static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | 347 | +static void HalSend_type1Send_Reply_Musiclist_Task(void *data) |
330 | { | 348 | { |
331 | struct JZsdk_MusicListSentStruct *taskData = (struct JZsdk_MusicListSentStruct *)data; | 349 | struct JZsdk_MusicListSentStruct *taskData = (struct JZsdk_MusicListSentStruct *)data; |
332 | unsigned char sendbuf[256]; | 350 | unsigned char sendbuf[256]; |
@@ -340,7 +358,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | @@ -340,7 +358,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | ||
340 | sendbuf[6] = taskData->FrameSequence; //帧序列 | 358 | sendbuf[6] = taskData->FrameSequence; //帧序列 |
341 | //发送帧 | 359 | //发送帧 |
342 | printf("发送操作成功帧\n"); | 360 | printf("发送操作成功帧\n"); |
343 | - JZsdk_Uart_UartSend_NotTask(taskData->UartPort ,sendbuf, send_buf_len); | 361 | + HalSend_SendData(taskData->UartPort ,sendbuf, send_buf_len, 0); |
344 | 362 | ||
345 | //2、发送开始帧 | 363 | //2、发送开始帧 |
346 | //获取帧样板 | 364 | //获取帧样板 |
@@ -351,7 +369,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | @@ -351,7 +369,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | ||
351 | sendbuf[9] = taskData->music_sum; | 369 | sendbuf[9] = taskData->music_sum; |
352 | //发送帧 | 370 | //发送帧 |
353 | printf("发送歌曲开始列表帧\n"); | 371 | printf("发送歌曲开始列表帧\n"); |
354 | - JZsdk_Uart_UartSend_NotTask(taskData->UartPort ,sendbuf, send_buf_len); | 372 | + HalSend_SendData(taskData->UartPort ,sendbuf, send_buf_len, 0); |
355 | 373 | ||
356 | //3、逐一调用发送函数将歌曲名发出 | 374 | //3、逐一调用发送函数将歌曲名发出 |
357 | for (int i = 0; i < (taskData->music_sum) ; i++) | 375 | for (int i = 0; i < (taskData->music_sum) ; i++) |
@@ -368,7 +386,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | @@ -368,7 +386,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | ||
368 | sendbuf[3] = (send_buf_len >> 8); | 386 | sendbuf[3] = (send_buf_len >> 8); |
369 | sendbuf[4] = (send_buf_len & 0xff); | 387 | sendbuf[4] = (send_buf_len & 0xff); |
370 | sendbuf[6] = taskData->FrameSequence; //帧序列 | 388 | sendbuf[6] = taskData->FrameSequence; //帧序列 |
371 | - JZsdk_Uart_UartSend_NotTask(taskData->UartPort ,sendbuf, send_buf_len); | 389 | + HalSend_SendData(taskData->UartPort ,sendbuf, send_buf_len, 0); |
372 | } | 390 | } |
373 | 391 | ||
374 | //4、发送结束帧 | 392 | //4、发送结束帧 |
@@ -380,7 +398,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | @@ -380,7 +398,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | ||
380 | sendbuf[9] = 0x00; | 398 | sendbuf[9] = 0x00; |
381 | //发送帧 | 399 | //发送帧 |
382 | printf("发送歌曲结束列表"); | 400 | printf("发送歌曲结束列表"); |
383 | - JZsdk_Uart_UartSend_NotTask(taskData->UartPort ,sendbuf, send_buf_len); | 401 | + HalSend_SendData(taskData->UartPort ,sendbuf, send_buf_len, 0); |
384 | 402 | ||
385 | //5、释放内存 | 403 | //5、释放内存 |
386 | for (int i = 0; i < taskData->music_sum; i++) | 404 | for (int i = 0; i < taskData->music_sum; i++) |
@@ -398,7 +416,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | @@ -398,7 +416,7 @@ static void JZsdk_Uart_SentDeal_Reply_Musiclist_Task(void *data) | ||
398 | } | 416 | } |
399 | 417 | ||
400 | //发送歌曲列表Ⅰ型 | 418 | //发送歌曲列表Ⅰ型 |
401 | -T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSequence, int music_sum ,char **MusicName ,int *MusicNameLength) | 419 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Musiclist(int UartPort ,int FrameSequence, int music_sum ,unsigned char **MusicName ,int *MusicNameLength) |
402 | { | 420 | { |
403 | struct JZsdk_MusicListSentStruct *musicList = (struct JZsdk_MusicListSentStruct *)malloc(sizeof(struct JZsdk_MusicListSentStruct)); | 421 | struct JZsdk_MusicListSentStruct *musicList = (struct JZsdk_MusicListSentStruct *)malloc(sizeof(struct JZsdk_MusicListSentStruct)); |
404 | if (musicList == NULL) | 422 | if (musicList == NULL) |
@@ -412,7 +430,7 @@ T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSeq | @@ -412,7 +430,7 @@ T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSeq | ||
412 | musicList->MusicName = MusicName; | 430 | musicList->MusicName = MusicName; |
413 | musicList->MusicNameLength = MusicNameLength; | 431 | musicList->MusicNameLength = MusicNameLength; |
414 | 432 | ||
415 | - T_JZsdkReturnCode ret = TaskManagement_SubmitTask(JZsdk_Uart_SentDeal_Reply_Musiclist_Task, (void *)musicList); | 433 | + T_JZsdkReturnCode ret = TaskManagement_SubmitTask(HalSend_type1Send_Reply_Musiclist_Task, (void *)musicList); |
416 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE) | 434 | if (ret == JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE) |
417 | { | 435 | { |
418 | free(musicList); | 436 | free(musicList); |
@@ -424,7 +442,7 @@ T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSeq | @@ -424,7 +442,7 @@ T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSeq | ||
424 | } | 442 | } |
425 | 443 | ||
426 | //发送歌曲列表开始帧 | 444 | //发送歌曲列表开始帧 |
427 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Start(int Uartport, int FrameSequence, int music_sum) | 445 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Start(int Uartport, int FrameSequence, int music_sum) |
428 | { | 446 | { |
429 | printf("发送歌曲开始列表帧\n"); | 447 | printf("发送歌曲开始列表帧\n"); |
430 | 448 | ||
@@ -439,13 +457,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Start(int Uartport, int Fra | @@ -439,13 +457,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Start(int Uartport, int Fra | ||
439 | sendbuf[9] = music_sum; | 457 | sendbuf[9] = music_sum; |
440 | 458 | ||
441 | //发送帧 | 459 | //发送帧 |
442 | - JZsdk_Uart_UartSend_NotTask(Uartport ,sendbuf, send_buf_len); | 460 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 0); |
443 | 461 | ||
444 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 462 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
445 | } | 463 | } |
446 | 464 | ||
447 | //发送歌曲列表结束帧 | 465 | //发送歌曲列表结束帧 |
448 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Stop(int Uartport, int FrameSequence) | 466 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Stop(int Uartport, int FrameSequence) |
449 | { | 467 | { |
450 | printf("发送歌曲结束列表帧\n"); | 468 | printf("发送歌曲结束列表帧\n"); |
451 | 469 | ||
@@ -458,11 +476,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Stop(int Uartport, int Fram | @@ -458,11 +476,11 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Stop(int Uartport, int Fram | ||
458 | //写入数据 | 476 | //写入数据 |
459 | sendbuf[6] = FrameSequence; //帧序列 | 477 | sendbuf[6] = FrameSequence; //帧序列 |
460 | 478 | ||
461 | - JZsdk_Uart_UartSend_NotTask(Uartport ,sendbuf, send_buf_len); | 479 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 0); |
462 | } | 480 | } |
463 | 481 | ||
464 | //发送歌曲列表Ⅱ型 | 482 | //发送歌曲列表Ⅱ型 |
465 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_2(int Uartport, int FrameSequence, unsigned char *name, unsigned int namelen, unsigned int Filesize, unsigned int Time) | 483 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_2(int Uartport, int FrameSequence, unsigned char *name, unsigned int namelen, unsigned int Filesize, unsigned int Time) |
466 | { | 484 | { |
467 | printf("发送歌曲列表Ⅱ型 %s %d %d %d\n",name, namelen, Filesize, Time); | 485 | printf("发送歌曲列表Ⅱ型 %s %d %d %d\n",name, namelen, Filesize, Time); |
468 | unsigned char sendbuf[400]; | 486 | unsigned char sendbuf[400]; |
@@ -496,14 +514,14 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_2(int Uartport, int FrameSe | @@ -496,14 +514,14 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_2(int Uartport, int FrameSe | ||
496 | sendbuf[send_buf_len-1] = 0x23; | 514 | sendbuf[send_buf_len-1] = 0x23; |
497 | 515 | ||
498 | //3、发送帧 | 516 | //3、发送帧 |
499 | - JZsdk_Uart_UartSend_NotTask(Uartport ,sendbuf, send_buf_len); | 517 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 0); |
500 | 518 | ||
501 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 519 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
502 | } | 520 | } |
503 | 521 | ||
504 | 522 | ||
505 | //发送音频详细信息帧 | 523 | //发送音频详细信息帧 |
506 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioDetailMessage(int Uartport, int FrameSequence, unsigned char type ,unsigned char *data, unsigned int datalen) | 524 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioDetailMessage(int Uartport, int FrameSequence, unsigned char type ,unsigned char *data, unsigned int datalen) |
507 | { | 525 | { |
508 | printf("发送音频详细信息帧\n"); | 526 | printf("发送音频详细信息帧\n"); |
509 | unsigned char sendbuf[256]; | 527 | unsigned char sendbuf[256]; |
@@ -524,13 +542,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioDetailMessage(int Uartport, int | @@ -524,13 +542,13 @@ T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioDetailMessage(int Uartport, int | ||
524 | sendbuf[send_buf_len-1] = 0x23; | 542 | sendbuf[send_buf_len-1] = 0x23; |
525 | 543 | ||
526 | //3、发送帧 | 544 | //3、发送帧 |
527 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 545 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
528 | 546 | ||
529 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 547 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
530 | } | 548 | } |
531 | 549 | ||
532 | //发送播放状态结束帧 | 550 | //发送播放状态结束帧 |
533 | -int JZsdk_Uart_SendDeal_Send_PlayStatus_end(int Uartport) | 551 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport) |
534 | { | 552 | { |
535 | printf("发送播放状态结束帧\n"); | 553 | printf("发送播放状态结束帧\n"); |
536 | unsigned char sendbuf[256]; | 554 | unsigned char sendbuf[256]; |
@@ -542,11 +560,11 @@ int JZsdk_Uart_SendDeal_Send_PlayStatus_end(int Uartport) | @@ -542,11 +560,11 @@ int JZsdk_Uart_SendDeal_Send_PlayStatus_end(int Uartport) | ||
542 | //2、写入数据 | 560 | //2、写入数据 |
543 | 561 | ||
544 | //3、发送帧 | 562 | //3、发送帧 |
545 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 563 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
546 | } | 564 | } |
547 | 565 | ||
548 | //发送播放状态帧 | 566 | //发送播放状态帧 |
549 | -int JZsdk_Uart_SendDeal_Send_PlayStatus(int Uartport ,int num) | 567 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num) |
550 | { | 568 | { |
551 | printf("向"); | 569 | printf("向"); |
552 | switch (Uartport) | 570 | switch (Uartport) |
@@ -575,11 +593,11 @@ int JZsdk_Uart_SendDeal_Send_PlayStatus(int Uartport ,int num) | @@ -575,11 +593,11 @@ int JZsdk_Uart_SendDeal_Send_PlayStatus(int Uartport ,int num) | ||
575 | sendbuf[9] = (char)num; | 593 | sendbuf[9] = (char)num; |
576 | 594 | ||
577 | //3、发送帧 | 595 | //3、发送帧 |
578 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 596 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
579 | } | 597 | } |
580 | 598 | ||
581 | //回复当前播放的歌曲名字 | 599 | //回复当前播放的歌曲名字 |
582 | -int JZsdk_Uart_SendDeal_Reply_MusicName(int Uartport ,char *music_name, int music_name_len) | 600 | +T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_name, int music_name_len) |
583 | { | 601 | { |
584 | printf("发送当前歌曲名字帧"); | 602 | printf("发送当前歌曲名字帧"); |
585 | unsigned char sendbuf[256]; | 603 | unsigned char sendbuf[256]; |
@@ -599,13 +617,13 @@ int JZsdk_Uart_SendDeal_Reply_MusicName(int Uartport ,char *music_name, int musi | @@ -599,13 +617,13 @@ int JZsdk_Uart_SendDeal_Reply_MusicName(int Uartport ,char *music_name, int musi | ||
599 | sendbuf[4] = len & 0xff; | 617 | sendbuf[4] = len & 0xff; |
600 | 618 | ||
601 | //3、发送帧 | 619 | //3、发送帧 |
602 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, len); | 620 | + HalSend_SendData(Uartport ,sendbuf, len, 1); |
603 | } | 621 | } |
604 | 622 | ||
605 | //回复当前音量 | 623 | //回复当前音量 |
606 | -int JZsdk_Uart_SendDeal_Reply_Volume(int Uartport ,int num) | 624 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num) |
607 | { | 625 | { |
608 | - printf("发送播放状态帧\n"); | 626 | + printf("发送当前音量帧\n"); |
609 | unsigned char sendbuf[256]; | 627 | unsigned char sendbuf[256]; |
610 | int send_buf_len; | 628 | int send_buf_len; |
611 | 629 | ||
@@ -616,14 +634,14 @@ int JZsdk_Uart_SendDeal_Reply_Volume(int Uartport ,int num) | @@ -616,14 +634,14 @@ int JZsdk_Uart_SendDeal_Reply_Volume(int Uartport ,int num) | ||
616 | sendbuf[9] = (char)num; | 634 | sendbuf[9] = (char)num; |
617 | 635 | ||
618 | //3、发送帧 | 636 | //3、发送帧 |
619 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 637 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
620 | 638 | ||
621 | } | 639 | } |
622 | 640 | ||
623 | 641 | ||
624 | 642 | ||
625 | //回复软件版本号 | 643 | //回复软件版本号 |
626 | -int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion) | 644 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion) |
627 | { | 645 | { |
628 | printf("发送软件版本号帧\n"); | 646 | printf("发送软件版本号帧\n"); |
629 | unsigned char sendbuf[256]; | 647 | unsigned char sendbuf[256]; |
@@ -639,11 +657,11 @@ int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char | @@ -639,11 +657,11 @@ int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char | ||
639 | sendbuf[12] = debugVersion; | 657 | sendbuf[12] = debugVersion; |
640 | 658 | ||
641 | //3、发送帧 | 659 | //3、发送帧 |
642 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 660 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
643 | } | 661 | } |
644 | 662 | ||
645 | //发送循环状态 | 663 | //发送循环状态 |
646 | -int JZsdk_Uart_SendDeal_Reply_LoopPlayStatus(int Uartport ,int status) | 664 | +T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int status) |
647 | { | 665 | { |
648 | printf("发送循环状态帧\n"); | 666 | printf("发送循环状态帧\n"); |
649 | 667 | ||
@@ -657,12 +675,12 @@ int JZsdk_Uart_SendDeal_Reply_LoopPlayStatus(int Uartport ,int status) | @@ -657,12 +675,12 @@ int JZsdk_Uart_SendDeal_Reply_LoopPlayStatus(int Uartport ,int status) | ||
657 | sendbuf[9] = status; | 675 | sendbuf[9] = status; |
658 | 676 | ||
659 | //3、发送帧 | 677 | //3、发送帧 |
660 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 678 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
661 | 679 | ||
662 | } | 680 | } |
663 | 681 | ||
664 | //发送音色 | 682 | //发送音色 |
665 | -int JZsdk_Uart_SendDeal_Reply_TTS_tone(int Uartport ,int tone) | 683 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone) |
666 | { | 684 | { |
667 | printf("发送音色帧\n"); | 685 | printf("发送音色帧\n"); |
668 | 686 | ||
@@ -676,11 +694,11 @@ int JZsdk_Uart_SendDeal_Reply_TTS_tone(int Uartport ,int tone) | @@ -676,11 +694,11 @@ int JZsdk_Uart_SendDeal_Reply_TTS_tone(int Uartport ,int tone) | ||
676 | sendbuf[9] = tone; | 694 | sendbuf[9] = tone; |
677 | 695 | ||
678 | //3、发送帧 | 696 | //3、发送帧 |
679 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 697 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
680 | } | 698 | } |
681 | 699 | ||
682 | //发送语速 | 700 | //发送语速 |
683 | -int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed) | 701 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed) |
684 | { | 702 | { |
685 | printf("发送音色帧\n"); | 703 | printf("发送音色帧\n"); |
686 | 704 | ||
@@ -694,7 +712,7 @@ int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed) | @@ -694,7 +712,7 @@ int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed) | ||
694 | sendbuf[9] = speed; | 712 | sendbuf[9] = speed; |
695 | 713 | ||
696 | //3、发送帧 | 714 | //3、发送帧 |
697 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 715 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
698 | } | 716 | } |
699 | 717 | ||
700 | /************* | 718 | /************* |
@@ -702,7 +720,7 @@ int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed) | @@ -702,7 +720,7 @@ int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed) | ||
702 | * 发送opus解码状态 | 720 | * 发送opus解码状态 |
703 | * | 721 | * |
704 | * **************/ | 722 | * **************/ |
705 | -int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value) | 723 | +T_JZsdkReturnCode HalSend_type1Send_OpusDecodeStatus(int Uartport,int value) |
706 | { | 724 | { |
707 | printf("发送opus解码状态帧\n"); | 725 | printf("发送opus解码状态帧\n"); |
708 | 726 | ||
@@ -716,7 +734,7 @@ int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value) | @@ -716,7 +734,7 @@ int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value) | ||
716 | sendbuf[9] = value; | 734 | sendbuf[9] = value; |
717 | 735 | ||
718 | //3、发送帧 | 736 | //3、发送帧 |
719 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 737 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
720 | } | 738 | } |
721 | 739 | ||
722 | /**************************************************************************************************************************************************** | 740 | /**************************************************************************************************************************************************** |
@@ -725,10 +743,10 @@ int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value) | @@ -725,10 +743,10 @@ int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value) | ||
725 | * | 743 | * |
726 | ****************************************************************************************************************************************************/ | 744 | ****************************************************************************************************************************************************/ |
727 | 745 | ||
728 | -//回复当前云台角度 | ||
729 | -int JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(int Uartport ,int angle) | 746 | +//回复当前俯仰云台角度 |
747 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int angle) | ||
730 | { | 748 | { |
731 | - printf("发送当前云台角度帧\n"); | 749 | + printf("发送当前俯仰云台角度帧\n"); |
732 | unsigned char sendbuf[256]; | 750 | unsigned char sendbuf[256]; |
733 | int send_buf_len; | 751 | int send_buf_len; |
734 | 752 | ||
@@ -748,11 +766,11 @@ int JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(int Uartport ,int angle) | @@ -748,11 +766,11 @@ int JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(int Uartport ,int angle) | ||
748 | sendbuf[11] = (char)(angle & 255); | 766 | sendbuf[11] = (char)(angle & 255); |
749 | 767 | ||
750 | //3、发送帧 | 768 | //3、发送帧 |
751 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 769 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
752 | } | 770 | } |
753 | 771 | ||
754 | //设置当前云台角度 | 772 | //设置当前云台角度 |
755 | -int JZsdk_Uart_SendDeal_Set_GimbalPitchAngle(int Uartport ,int angle) | 773 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalPitchAngle(int Uartport ,int angle) |
756 | { | 774 | { |
757 | //printf("发送设置云台角度帧 %d\n",angle); //该打印可能会造成卡顿 | 775 | //printf("发送设置云台角度帧 %d\n",angle); //该打印可能会造成卡顿 |
758 | unsigned char sendbuf[256]; | 776 | unsigned char sendbuf[256]; |
@@ -776,11 +794,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalPitchAngle(int Uartport ,int angle) | @@ -776,11 +794,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalPitchAngle(int Uartport ,int angle) | ||
776 | sendbuf[11] = (angle & 0xff); | 794 | sendbuf[11] = (angle & 0xff); |
777 | 795 | ||
778 | //3、发送帧 | 796 | //3、发送帧 |
779 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 797 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
780 | } | 798 | } |
781 | 799 | ||
782 | //查询云台角度 | 800 | //查询云台角度 |
783 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence) | 801 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence) |
784 | { | 802 | { |
785 | printf("发送查询云台角度帧\n"); | 803 | printf("发送查询云台角度帧\n"); |
786 | unsigned char sendbuf[256]; | 804 | unsigned char sendbuf[256]; |
@@ -793,11 +811,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence) | @@ -793,11 +811,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence) | ||
793 | sendbuf[6] = FrameSequence; | 811 | sendbuf[6] = FrameSequence; |
794 | 812 | ||
795 | //3、发送帧 | 813 | //3、发送帧 |
796 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 814 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
797 | } | 815 | } |
798 | 816 | ||
799 | //微调云台pitch | 817 | //微调云台pitch |
800 | -int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning) | 818 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning) |
801 | { | 819 | { |
802 | printf("发送微调云台pitch帧\n"); | 820 | printf("发送微调云台pitch帧\n"); |
803 | unsigned char sendbuf[256]; | 821 | unsigned char sendbuf[256]; |
@@ -821,11 +839,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTun | @@ -821,11 +839,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTun | ||
821 | sendbuf[11] = (PitchFineTuning & 0xff); | 839 | sendbuf[11] = (PitchFineTuning & 0xff); |
822 | 840 | ||
823 | //3、发送帧 | 841 | //3、发送帧 |
824 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 842 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
825 | } | 843 | } |
826 | 844 | ||
827 | //查询云台角度微调值 | 845 | //查询云台角度微调值 |
828 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalFineTuningPitch(int Uartport, int FrameSequence) | 846 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalFineTuningPitch(int Uartport, int FrameSequence) |
829 | { | 847 | { |
830 | printf("发送查询云台角度微调值帧\n"); | 848 | printf("发送查询云台角度微调值帧\n"); |
831 | unsigned char sendbuf[256]; | 849 | unsigned char sendbuf[256]; |
@@ -838,11 +856,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalFineTuningPitch(int Uartport, int Fram | @@ -838,11 +856,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalFineTuningPitch(int Uartport, int Fram | ||
838 | sendbuf[6] = FrameSequence; //帧序列 | 856 | sendbuf[6] = FrameSequence; //帧序列 |
839 | 857 | ||
840 | //3、发送帧 | 858 | //3、发送帧 |
841 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 859 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
842 | } | 860 | } |
843 | 861 | ||
844 | //回复云台pitch微调值 | 862 | //回复云台pitch微调值 |
845 | -int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch) | 863 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch) |
846 | { | 864 | { |
847 | printf("发送云台pitch微调值\n"); | 865 | printf("发送云台pitch微调值\n"); |
848 | unsigned char sendbuf[256]; | 866 | unsigned char sendbuf[256]; |
@@ -866,11 +884,11 @@ int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSeque | @@ -866,11 +884,11 @@ int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSeque | ||
866 | sendbuf[11] = (FineTunigPitch & 0xff); | 884 | sendbuf[11] = (FineTunigPitch & 0xff); |
867 | 885 | ||
868 | //3、发送帧 | 886 | //3、发送帧 |
869 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 887 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
870 | } | 888 | } |
871 | 889 | ||
872 | //设置云台联动 | 890 | //设置云台联动 |
873 | -int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value) | 891 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value) |
874 | { | 892 | { |
875 | printf("发送设置云台联动帧\n"); | 893 | printf("发送设置云台联动帧\n"); |
876 | unsigned char sendbuf[256]; | 894 | unsigned char sendbuf[256]; |
@@ -884,11 +902,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, | @@ -884,11 +902,11 @@ int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, | ||
884 | sendbuf[10] = value; | 902 | sendbuf[10] = value; |
885 | 903 | ||
886 | //3、发送帧 | 904 | //3、发送帧 |
887 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 905 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
888 | } | 906 | } |
889 | 907 | ||
890 | //查询云台联动值 | 908 | //查询云台联动值 |
891 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence) | 909 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence) |
892 | { | 910 | { |
893 | printf("发送查询云台联动值帧\n"); | 911 | printf("发送查询云台联动值帧\n"); |
894 | unsigned char sendbuf[256]; | 912 | unsigned char sendbuf[256]; |
@@ -901,11 +919,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence | @@ -901,11 +919,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence | ||
901 | sendbuf[6] = FrameSequence; //帧序列 | 919 | sendbuf[6] = FrameSequence; //帧序列 |
902 | 920 | ||
903 | //3、发送帧 | 921 | //3、发送帧 |
904 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 922 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
905 | } | 923 | } |
906 | 924 | ||
907 | //发送云台联动值 | 925 | //发送云台联动值 |
908 | -int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int value) | 926 | +T_JZsdkReturnCode HalSend_type1Send_GimbalLinkageControl(int Uartport,int FrameSequence,int value) |
909 | { | 927 | { |
910 | printf("发送云台联动值帧\n"); | 928 | printf("发送云台联动值帧\n"); |
911 | unsigned char sendbuf[256]; | 929 | unsigned char sendbuf[256]; |
@@ -919,11 +937,11 @@ int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int | @@ -919,11 +937,11 @@ int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int | ||
919 | sendbuf[10] = value; | 937 | sendbuf[10] = value; |
920 | 938 | ||
921 | //3、发送帧 | 939 | //3、发送帧 |
922 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 940 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
923 | } | 941 | } |
924 | 942 | ||
925 | //发送云台最大最小值帧 | 943 | //发送云台最大最小值帧 |
926 | -int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | 944 | +T_JZsdkReturnCode HalSend_type1Send_SetGimbalRange(int Uartport,int FrameSequence,int value) |
927 | { | 945 | { |
928 | printf("发送云台最大最小值帧\n"); | 946 | printf("发送云台最大最小值帧\n"); |
929 | unsigned char sendbuf[256]; | 947 | unsigned char sendbuf[256]; |
@@ -937,7 +955,7 @@ int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | @@ -937,7 +955,7 @@ int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | ||
937 | sendbuf[10] = value; | 955 | sendbuf[10] = value; |
938 | 956 | ||
939 | //3、发送帧 | 957 | //3、发送帧 |
940 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 958 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
941 | } | 959 | } |
942 | 960 | ||
943 | /**************************************************************************************************************************************************** | 961 | /**************************************************************************************************************************************************** |
@@ -947,7 +965,7 @@ int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | @@ -947,7 +965,7 @@ int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value) | ||
947 | ****************************************************************************************************************************************************/ | 965 | ****************************************************************************************************************************************************/ |
948 | 966 | ||
949 | //发送设置探照灯爆闪频率 | 967 | //发送设置探照灯爆闪频率 |
950 | -int JZsdk_Uart_SendDeal_Set_SearchLightFrequency(int Uartport ,int Frequency) | 968 | +T_JZsdkReturnCode HalSend_type1Send_Set_SearchLightFrequency(int Uartport ,int Frequency) |
951 | { | 969 | { |
952 | printf("发送设置爆闪频率帧\n"); | 970 | printf("发送设置爆闪频率帧\n"); |
953 | 971 | ||
@@ -961,11 +979,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLightFrequency(int Uartport ,int Frequency) | @@ -961,11 +979,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLightFrequency(int Uartport ,int Frequency) | ||
961 | sendbuf[10] = Frequency; | 979 | sendbuf[10] = Frequency; |
962 | 980 | ||
963 | //3、发送帧 | 981 | //3、发送帧 |
964 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 982 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
965 | } | 983 | } |
966 | 984 | ||
967 | //设置探照灯控制 | 985 | //设置探照灯控制 |
968 | -int JZsdk_Uart_SendDeal_SearchLight_Control(int Uartport,int mode) | 986 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Control(int Uartport,int mode) |
969 | { | 987 | { |
970 | printf("发送探照灯控制\n"); | 988 | printf("发送探照灯控制\n"); |
971 | 989 | ||
@@ -979,11 +997,11 @@ int JZsdk_Uart_SendDeal_SearchLight_Control(int Uartport,int mode) | @@ -979,11 +997,11 @@ int JZsdk_Uart_SendDeal_SearchLight_Control(int Uartport,int mode) | ||
979 | sendbuf[10] = mode; | 997 | sendbuf[10] = mode; |
980 | 998 | ||
981 | //3、发送帧 | 999 | //3、发送帧 |
982 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1000 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
983 | } | 1001 | } |
984 | 1002 | ||
985 | //设置探照灯亮度 | 1003 | //设置探照灯亮度 |
986 | -int JZsdk_Uart_SendDeal_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen) | 1004 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen) |
987 | { | 1005 | { |
988 | printf("发送设置探照灯亮度\n"); | 1006 | printf("发送设置探照灯亮度\n"); |
989 | 1007 | ||
@@ -998,13 +1016,13 @@ int JZsdk_Uart_SendDeal_SearchLight_SetLumen(int Uartport, int LeftLumen, int | @@ -998,13 +1016,13 @@ int JZsdk_Uart_SendDeal_SearchLight_SetLumen(int Uartport, int LeftLumen, int | ||
998 | sendbuf[10] = RightLumen; | 1016 | sendbuf[10] = RightLumen; |
999 | 1017 | ||
1000 | //3、发送帧 | 1018 | //3、发送帧 |
1001 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1019 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1002 | } | 1020 | } |
1003 | 1021 | ||
1004 | //发送 | 1022 | //发送 |
1005 | 1023 | ||
1006 | //查询探照灯频率 | 1024 | //查询探照灯频率 |
1007 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Frequency(int Uartport) | 1025 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Frequency(int Uartport) |
1008 | { | 1026 | { |
1009 | printf("发送查询探照灯频率帧\n"); | 1027 | printf("发送查询探照灯频率帧\n"); |
1010 | 1028 | ||
@@ -1015,11 +1033,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Frequency(int Uartport) | @@ -1015,11 +1033,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Frequency(int Uartport) | ||
1015 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY, sendbuf, &send_buf_len); | 1033 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_FREQUENCY, sendbuf, &send_buf_len); |
1016 | 1034 | ||
1017 | //2、发送帧 | 1035 | //2、发送帧 |
1018 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1036 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1019 | } | 1037 | } |
1020 | 1038 | ||
1021 | //查询探照灯亮度 | 1039 | //查询探照灯亮度 |
1022 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Lumen(int Uartport) | 1040 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Lumen(int Uartport) |
1023 | { | 1041 | { |
1024 | printf("发送查询探照灯亮度帧\n"); | 1042 | printf("发送查询探照灯亮度帧\n"); |
1025 | 1043 | ||
@@ -1030,11 +1048,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Lumen(int Uartport) | @@ -1030,11 +1048,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Lumen(int Uartport) | ||
1030 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_LUMEN, sendbuf, &send_buf_len); | 1048 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_LUMEN, sendbuf, &send_buf_len); |
1031 | 1049 | ||
1032 | //2、发送帧 | 1050 | //2、发送帧 |
1033 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1051 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1034 | } | 1052 | } |
1035 | 1053 | ||
1036 | //查询探照灯模式 | 1054 | //查询探照灯模式 |
1037 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Mode(int Uartport) | 1055 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Mode(int Uartport) |
1038 | { | 1056 | { |
1039 | printf("发送查询探照灯模式帧\n"); | 1057 | printf("发送查询探照灯模式帧\n"); |
1040 | 1058 | ||
@@ -1045,11 +1063,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Mode(int Uartport) | @@ -1045,11 +1063,11 @@ int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Mode(int Uartport) | ||
1045 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_MODE, sendbuf, &send_buf_len); | 1063 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_MODE, sendbuf, &send_buf_len); |
1046 | 1064 | ||
1047 | //2、发送帧 | 1065 | //2、发送帧 |
1048 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1066 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1049 | } | 1067 | } |
1050 | 1068 | ||
1051 | //查询探照灯属性 | 1069 | //查询探照灯属性 |
1052 | -int JZsdk_Uart_SendDeal_CheckStatus_LightAttribute(int Uartport) | 1070 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Attribute(int Uartport) |
1053 | { | 1071 | { |
1054 | printf("发送查询探照灯属性帧\n"); | 1072 | printf("发送查询探照灯属性帧\n"); |
1055 | 1073 | ||
@@ -1060,11 +1078,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_LightAttribute(int Uartport) | @@ -1060,11 +1078,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_LightAttribute(int Uartport) | ||
1060 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_LIGHTATTRIBUTE, sendbuf, &send_buf_len); | 1078 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_LIGHTATTRIBUTE, sendbuf, &send_buf_len); |
1061 | 1079 | ||
1062 | //2、发送帧 | 1080 | //2、发送帧 |
1063 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1081 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1064 | } | 1082 | } |
1065 | 1083 | ||
1066 | //查询探照灯温度 | 1084 | //查询探照灯温度 |
1067 | -int JZsdk_Uart_SendDeal_CheckStatus_SearchLightTemperture(int Uartport) | 1085 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Temperture(int Uartport) |
1068 | { | 1086 | { |
1069 | printf("发送查询探照灯温度\n"); | 1087 | printf("发送查询探照灯温度\n"); |
1070 | 1088 | ||
@@ -1075,11 +1093,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_SearchLightTemperture(int Uartport) | @@ -1075,11 +1093,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_SearchLightTemperture(int Uartport) | ||
1075 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE, sendbuf, &send_buf_len); | 1093 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_SEARCHLIGHT_TEMPERATURE, sendbuf, &send_buf_len); |
1076 | 1094 | ||
1077 | //2、发送帧 | 1095 | //2、发送帧 |
1078 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1096 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1079 | } | 1097 | } |
1080 | 1098 | ||
1081 | //开启消息订阅 | 1099 | //开启消息订阅 |
1082 | -int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value) | 1100 | +T_JZsdkReturnCode HalSend_type1Send_MessageSubcription_Control(int Uartport, int value) |
1083 | { | 1101 | { |
1084 | printf("发送开启消息订阅%d\n",value); | 1102 | printf("发送开启消息订阅%d\n",value); |
1085 | 1103 | ||
@@ -1093,7 +1111,7 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value) | @@ -1093,7 +1111,7 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value) | ||
1093 | sendbuf[10] = value; | 1111 | sendbuf[10] = value; |
1094 | 1112 | ||
1095 | //3、发送帧 | 1113 | //3、发送帧 |
1096 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1114 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1097 | } | 1115 | } |
1098 | 1116 | ||
1099 | /**************************************************************************************************************************************************** | 1117 | /**************************************************************************************************************************************************** |
@@ -1106,7 +1124,7 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value) | @@ -1106,7 +1124,7 @@ int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value) | ||
1106 | * 设置警灯状态 | 1124 | * 设置警灯状态 |
1107 | * | 1125 | * |
1108 | * **************/ | 1126 | * **************/ |
1109 | -int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mode) | 1127 | +T_JZsdkReturnCode HalSend_type1Send_Set_WarningLight_Status(int Uartport,int status, int mode) |
1110 | { | 1128 | { |
1111 | printf("发送设置警灯状态\n"); | 1129 | printf("发送设置警灯状态\n"); |
1112 | 1130 | ||
@@ -1121,7 +1139,7 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mod | @@ -1121,7 +1139,7 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mod | ||
1121 | sendbuf[10] = mode; | 1139 | sendbuf[10] = mode; |
1122 | 1140 | ||
1123 | //3、发送帧 | 1141 | //3、发送帧 |
1124 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1142 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1125 | } | 1143 | } |
1126 | 1144 | ||
1127 | /************* | 1145 | /************* |
@@ -1129,7 +1147,7 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mod | @@ -1129,7 +1147,7 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mod | ||
1129 | * 设置警灯颜色 | 1147 | * 设置警灯颜色 |
1130 | * | 1148 | * |
1131 | * **************/ | 1149 | * **************/ |
1132 | -int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int color2) | 1150 | +T_JZsdkReturnCode HalSend_type1Send_Set_WarningLight_Color(int Uartport,int color1, int color2) |
1133 | { | 1151 | { |
1134 | printf("发送设置警灯颜色\n"); | 1152 | printf("发送设置警灯颜色\n"); |
1135 | 1153 | ||
@@ -1144,11 +1162,11 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int colo | @@ -1144,11 +1162,11 @@ int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int colo | ||
1144 | sendbuf[10] = color2; | 1162 | sendbuf[10] = color2; |
1145 | 1163 | ||
1146 | //3、发送帧 | 1164 | //3、发送帧 |
1147 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1165 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1148 | } | 1166 | } |
1149 | 1167 | ||
1150 | //查询警灯状态 | 1168 | //查询警灯状态 |
1151 | -int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport) | 1169 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_WarningLightStatus(int Uartport) |
1152 | { | 1170 | { |
1153 | printf("发送查询警灯状态\n"); | 1171 | printf("发送查询警灯状态\n"); |
1154 | 1172 | ||
@@ -1159,11 +1177,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport) | @@ -1159,11 +1177,11 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport) | ||
1159 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_WARNINGLIGHT_STATUS, sendbuf, &send_buf_len); | 1177 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_WARNINGLIGHT_STATUS, sendbuf, &send_buf_len); |
1160 | 1178 | ||
1161 | //2、发送帧 | 1179 | //2、发送帧 |
1162 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1180 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1163 | } | 1181 | } |
1164 | 1182 | ||
1165 | //查询警灯颜色 | 1183 | //查询警灯颜色 |
1166 | -int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport) | 1184 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_WarningLightColor(int Uartport) |
1167 | { | 1185 | { |
1168 | printf("发送查询警灯颜色\n"); | 1186 | printf("发送查询警灯颜色\n"); |
1169 | 1187 | ||
@@ -1174,7 +1192,7 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport) | @@ -1174,7 +1192,7 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport) | ||
1174 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_WARNINGLIGHT_COLOR, sendbuf, &send_buf_len); | 1192 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_CHECKSTATUS_WARNINGLIGHT_COLOR, sendbuf, &send_buf_len); |
1175 | 1193 | ||
1176 | //2、发送帧 | 1194 | //2、发送帧 |
1177 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1195 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1178 | } | 1196 | } |
1179 | 1197 | ||
1180 | /**************************************************************************************************************************************************** | 1198 | /**************************************************************************************************************************************************** |
@@ -1188,7 +1206,7 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport) | @@ -1188,7 +1206,7 @@ int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport) | ||
1188 | * 发送探照灯爆闪频率 | 1206 | * 发送探照灯爆闪频率 |
1189 | * | 1207 | * |
1190 | * **************/ | 1208 | * **************/ |
1191 | -int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency) | 1209 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Frequency(int Uartport, int Frequency) |
1192 | { | 1210 | { |
1193 | printf("发送灯光频率帧\n"); | 1211 | printf("发送灯光频率帧\n"); |
1194 | 1212 | ||
@@ -1202,7 +1220,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency) | @@ -1202,7 +1220,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency) | ||
1202 | sendbuf[10] = Frequency; | 1220 | sendbuf[10] = Frequency; |
1203 | 1221 | ||
1204 | //3、发送帧 | 1222 | //3、发送帧 |
1205 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1223 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1206 | } | 1224 | } |
1207 | 1225 | ||
1208 | /************* | 1226 | /************* |
@@ -1210,7 +1228,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency) | @@ -1210,7 +1228,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency) | ||
1210 | * 发送探照灯模式 | 1228 | * 发送探照灯模式 |
1211 | * | 1229 | * |
1212 | * **************/ | 1230 | * **************/ |
1213 | -int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode) | 1231 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Mode(int Uartport, int mode) |
1214 | { | 1232 | { |
1215 | printf("发送探照灯模式帧\n"); | 1233 | printf("发送探照灯模式帧\n"); |
1216 | 1234 | ||
@@ -1224,7 +1242,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode) | @@ -1224,7 +1242,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode) | ||
1224 | sendbuf[10] = mode; | 1242 | sendbuf[10] = mode; |
1225 | 1243 | ||
1226 | //3、发送帧 | 1244 | //3、发送帧 |
1227 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1245 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1228 | } | 1246 | } |
1229 | 1247 | ||
1230 | /************* | 1248 | /************* |
@@ -1232,7 +1250,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode) | @@ -1232,7 +1250,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode) | ||
1232 | * 发送探照灯亮度 | 1250 | * 发送探照灯亮度 |
1233 | * | 1251 | * |
1234 | * **************/ | 1252 | * **************/ |
1235 | -int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen) | 1253 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen) |
1236 | { | 1254 | { |
1237 | printf("发送探照灯亮度帧\n"); | 1255 | printf("发送探照灯亮度帧\n"); |
1238 | 1256 | ||
@@ -1247,7 +1265,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightL | @@ -1247,7 +1265,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightL | ||
1247 | sendbuf[10] = RightLumen; | 1265 | sendbuf[10] = RightLumen; |
1248 | 1266 | ||
1249 | //3、发送帧 | 1267 | //3、发送帧 |
1250 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1268 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1251 | } | 1269 | } |
1252 | 1270 | ||
1253 | /************* | 1271 | /************* |
@@ -1255,7 +1273,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightL | @@ -1255,7 +1273,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightL | ||
1255 | * 发送探照灯温度 | 1273 | * 发送探照灯温度 |
1256 | * | 1274 | * |
1257 | * **************/ | 1275 | * **************/ |
1258 | -int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature) | 1276 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature) |
1259 | { | 1277 | { |
1260 | printf("发送探照灯温度帧\n"); | 1278 | printf("发送探照灯温度帧\n"); |
1261 | 1279 | ||
@@ -1270,7 +1288,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperatur | @@ -1270,7 +1288,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperatur | ||
1270 | sendbuf[10] = RightTemperature; | 1288 | sendbuf[10] = RightTemperature; |
1271 | 1289 | ||
1272 | //3、发送帧 | 1290 | //3、发送帧 |
1273 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1291 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1274 | } | 1292 | } |
1275 | 1293 | ||
1276 | 1294 | ||
@@ -1279,7 +1297,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperatur | @@ -1279,7 +1297,7 @@ int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperatur | ||
1279 | * 发送警灯状态 | 1297 | * 发送警灯状态 |
1280 | * | 1298 | * |
1281 | * **************/ | 1299 | * **************/ |
1282 | -int JZsdk_Uart_SendDeal_WarningLight_Status(int Uartport, int status, int mode) | 1300 | +T_JZsdkReturnCode HalSend_type1Send_WarningLight_Status(int Uartport, int status, int mode) |
1283 | { | 1301 | { |
1284 | printf("发送警灯状态帧\n"); | 1302 | printf("发送警灯状态帧\n"); |
1285 | 1303 | ||
@@ -1294,14 +1312,14 @@ int JZsdk_Uart_SendDeal_WarningLight_Status(int Uartport, int status, int mode) | @@ -1294,14 +1312,14 @@ int JZsdk_Uart_SendDeal_WarningLight_Status(int Uartport, int status, int mode) | ||
1294 | sendbuf[10] = mode; | 1312 | sendbuf[10] = mode; |
1295 | 1313 | ||
1296 | //3、发送帧 | 1314 | //3、发送帧 |
1297 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); } | 1315 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1);} |
1298 | 1316 | ||
1299 | /************* | 1317 | /************* |
1300 | * | 1318 | * |
1301 | * 发送警灯颜色 | 1319 | * 发送警灯颜色 |
1302 | * | 1320 | * |
1303 | * **************/ | 1321 | * **************/ |
1304 | -int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | 1322 | +T_JZsdkReturnCode HalSend_type1Send_WarningLight_Color(int Uartport, int color1, int color2) |
1305 | { | 1323 | { |
1306 | printf("发送警灯颜色帧\n"); | 1324 | printf("发送警灯颜色帧\n"); |
1307 | 1325 | ||
@@ -1316,7 +1334,7 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | @@ -1316,7 +1334,7 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | ||
1316 | sendbuf[10] = color2; | 1334 | sendbuf[10] = color2; |
1317 | 1335 | ||
1318 | //3、发送帧 | 1336 | //3、发送帧 |
1319 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1337 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1320 | } | 1338 | } |
1321 | 1339 | ||
1322 | /************* | 1340 | /************* |
@@ -1324,7 +1342,7 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | @@ -1324,7 +1342,7 @@ int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2) | ||
1324 | * 发送对外电源状态 | 1342 | * 发送对外电源状态 |
1325 | * | 1343 | * |
1326 | * **************/ | 1344 | * **************/ |
1327 | -int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status) | 1345 | +T_JZsdkReturnCode HalSend_type1Send_OutputPowerStatus(int Uartport, int FrameSequence, int status) |
1328 | { | 1346 | { |
1329 | printf("发送对外电源状态帧\n"); | 1347 | printf("发送对外电源状态帧\n"); |
1330 | 1348 | ||
@@ -1338,7 +1356,7 @@ int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int s | @@ -1338,7 +1356,7 @@ int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int s | ||
1338 | sendbuf[9] = status; | 1356 | sendbuf[9] = status; |
1339 | 1357 | ||
1340 | //3、发送帧 | 1358 | //3、发送帧 |
1341 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1359 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1342 | } | 1360 | } |
1343 | 1361 | ||
1344 | /**************************************************************************************************************************************************** | 1362 | /**************************************************************************************************************************************************** |
@@ -1347,7 +1365,7 @@ int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int s | @@ -1347,7 +1365,7 @@ int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int s | ||
1347 | * | 1365 | * |
1348 | ****************************************************************************************************************************************************/ | 1366 | ****************************************************************************************************************************************************/ |
1349 | //发送特殊参数 | 1367 | //发送特殊参数 |
1350 | -int JZsdk_Uart_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int type, int value) | 1368 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int type, int value) |
1351 | { | 1369 | { |
1352 | printf("发送特殊参数帧\n"); | 1370 | printf("发送特殊参数帧\n"); |
1353 | unsigned char sendbuf[256]; | 1371 | unsigned char sendbuf[256]; |
@@ -1362,5 +1380,5 @@ int JZsdk_Uart_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int t | @@ -1362,5 +1380,5 @@ int JZsdk_Uart_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int t | ||
1362 | sendbuf[10] = value; | 1380 | sendbuf[10] = value; |
1363 | 1381 | ||
1364 | //3、发送帧 | 1382 | //3、发送帧 |
1365 | - JZsdk_Uart_UartSend(Uartport ,sendbuf, send_buf_len); | 1383 | + HalSend_SendData(Uartport ,sendbuf, send_buf_len, 1); |
1366 | } | 1384 | } |
1 | +/** | ||
2 | + ******************************************************************** | ||
3 | + * @file JZsdk_Uart_SendDeal.h | ||
4 | + * | ||
5 | + * | ||
6 | + ********************************************************************* | ||
7 | + */ | ||
8 | + | ||
9 | +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | ||
10 | +#ifndef JZSDK_IART_SENDDEAL_H | ||
11 | +#define JZSDK_IART_SENDDEAL_H | ||
12 | + | ||
13 | +/* Includes ------------------------------------------------------------------*/ | ||
14 | +#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
15 | + | ||
16 | +#ifdef __cplusplus | ||
17 | +extern "C" { | ||
18 | +#endif | ||
19 | + | ||
20 | +/* Exported constants --------------------------------------------------------*/ | ||
21 | +/* 常亮定义*/ | ||
22 | + | ||
23 | + | ||
24 | +/* Exported types ------------------------------------------------------------*/ | ||
25 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Success(int Uartport ,int FrameSequence); | ||
26 | +T_JZsdkReturnCode HalSend_type1Send_Send_Connect(int Uartport , int FrameSequence,int Version_flag); | ||
27 | +T_JZsdkReturnCode HalSend_type1Send_ConnectFrame(int PortNum); | ||
28 | +T_JZsdkReturnCode HalSend_type1Send_Send_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus); | ||
29 | + | ||
30 | +T_JZsdkReturnCode HalSend_type1Send_Set_PowerStatus(int Uartport, int FrameSequence, int status); | ||
31 | +T_JZsdkReturnCode HalSend_type1Send_Ask_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus); | ||
32 | +T_JZsdkReturnCode HalSend_type1Send_Ask_TimeStamp(int Uartport , int FrameSequence); | ||
33 | +T_JZsdkReturnCode HalSend_type1Send_SendAllVersion(int Uartport, int FrameSequence, int DeviceID, int MajorVersion, int MinorVersion, int ModifyVersion, int DebugVersion); | ||
34 | +T_JZsdkReturnCode HalSend_type1Send_SendAllSerialNumber(int Uartport, int FrameSequence, int DeviceID, unsigned char *SerialNumber, int SerialNumberLen); | ||
35 | +T_JZsdkReturnCode HalSend_type1Send_DeviceMessage(int UartPort, int FrameSequence, unsigned char *message, unsigned int messageLen); | ||
36 | + | ||
37 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SecondaryDeviceName(int Uartport , int device_name, int FrameSequence); | ||
38 | +T_JZsdkReturnCode HalSend_type1Send_QuerySecondaryDeviceName(int Uartport ,int FrameSequence); | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Sucesss(int Uartport ,int FrameSequence); | ||
43 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CheckError(int Uartport ,int FrameSequence); | ||
44 | +T_JZsdkReturnCode HalSend_type1Send_Reply_DecodeError(int Uartport ,int FrameSequence); | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Failure(int Uartport ,int FrameSequence); | ||
49 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Musiclist(int UartPort ,int FrameSequence, int music_sum ,unsigned char **MusicName ,int *MusicNameLength); | ||
50 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_2(int Uartport, int FrameSequence, unsigned char *name, unsigned int namelen, unsigned int Filesize, unsigned int Time); | ||
51 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioDetailMessage(int Uartport,int FrameSequence, unsigned char type ,unsigned char *data, unsigned int datalen); | ||
52 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Start(int Uartport, int FrameSequence, int music_sum); | ||
53 | +T_JZsdkReturnCode HalSend_type1Send_Send_AudioList_Stop(int Uartport, int FrameSequence); | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus_end(int Uartport); | ||
58 | +T_JZsdkReturnCode HalSend_type1Send_Send_PlayStatus(int Uartport ,int num); | ||
59 | +T_JZsdkReturnCode HalSend_type1Send_Reply_MusicName(int Uartport ,char *music_name, int music_name_len); | ||
60 | +T_JZsdkReturnCode HalSend_type1Send_Reply_Volume(int Uartport ,int num); | ||
61 | +T_JZsdkReturnCode HalSend_type1Send_OpusDecodeStatus(int Uartport,int value); | ||
62 | + | ||
63 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalPitchAngle(int Uartport ,int angle); | ||
64 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalPitchAngle(int Uartport ,int angle); | ||
65 | +T_JZsdkReturnCode HalSend_type1Send_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch); | ||
66 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning); | ||
67 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalFineTuningPitch(int Uartport, int FrameSequence); | ||
68 | +T_JZsdkReturnCode HalSend_type1Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value); | ||
69 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); | ||
70 | +T_JZsdkReturnCode HalSend_type1Send_GimbalLinkageControl(int Uartport,int FrameSequence,int value); | ||
71 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); | ||
72 | +T_JZsdkReturnCode HalSend_type1Send_SetGimbalRange(int Uartport,int FrameSequence,int value); | ||
73 | + | ||
74 | + | ||
75 | +T_JZsdkReturnCode HalSend_type1Send_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion); | ||
76 | +T_JZsdkReturnCode HalSend_type1Send_Reply_LoopPlayStatus(int Uartport ,int status); | ||
77 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_tone(int Uartport ,int tone); | ||
78 | +T_JZsdkReturnCode HalSend_type1Send_Reply_TTS_speed(int Uartport ,int speed); | ||
79 | + | ||
80 | +T_JZsdkReturnCode HalSend_type1Send_Set_SearchLightFrequency(int Uartport ,int Frequency); | ||
81 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Control(int Uartport,int mode); | ||
82 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen); | ||
83 | +T_JZsdkReturnCode HalSend_type1Send_MessageSubcription_Control(int Uartport, int value); | ||
84 | + | ||
85 | +T_JZsdkReturnCode HalSend_type1Send_Set_WarningLight_Status(int Uartport,int status, int mode); | ||
86 | +T_JZsdkReturnCode HalSend_type1Send_Set_WarningLight_Color(int Uartport,int color1, int color2); | ||
87 | + | ||
88 | +T_JZsdkReturnCode HalSend_type1Send_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber, int SerialNumberLenth); | ||
89 | +T_JZsdkReturnCode HalSend_type1Send_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int type, int value); | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Frequency(int Uartport, int Frequency); | ||
97 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Mode(int Uartport, int mode); | ||
98 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen); | ||
99 | +T_JZsdkReturnCode HalSend_type1Send_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature); | ||
100 | + | ||
101 | + | ||
102 | +//查询探照灯频率 | ||
103 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Frequency(int Uartport); | ||
104 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Lumen(int Uartport); | ||
105 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Mode(int Uartport); | ||
106 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Attribute(int Uartport); | ||
107 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_SearchLight_Temperture(int Uartport); | ||
108 | + | ||
109 | + | ||
110 | +T_JZsdkReturnCode HalSend_type1Send_WarningLight_Status(int Uartport, int status, int mode); | ||
111 | +T_JZsdkReturnCode HalSend_type1Send_WarningLight_Color(int Uartport, int color1, int color2); | ||
112 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_WarningLightStatus(int Uartport); | ||
113 | +T_JZsdkReturnCode HalSend_type1Send_CheckStatus_WarningLightColor(int Uartport); | ||
114 | + | ||
115 | +T_JZsdkReturnCode HalSend_type1Send_OutputPowerStatus(int Uartport, int FrameSequence, int status); | ||
116 | + | ||
117 | + | ||
118 | +/* Exported functions --------------------------------------------------------*/ | ||
119 | + | ||
120 | +#ifdef __cplusplus | ||
121 | +} | ||
122 | +#endif | ||
123 | + | ||
124 | +#endif |
JZsdk_hal/JZsdk_Hal.c
0 → 100644
1 | +#include <stdio.h> | ||
2 | + | ||
3 | +#include "JZsdkLib.h" | ||
4 | +#include "Hal_Recv/HalRecv.h" | ||
5 | +#include "Hal_Send/HalSend.h" | ||
6 | +#include "JZsdk_Hal.h" | ||
7 | +#include "BaseConfig.h" | ||
8 | + | ||
9 | +#include "JZsdk_uart/JZsdk_Uart.h" | ||
10 | + | ||
11 | +/****************** | ||
12 | + * | ||
13 | + * 用来记录端口使用情况的结构体 | ||
14 | + * JZ_FLAGCODE_OFF 关闭 | ||
15 | + * JZ_FLAGCODE_ON 开启 | ||
16 | + * ********************/ | ||
17 | +typedef struct s_JZsdk_Hal_PortUseFlag | ||
18 | +{ | ||
19 | + int UartDev_DEV1 ; | ||
20 | + int UartDev_DEV2 ; | ||
21 | + int UartDev_DEV3 ; | ||
22 | + int UartDev_DEV4 ; | ||
23 | + int UartDev_4G ; | ||
24 | + int Data_Dransmisson; | ||
25 | +}s_JZsdk_Hal_PortUseFlag; | ||
26 | + | ||
27 | +static s_JZsdk_Hal_PortUseFlag g_PortUseFlag = {JZ_FLAGCODE_OFF}; | ||
28 | + | ||
29 | +/************** | ||
30 | + * | ||
31 | + * jzsdk hal的端口使用标志位 | ||
32 | + * | ||
33 | + * | ||
34 | + * *********************/ | ||
35 | +int JZsdk_HalPort_UseFlag(int PortName) | ||
36 | +{ | ||
37 | + if (PortName == UART_DEV_1) | ||
38 | + { | ||
39 | + return g_PortUseFlag.UartDev_DEV1; | ||
40 | + } | ||
41 | + else if (PortName == UART_DEV_2) | ||
42 | + { | ||
43 | + return g_PortUseFlag.UartDev_DEV2; | ||
44 | + } | ||
45 | + else if (PortName == UART_DEV_3) | ||
46 | + { | ||
47 | + return g_PortUseFlag.UartDev_DEV3; | ||
48 | + } | ||
49 | + else if (PortName == UART_DEV_4) | ||
50 | + { | ||
51 | + return g_PortUseFlag.UartDev_DEV4; | ||
52 | + } | ||
53 | + else if (PortName == UART_4G) | ||
54 | + { | ||
55 | + return g_PortUseFlag.UartDev_4G; | ||
56 | + } | ||
57 | + else if (PortName == HAL_DATA_TRANSMISSION) | ||
58 | + { | ||
59 | + return g_PortUseFlag.Data_Dransmisson; | ||
60 | + } | ||
61 | +} | ||
62 | + | ||
63 | +T_JZsdkReturnCode JZsdk_HalPort_SetUseFlag(int PortName,int UseFlag) | ||
64 | +{ | ||
65 | + if (PortName == UART_DEV_1) | ||
66 | + { | ||
67 | + g_PortUseFlag.UartDev_DEV1 = UseFlag; | ||
68 | + } | ||
69 | + else if (PortName == UART_DEV_2) | ||
70 | + { | ||
71 | + g_PortUseFlag.UartDev_DEV2 = UseFlag; | ||
72 | + } | ||
73 | + else if (PortName == UART_DEV_3) | ||
74 | + { | ||
75 | + g_PortUseFlag.UartDev_DEV3 = UseFlag; | ||
76 | + } | ||
77 | + else if (PortName == UART_DEV_4) | ||
78 | + { | ||
79 | + g_PortUseFlag.UartDev_DEV4 = UseFlag; | ||
80 | + } | ||
81 | + else if (PortName == UART_4G) | ||
82 | + { | ||
83 | + g_PortUseFlag.UartDev_4G = UseFlag; | ||
84 | + } | ||
85 | + else if (PortName == HAL_DATA_TRANSMISSION) | ||
86 | + { | ||
87 | + g_PortUseFlag.Data_Dransmisson = UseFlag; | ||
88 | + } | ||
89 | + else | ||
90 | + { | ||
91 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
92 | + } | ||
93 | + | ||
94 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
95 | +} | ||
96 | + | ||
97 | +/********************** | ||
98 | + * | ||
99 | + * hal端口 重初始化函数 | ||
100 | + * | ||
101 | + * | ||
102 | + * ******************/ | ||
103 | +T_JZsdkReturnCode JZsdk_HalPort_ReInit(int PortName, int Value[]) | ||
104 | +{ | ||
105 | + switch (PortName) | ||
106 | + { | ||
107 | + case UART_DEV_1: | ||
108 | + JZsdk_Uart_ReInit(PortName, Value[0]); | ||
109 | + break; | ||
110 | + | ||
111 | + case UART_DEV_2: | ||
112 | + JZsdk_Uart_ReInit(PortName, Value[0]); | ||
113 | + break; | ||
114 | + | ||
115 | + case UART_DEV_3: | ||
116 | + JZsdk_Uart_ReInit(PortName, Value[0]); | ||
117 | + break; | ||
118 | + | ||
119 | + case UART_DEV_4: | ||
120 | + JZsdk_Uart_ReInit(PortName, Value[0]); | ||
121 | + break; | ||
122 | + | ||
123 | + case UART_4G: | ||
124 | + JZsdk_Uart_ReInit(PortName, Value[0]); | ||
125 | + break; | ||
126 | + | ||
127 | + default: | ||
128 | + break; | ||
129 | + } | ||
130 | +} | ||
131 | + | ||
132 | +/********************** | ||
133 | + * | ||
134 | + * hal端口 使用默认参数初始化函数 | ||
135 | + * | ||
136 | + * ******************/ | ||
137 | +T_JZsdkReturnCode JZsdk_HalPort_Init_WithDefault(int PortName) | ||
138 | +{ | ||
139 | + int value[5] = {0, 0, 0, 0, 0}; | ||
140 | + | ||
141 | + if (PortName == UART_DEV_1) | ||
142 | + { | ||
143 | + value[0] = UART_DEV1_BITRATE; | ||
144 | + } | ||
145 | + else if (PortName == UART_DEV_2) | ||
146 | + { | ||
147 | + value[0] = UART_DEV2_BITRATE; | ||
148 | + } | ||
149 | + else if (PortName == UART_4G) | ||
150 | + { | ||
151 | + value[0] = COMM_4G_UART_BITRATE; | ||
152 | + } | ||
153 | + | ||
154 | + return JZsdk_HalPort_ReInit(PortName, value); | ||
155 | +} |
JZsdk_hal/JZsdk_Hal.h
0 → 100644
1 | +/** | ||
2 | + ******************************************************************** | ||
3 | + * @file JZsdk_Hal.h | ||
4 | + * JZsdk_Hal.c 的头文件 | ||
5 | + * @version V0.1.0 | ||
6 | + * @date | ||
7 | + * @brief This is the JZsdk_Hal.h file | ||
8 | + * | ||
9 | + * @attention | ||
10 | + * | ||
11 | + * | ||
12 | + ********************************************************************* | ||
13 | + | ||
14 | +/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | ||
15 | +#ifndef JZSDK_HAL_H | ||
16 | +#define JZSDK_HAL_H | ||
17 | + | ||
18 | +/* Includes ------------------------------------------------------------------*/ | ||
19 | + | ||
20 | +#ifdef __cplusplus | ||
21 | +extern "C" { | ||
22 | +#endif | ||
23 | + | ||
24 | + | ||
25 | +/* Exported constants --------------------------------------------------------*/ | ||
26 | +/* 常亮定义*/ | ||
27 | + | ||
28 | +/* Exported types ------------------------------------------------------------*/ | ||
29 | + | ||
30 | +/* Exported functions --------------------------------------------------------*/ | ||
31 | +int JZsdk_HalPort_UseFlag(int PortName); | ||
32 | +T_JZsdkReturnCode JZsdk_HalPort_SetUseFlag(int PortName,int UseFlag); | ||
33 | +T_JZsdkReturnCode JZsdk_HalPort_ReInit(int PortName, int Value[]); | ||
34 | +T_JZsdkReturnCode JZsdk_HalPort_Init_WithDefault(int PortName); | ||
35 | + | ||
36 | + | ||
37 | +#ifdef __cplusplus | ||
38 | +} | ||
39 | +#endif | ||
40 | + | ||
41 | +#endif |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" | 8 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" |
9 | #include "JZsdk_uart/JZsdk_Uart_UartDeal.h" | 9 | #include "JZsdk_uart/JZsdk_Uart_UartDeal.h" |
10 | #include "BaseConfig.h" | 10 | #include "BaseConfig.h" |
11 | -#include "Hal_Recv/HalRecv_type1/HalRecv_type1.h" | 11 | +#include "Hal_Recv/HalRecv.h" |
12 | 12 | ||
13 | typedef struct | 13 | typedef struct |
14 | { | 14 | { |
JZsdk_hal/JZsdk_uart/JZsdk_Uart.c
0 → 100644
1 | +#include <stdio.h> | ||
2 | +#include <string.h> | ||
3 | +#include <stdlib.h> | ||
4 | + | ||
5 | +#include <fcntl.h> | ||
6 | +#include <unistd.h> | ||
7 | +#include <termios.h> | ||
8 | +#include <sys/time.h> | ||
9 | + | ||
10 | + | ||
11 | +#include "BaseConfig.h" | ||
12 | + | ||
13 | +#include "JZsdk_uart/JZsdk_Uart_UartDeal.h" | ||
14 | +#include "JZsdk_Hal.h" | ||
15 | + | ||
16 | +/******************** | ||
17 | + * | ||
18 | + * | ||
19 | + * 串口使能 | ||
20 | + 使能一个串口 返回设备号 | ||
21 | + 变量1 串口设备名 | ||
22 | + 变量2 比特率 | ||
23 | + 返回 int 设备号 | ||
24 | + 例子: UartDeal_Base_CreateReceive("/dev/ttyS2", 115200) | ||
25 | + * | ||
26 | + * | ||
27 | + * **************************/ | ||
28 | +static T_JZsdkReturnCode JZsdk_Uart_UartEnabled(unsigned char *UartDev, unsigned int BitRate, int *UartFd) | ||
29 | +{ | ||
30 | + if (UartFd == NULL) | ||
31 | + { | ||
32 | + JZSDK_LOG_ERROR("UartFd 为空"); | ||
33 | + return JZ_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER; | ||
34 | + } | ||
35 | + | ||
36 | + //1、串口初始化 | ||
37 | + //(*UartFd) = open(UartDev, O_RDWR); | ||
38 | + (*UartFd) = open(UartDev, O_RDWR | O_NOCTTY | O_NDELAY); | ||
39 | + if ((*UartFd) < 0) | ||
40 | + { | ||
41 | + JZSDK_LOG_ERROR("打开串口 %s 失败", UartDev); | ||
42 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
43 | + } | ||
44 | + else | ||
45 | + { | ||
46 | + JZSDK_LOG_INFO("打开串口 %s 成功", UartDev); | ||
47 | + } | ||
48 | + | ||
49 | + //2、获取终端信息 | ||
50 | + struct termios options; | ||
51 | + if(tcgetattr((*UartFd),&options)!= 0) //获取终端信息 | ||
52 | + { | ||
53 | + JZSDK_LOG_ERROR("获取终端信息失败!\n"); | ||
54 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
55 | + } | ||
56 | + | ||
57 | + //3、设置比特率 | ||
58 | + switch (BitRate) | ||
59 | + { | ||
60 | + case 115200: | ||
61 | + cfsetispeed(&options, B115200); | ||
62 | + cfsetospeed(&options, B115200); | ||
63 | + break; | ||
64 | + case 230400: | ||
65 | + cfsetispeed(&options, B230400); | ||
66 | + cfsetospeed(&options, B230400); | ||
67 | + break; | ||
68 | + case 460800: | ||
69 | + cfsetispeed(&options, B460800); | ||
70 | + cfsetospeed(&options, B460800); | ||
71 | + break; | ||
72 | + case 921600: | ||
73 | + cfsetispeed(&options, B921600); | ||
74 | + cfsetospeed(&options, B921600); | ||
75 | + break; | ||
76 | + case 1000000: | ||
77 | + cfsetispeed(&options, B1000000); | ||
78 | + cfsetospeed(&options, B1000000); | ||
79 | + break; | ||
80 | + default: | ||
81 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
82 | + break; | ||
83 | + } | ||
84 | + | ||
85 | + options.c_cflag |= (unsigned) CLOCAL; | ||
86 | + options.c_cflag |= (unsigned) CREAD; | ||
87 | + options.c_cflag &= ~(unsigned) CRTSCTS; | ||
88 | + options.c_cflag &= ~(unsigned) CSIZE; | ||
89 | + options.c_cflag |= (unsigned) CS8; | ||
90 | + options.c_cflag &= ~(unsigned) PARENB; | ||
91 | + options.c_iflag &= ~(unsigned) INPCK; | ||
92 | + options.c_cflag &= ~(unsigned) CSTOPB; | ||
93 | + options.c_oflag &= ~(unsigned) OPOST; | ||
94 | + options.c_lflag &= ~((unsigned) ICANON | (unsigned) ECHO | (unsigned) ECHOE | (unsigned) ISIG); | ||
95 | + options.c_iflag &= ~((unsigned) BRKINT | (unsigned) ICRNL | (unsigned) INPCK | (unsigned) ISTRIP | (unsigned) IXON); | ||
96 | + options.c_cc[VTIME] = 0; | ||
97 | + options.c_cc[VMIN] = 0; | ||
98 | + | ||
99 | + tcflush((*UartFd),TCIOFLUSH); //刷清输入、输出队列 | ||
100 | + tcsetattr((*UartFd),TCSAFLUSH,&options); //串口设置使能 | ||
101 | + | ||
102 | + JZSDK_LOG_INFO("使能串口 波特率%d成功",BitRate); | ||
103 | + | ||
104 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
105 | +} | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | +/**************** | ||
112 | + * | ||
113 | + * | ||
114 | + * | ||
115 | + * 串口重初始化 | ||
116 | + * | ||
117 | + * | ||
118 | + * | ||
119 | + * | ||
120 | + * ************************/ | ||
121 | +T_JZsdkReturnCode JZsdk_Uart_ReInit(int UART_DEV_NAME, int BitRate) | ||
122 | +{ | ||
123 | + T_JZsdkReturnCode ret = JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
124 | + int UartFd = 0; | ||
125 | + | ||
126 | + JZSDK_LOG_INFO("初始化串口 0x%x", UART_DEV_NAME); | ||
127 | + | ||
128 | + //初始化的是一号设备 | ||
129 | + if (UART_DEV_NAME == UART_DEV_1) | ||
130 | + { | ||
131 | + //1、检查串口是否已经初始化 | ||
132 | + if(JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) | ||
133 | + { | ||
134 | + //先注释掉原来的串口 | ||
135 | + JZsdk_HalPort_SetUseFlag(UART_DEV_1, JZ_FLAGCODE_OFF); | ||
136 | + | ||
137 | + //然后关闭串口 注:该函数有延时 | ||
138 | + JZsdk_Uart_CloseUartThead(UART_DEV_1); | ||
139 | + } | ||
140 | + | ||
141 | + //2、串口初始化 | ||
142 | + ret = JZsdk_Uart_UartEnabled(UART_DEV1_NUM, BitRate, &UartFd); | ||
143 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
144 | + { | ||
145 | + return ret; | ||
146 | + } | ||
147 | + | ||
148 | + //3、串口接收初始化 | ||
149 | + JZsdk_Uart_UartDeal_Receive(UartFd, UART_DEV_1); | ||
150 | + | ||
151 | + //4、将串口的标志位打开 | ||
152 | + JZsdk_HalPort_SetUseFlag(UART_DEV_1, JZ_FLAGCODE_ON); | ||
153 | + } | ||
154 | + | ||
155 | + //初始化的是二号设备 | ||
156 | + if (UART_DEV_NAME == UART_DEV_2) | ||
157 | + { | ||
158 | + //1、检查串口是否已经初始化 | ||
159 | + if(JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) | ||
160 | + { | ||
161 | + //先注释掉原来的串口 | ||
162 | + JZsdk_HalPort_SetUseFlag(UART_DEV_2, JZ_FLAGCODE_OFF); | ||
163 | + | ||
164 | + //然后关闭串口 注:该函数有延时 | ||
165 | + JZsdk_Uart_CloseUartThead(UART_DEV_2); | ||
166 | + } | ||
167 | + | ||
168 | + //2、串口初始化 | ||
169 | + ret = JZsdk_Uart_UartEnabled(UART_DEV2_NUM, BitRate, &UartFd); | ||
170 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
171 | + { | ||
172 | + return ret; | ||
173 | + } | ||
174 | + | ||
175 | + //3、串口接收初始化 | ||
176 | + JZsdk_Uart_UartDeal_Receive(UartFd, UART_DEV_2); | ||
177 | + | ||
178 | + //4、将串口的标志位打开 | ||
179 | + JZsdk_HalPort_SetUseFlag(UART_DEV_2, JZ_FLAGCODE_ON); | ||
180 | + } | ||
181 | + | ||
182 | + //初始化的是4g设备 | ||
183 | + if (UART_DEV_NAME == UART_4G) | ||
184 | + { | ||
185 | + //1、检查串口是否已经初始化 | ||
186 | + if(JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) | ||
187 | + { | ||
188 | + //先注释掉原来的串口 | ||
189 | + JZsdk_HalPort_SetUseFlag(UART_4G, JZ_FLAGCODE_OFF); | ||
190 | + | ||
191 | + //然后关闭串口 注:该函数有延时 | ||
192 | + JZsdk_Uart_CloseUartThead(UART_4G); | ||
193 | + } | ||
194 | + | ||
195 | + //2、串口初始化 | ||
196 | + ret = JZsdk_Uart_UartEnabled(COMM_4G_UART_NUM, BitRate, &UartFd); | ||
197 | + if (ret != JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS) | ||
198 | + { | ||
199 | + return ret; | ||
200 | + } | ||
201 | + | ||
202 | + //3、串口接收初始化 | ||
203 | + JZsdk_Uart_UartDeal_Receive(UartFd, UART_4G); | ||
204 | + | ||
205 | + //4、将串口的标志位打开 | ||
206 | + JZsdk_HalPort_SetUseFlag(UART_4G, JZ_FLAGCODE_ON); | ||
207 | + } | ||
208 | + | ||
209 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
210 | +} |
1 | /** | 1 | /** |
2 | ******************************************************************** | 2 | ******************************************************************** |
3 | - * @file UartDeal_Base.h | ||
4 | - * UartDeal_Base的头文件 | 3 | + * @file JZsdk_Uart.h |
4 | + * JZsdk_Uart.c 的头文件 | ||
5 | * | 5 | * |
6 | ********************************************************************* | 6 | ********************************************************************* |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | 9 | /* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ |
10 | -#ifndef UARTDEAL_BASE_H | ||
11 | -#define UARTDEAL_BASE_H | 10 | +#ifndef JZSDK_UART_H |
11 | +#define JZSDK_UART_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" { |
17 | #endif | 18 | #endif |
18 | 19 | ||
20 | + | ||
19 | /* Exported constants --------------------------------------------------------*/ | 21 | /* Exported constants --------------------------------------------------------*/ |
20 | /* 常亮定义*/ | 22 | /* 常亮定义*/ |
21 | 23 | ||
22 | /* Exported types ------------------------------------------------------------*/ | 24 | /* Exported types ------------------------------------------------------------*/ |
23 | 25 | ||
24 | /* Exported functions --------------------------------------------------------*/ | 26 | /* Exported functions --------------------------------------------------------*/ |
25 | -int UartConnection_UartEnabled(char *UartDev, int BitRate); | ||
26 | - | 27 | +T_JZsdkReturnCode JZsdk_Uart_ReInit(int UART_DEV_NAME, int BitRate); |
27 | 28 | ||
28 | #ifdef __cplusplus | 29 | #ifdef __cplusplus |
29 | } | 30 | } |
JZsdk_hal/JZsdk_uart/JZsdk_Uart_Input.c
已删除
100644 → 0
1 | -#include <stdio.h> | ||
2 | -#include <string.h> | ||
3 | -#include <stdlib.h> | ||
4 | - | ||
5 | -#include "JZsdk_uart/UartConnection/UartConnection.h" | ||
6 | -#include "Megaphone/Megaphone.h" | ||
7 | -#include "BaseConfig.h" | ||
8 | -#include "version_choose.h" | ||
9 | - | ||
10 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
11 | -#include "JZsdk_uart/JZsdk_Uart_UartDeal.h" | ||
12 | -#include "JZsdk_uart/Uart_Config.h" | ||
13 | -#include "JZsdk_uart/JZsdk_Uart_Send/JZsdk_Uart_Send.h" | ||
14 | -#include "Gimbal/Gimbal.h" | ||
15 | - | ||
16 | -// 记录串口是否有被使用,方便ui_contrl进行信息反馈 | ||
17 | -struct UartDev_UseFlag | ||
18 | -{ | ||
19 | - int UartDev_DEV1 ; | ||
20 | - int UartDev_DEV2 ; | ||
21 | - int UartDev_DEV3 ; | ||
22 | - int UartDev_DEV4 ; | ||
23 | - int UartDev_4G ; | ||
24 | -}; | ||
25 | - | ||
26 | -static struct UartDev_UseFlag UartDevUseFlag = {JZ_FLAGCODE_OFF, JZ_FLAGCODE_OFF, JZ_FLAGCODE_OFF, JZ_FLAGCODE_OFF,JZ_FLAGCODE_OFF}; | ||
27 | - | ||
28 | - | ||
29 | -/**************** | ||
30 | - * | ||
31 | - * 回复串口是否有被调用 | ||
32 | - * 用于状态同步时,是否需要通知该设备 | ||
33 | - * | ||
34 | - * *************/ | ||
35 | -int JZsdk_Get_UartDev_UseFlag(int UART_DEV_NAME) | ||
36 | -{ | ||
37 | - if (UART_DEV_NAME == UART_DEV_1) | ||
38 | - { | ||
39 | - return UartDevUseFlag.UartDev_DEV1; | ||
40 | - } | ||
41 | - else if (UART_DEV_NAME == UART_DEV_2) | ||
42 | - { | ||
43 | - return UartDevUseFlag.UartDev_DEV2; | ||
44 | - } | ||
45 | - else if (UART_DEV_NAME == UART_4G) | ||
46 | - { | ||
47 | - return UartDevUseFlag.UartDev_4G; | ||
48 | - } | ||
49 | -} | ||
50 | - | ||
51 | -/************** | ||
52 | - * | ||
53 | - * 串口部分初始化 | ||
54 | - * 按默认参数对串口进行初始化 | ||
55 | - * | ||
56 | - * *********/ | ||
57 | -int JZsdk_Uart_Init(int UART_DEV_NAME) | ||
58 | -{ | ||
59 | - | ||
60 | - //初始化的是一号设备 | ||
61 | - if (UART_DEV_NAME == UART_DEV_1) | ||
62 | - { | ||
63 | - JZsdk_Uart_SecondInit(UART_DEV_1,UART_DEV1_BITRATE); | ||
64 | - } | ||
65 | - | ||
66 | - //初始化的是二号设备 | ||
67 | - else if (UART_DEV_NAME == UART_DEV_2) | ||
68 | - { | ||
69 | - JZsdk_Uart_SecondInit(UART_DEV_2, UART_DEV2_BITRATE); | ||
70 | - } | ||
71 | - | ||
72 | - else if (UART_DEV_NAME == UART_4G) | ||
73 | - { | ||
74 | - JZsdk_Uart_SecondInit(UART_4G, COMM_4G_UART_BITRATE); | ||
75 | - } | ||
76 | - | ||
77 | - printf("%x串口初始化完成\n", UART_DEV_NAME); | ||
78 | -} | ||
79 | - | ||
80 | -/************** | ||
81 | - * | ||
82 | - * 串口部分修改波特率 | ||
83 | - * | ||
84 | - * *********/ | ||
85 | -int JZsdk_Uart_BitRateChange(int UART_DEV_NAME, int BitRate) | ||
86 | -{ | ||
87 | - //1、释放掉原串口 | ||
88 | - if (UART_DEV_NAME == UART_DEV_1) | ||
89 | - { | ||
90 | - //将使用标识关闭 | ||
91 | - UartDevUseFlag.UartDev_DEV1 = JZ_FLAGCODE_OFF; | ||
92 | - | ||
93 | - //等候关闭接收线程 | ||
94 | - JZsdk_Uart_CloseUartThead(UART_DEV_NAME, BitRate); | ||
95 | - } | ||
96 | - | ||
97 | - //1、释放掉原串口 | ||
98 | - else if (UART_DEV_NAME == UART_DEV_2) | ||
99 | - { | ||
100 | - //将使用标识关闭 | ||
101 | - UartDevUseFlag.UartDev_DEV2 = JZ_FLAGCODE_OFF; | ||
102 | - | ||
103 | - //等候关闭接收线程 | ||
104 | - JZsdk_Uart_CloseUartThead(UART_DEV_NAME, BitRate); | ||
105 | - } | ||
106 | - | ||
107 | - //1、释放掉原串口 | ||
108 | - else if (UART_DEV_NAME == UART_4G) | ||
109 | - { | ||
110 | - //将使用标识关闭 | ||
111 | - UartDevUseFlag.UartDev_4G = JZ_FLAGCODE_OFF; | ||
112 | - | ||
113 | - //等候关闭接收线程 | ||
114 | - JZsdk_Uart_CloseUartThead(UART_DEV_NAME, BitRate); | ||
115 | - } | ||
116 | -} | ||
117 | - | ||
118 | -/************** | ||
119 | - * | ||
120 | - * 串口部分 | ||
121 | - * 串口再注册函数 | ||
122 | - * | ||
123 | - * *********/ | ||
124 | -int JZsdk_Uart_SecondInit(int UART_DEV_NAME, int BitRate) | ||
125 | -{ | ||
126 | - int Uart_fd = 0; | ||
127 | - | ||
128 | - printf("初始化串口%x\n",UART_DEV_NAME); | ||
129 | - | ||
130 | - //初始化的是一号设备 | ||
131 | - if (UART_DEV_NAME == UART_DEV_1) | ||
132 | - { | ||
133 | - //1、串口初始化 | ||
134 | - Uart_fd = UartConnection_UartEnabled(UART_DEV1_NUM, BitRate); | ||
135 | - | ||
136 | - //2、串口接收初始化 | ||
137 | - JZsdk_Uart_UartDeal_Receive(Uart_fd, UART_DEV_1); | ||
138 | - | ||
139 | - //3、将使用标识打开 | ||
140 | - UartDevUseFlag.UartDev_DEV1 = JZ_FLAGCODE_ON; | ||
141 | - } | ||
142 | - | ||
143 | - else if (UART_DEV_NAME == UART_DEV_2) | ||
144 | - { | ||
145 | - //1、串口初始化 | ||
146 | - Uart_fd = UartConnection_UartEnabled(UART_DEV2_NUM, BitRate); | ||
147 | - | ||
148 | - //2、串口接收初始化 | ||
149 | - JZsdk_Uart_UartDeal_Receive(Uart_fd, UART_DEV_2); | ||
150 | - | ||
151 | - //3、将使用标识打开 | ||
152 | - UartDevUseFlag.UartDev_DEV2 = JZ_FLAGCODE_ON; | ||
153 | - } | ||
154 | - | ||
155 | - else if (UART_DEV_NAME == UART_4G) | ||
156 | - { | ||
157 | - //1、串口初始化 | ||
158 | - Uart_fd = UartConnection_UartEnabled(COMM_4G_UART_NUM, BitRate); | ||
159 | - | ||
160 | - //2、串口接收初始化 | ||
161 | - JZsdk_Uart_UartDeal_Receive(Uart_fd, UART_4G); | ||
162 | - | ||
163 | - //3、将使用标识打开 | ||
164 | - UartDevUseFlag.UartDev_4G = JZ_FLAGCODE_ON; | ||
165 | - } | ||
166 | -} | ||
167 | - | ||
168 | -/******************************* | ||
169 | - * | ||
170 | - * 自由帧发送 | ||
171 | - * | ||
172 | - * ******************/ | ||
173 | -int JZsdk_Uart_Send_CustomOrder(int UartPort, char *frame, int frame_len) | ||
174 | -{ | ||
175 | - JZsdk_Uart_UartSend(UartPort, frame, frame_len); | ||
176 | -} | ||
177 | - | ||
178 | -/***************** | ||
179 | - * | ||
180 | - * 发送主动连接帧 | ||
181 | - * | ||
182 | - * ******************/ | ||
183 | -int JZsdk_Uart_Send_ConnectFrame(int PortNum) | ||
184 | -{ | ||
185 | - JZsdk_Uart_SendDeal_ConnectFrame(PortNum); | ||
186 | -} | ||
187 | - | ||
188 | -/* | ||
189 | -* | ||
190 | -* 发送播放结束状态帧 | ||
191 | -* | ||
192 | -*/ | ||
193 | -int JZsdk_Uart_Reply_PlayStatus_end(int PortNum) | ||
194 | -{ | ||
195 | - //发送播放状态结束帧 | ||
196 | - JZsdk_Uart_SendDeal_Send_PlayStatus_end(PortNum); | ||
197 | -} | ||
198 | - | ||
199 | -/************** | ||
200 | - * | ||
201 | - * 发送发送播放状态帧 | ||
202 | - * | ||
203 | - * ***********/ | ||
204 | -int JZsdk_Uart_Send_PlayStatus(int Uartport ,int num) | ||
205 | -{ | ||
206 | - JZsdk_Uart_SendDeal_Send_PlayStatus(Uartport, num); | ||
207 | -} | ||
208 | - | ||
209 | -/************** | ||
210 | - * | ||
211 | - * 发送音量 | ||
212 | - * | ||
213 | - * ***********/ | ||
214 | -int JZsdk_Uart_Reply_Volume(int Uartport,int volume) | ||
215 | -{ | ||
216 | - JZsdk_Uart_SendDeal_Reply_Volume(Uartport, volume); | ||
217 | -} | ||
218 | - | ||
219 | -/************** | ||
220 | - * | ||
221 | - * 发送音色 | ||
222 | - * | ||
223 | - * ***********/ | ||
224 | -int JZsdk_Uart_Reply_TTS_tone(int Uartport,int tone) | ||
225 | -{ | ||
226 | - JZsdk_Uart_SendDeal_Reply_TTS_tone(Uartport, tone); | ||
227 | -} | ||
228 | - | ||
229 | -/************** | ||
230 | - * | ||
231 | - * 发送语速 | ||
232 | - * | ||
233 | - * ***********/ | ||
234 | -int JZsdk_Uart_Reply_TTS_speed(int Uartport,int speed) | ||
235 | -{ | ||
236 | - JZsdk_Uart_SendDeal_Reply_TTS_speed(Uartport, speed); | ||
237 | -} | ||
238 | - | ||
239 | -/************** | ||
240 | - * | ||
241 | - * 发送循环状态 | ||
242 | - * | ||
243 | - * ***********/ | ||
244 | -int JZsdk_Uart_Reply_AudioPlayLoopStatus(int Uartport,int speed) | ||
245 | -{ | ||
246 | - JZsdk_Uart_SendDeal_Reply_LoopPlayStatus(Uartport, speed); | ||
247 | -} | ||
248 | - | ||
249 | - | ||
250 | -/************** | ||
251 | - * | ||
252 | - * 发送云台俯仰角度查询值 | ||
253 | - * | ||
254 | - * ***********/ | ||
255 | -int JZsdk_Uart_Reply_GimbalPitchAngle(int Uartport,int angle) | ||
256 | -{ | ||
257 | - JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(Uartport, angle); | ||
258 | -} | ||
259 | - | ||
260 | -/************* | ||
261 | - * | ||
262 | - * 设置云台俯仰角度 | ||
263 | - * | ||
264 | - * **************/ | ||
265 | -int JZsdk_Uart_Send_SetGimbalPitch(int Uartport,int angle) | ||
266 | -{ | ||
267 | - JZsdk_Uart_SendDeal_Set_GimbalPitchAngle(Uartport, angle); | ||
268 | -} | ||
269 | - | ||
270 | -/************* | ||
271 | - * | ||
272 | - * 查询云台角度 | ||
273 | - * | ||
274 | - * **************/ | ||
275 | -int JZsdk_Uart_Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence) | ||
276 | -{ | ||
277 | - JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(Uartport, FrameSequence); | ||
278 | -} | ||
279 | - | ||
280 | -/************* | ||
281 | - * | ||
282 | - * 设置云台俯仰角度微调 | ||
283 | - * | ||
284 | - * **************/ | ||
285 | -int JZsdk_Uart_Send_SetGimbalFineTuningPitch(int Uartport,int angle) | ||
286 | -{ | ||
287 | - JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(Uartport, angle); | ||
288 | -} | ||
289 | - | ||
290 | -/************* | ||
291 | - * | ||
292 | - * 查询云台微调角度 | ||
293 | - * | ||
294 | - * **************/ | ||
295 | -int JZsdk_Uart_Send_CheckStatus_GimbalFineTuningPitch(int Uartport,int FrameSequence) | ||
296 | -{ | ||
297 | - JZsdk_Uart_SendDeal_CheckStatus_GimbalFineTuningPitch(Uartport,FrameSequence); | ||
298 | -} | ||
299 | - | ||
300 | -/************* | ||
301 | - * | ||
302 | - * 发送云台俯仰微调值 | ||
303 | - * | ||
304 | - * **************/ | ||
305 | -int JZsdk_Uart_Send_GimbalFineTuningPitch(int Uartport,int FrameSequence, int Pitch) | ||
306 | -{ | ||
307 | - JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(Uartport,FrameSequence, Pitch); | ||
308 | -} | ||
309 | - | ||
310 | -/************* | ||
311 | - * | ||
312 | - * 设置云台联动 | ||
313 | - * | ||
314 | - * **************/ | ||
315 | -int JZsdk_Uart_Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value) | ||
316 | -{ | ||
317 | - JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(Uartport,FrameSequence, value); | ||
318 | -} | ||
319 | - | ||
320 | -/************* | ||
321 | - * | ||
322 | - * 查询云台联动值 | ||
323 | - * | ||
324 | - * **************/ | ||
325 | -int JZsdk_Uart_Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence) | ||
326 | -{ | ||
327 | - JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(Uartport,FrameSequence); | ||
328 | -} | ||
329 | - | ||
330 | -/************* | ||
331 | - * | ||
332 | - * 发送云台联动值 | ||
333 | - * | ||
334 | - * **************/ | ||
335 | -int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int value) | ||
336 | -{ | ||
337 | - JZsdk_Uart_SendDeal_GimbalLinkageControl(Uartport,FrameSequence,value); | ||
338 | -} | ||
339 | - | ||
340 | -/************* | ||
341 | - * | ||
342 | - * 设置云台最大最小值 | ||
343 | - * | ||
344 | - * **************/ | ||
345 | -int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value) | ||
346 | -{ | ||
347 | - JZsdk_Uart_SendDeal_SetGimbalRange(Uartport,FrameSequence,value); | ||
348 | -} | ||
349 | - | ||
350 | -/******************************************************************************************************************************* | ||
351 | - * | ||
352 | - * 探照灯部分 | ||
353 | - * | ||
354 | - * *******************************************************************************************************************************/ | ||
355 | - | ||
356 | -/************* | ||
357 | - * | ||
358 | - * 设置探照灯爆闪频率 | ||
359 | - * | ||
360 | - * **************/ | ||
361 | -int JZsdk_Uart_Send_SearchLight_SetFrequency(int Uartport,int Frequency) | ||
362 | -{ | ||
363 | - JZsdk_Uart_SendDeal_Set_SearchLightFrequency(Uartport ,Frequency); | ||
364 | -} | ||
365 | - | ||
366 | -/************* | ||
367 | - * | ||
368 | - * 探照灯控制 | ||
369 | - * | ||
370 | - * **************/ | ||
371 | -int JZsdk_Uart_Send_SearchLight_Control(int Uartport,int mode) | ||
372 | -{ | ||
373 | - JZsdk_Uart_SendDeal_SearchLight_Control(Uartport, mode); | ||
374 | -} | ||
375 | - | ||
376 | -/************* | ||
377 | - * | ||
378 | - * 探照灯亮度 | ||
379 | - * | ||
380 | - * **************/ | ||
381 | -int JZsdk_Uart_Send_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen) | ||
382 | -{ | ||
383 | - JZsdk_Uart_SendDeal_SearchLight_SetLumen(Uartport, LeftLumen, RightLumen); | ||
384 | -} | ||
385 | - | ||
386 | -/************* | ||
387 | - * | ||
388 | - * 查询爆闪频率 | ||
389 | - * | ||
390 | - * **************/ | ||
391 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Frequency(int Uartport) | ||
392 | -{ | ||
393 | - JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Frequency(Uartport); | ||
394 | -} | ||
395 | - | ||
396 | -/************* | ||
397 | - * | ||
398 | - * 查询探照灯亮度 | ||
399 | - * | ||
400 | - * **************/ | ||
401 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Lumen(int Uartport) | ||
402 | -{ | ||
403 | - JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Lumen(Uartport); | ||
404 | -} | ||
405 | - | ||
406 | -/************* | ||
407 | - * | ||
408 | - * 查询探照灯模式 | ||
409 | - * | ||
410 | - * **************/ | ||
411 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Mode(int Uartport) | ||
412 | -{ | ||
413 | - JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Mode(Uartport); | ||
414 | -} | ||
415 | - | ||
416 | -/************* | ||
417 | - * | ||
418 | - * 查询探照灯属性 | ||
419 | - * | ||
420 | - * **************/ | ||
421 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_LightAttribute(int Uartport) | ||
422 | -{ | ||
423 | - JZsdk_Uart_SendDeal_CheckStatus_LightAttribute(Uartport); | ||
424 | -} | ||
425 | - | ||
426 | -/************* | ||
427 | - * | ||
428 | - * 查询探照灯温度 | ||
429 | - * | ||
430 | - * **************/ | ||
431 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_SearchLightTemperture(int Uartport) | ||
432 | -{ | ||
433 | - JZsdk_Uart_SendDeal_CheckStatus_SearchLightTemperture(Uartport); | ||
434 | -} | ||
435 | - | ||
436 | - | ||
437 | -/************* | ||
438 | - * | ||
439 | - * 探照灯消息订阅 | ||
440 | - * | ||
441 | - * **************/ | ||
442 | -int JZsdk_Uart_Send_MessageSubcription_Control(int Uartport,int value) | ||
443 | -{ | ||
444 | - JZsdk_Uart_SendDeal_MessageSubcription_Control(Uartport, value); | ||
445 | -} | ||
446 | -/******************************************************************************************************************************* | ||
447 | - * | ||
448 | - * 警灯部分 | ||
449 | - * | ||
450 | - * *******************************************************************************************************************************/ | ||
451 | - | ||
452 | -/************* | ||
453 | - * | ||
454 | - * 设置警灯状态 | ||
455 | - * | ||
456 | - * **************/ | ||
457 | -int JZsdk_Uart_Send_Set_WarningLight_Status(int Uartport,int status, int mode) | ||
458 | -{ | ||
459 | - JZsdk_Uart_SendDeal_Set_WarningLight_Status(Uartport, status, mode); | ||
460 | -} | ||
461 | -/************* | ||
462 | - * | ||
463 | - * 设置警灯颜色 | ||
464 | - * | ||
465 | - * **************/ | ||
466 | -int JZsdk_Uart_Send_Set_WarningLight_Color(int Uartport,int color1, int color2) | ||
467 | -{ | ||
468 | - JZsdk_Uart_SendDeal_Set_WarningLight_Color(Uartport, color1, color2); | ||
469 | -} | ||
470 | - | ||
471 | -/******************************************************************************************************************************* | ||
472 | - * | ||
473 | - * 5B类部分 | ||
474 | - * | ||
475 | - * *******************************************************************************************************************************/ | ||
476 | -/************* | ||
477 | - * | ||
478 | - * 发送opus解码状态 | ||
479 | - * | ||
480 | - * **************/ | ||
481 | -int JZsdk_Uart_Send_OpusDecodeStatus(int Uartport,int value) | ||
482 | -{ | ||
483 | - JZsdk_Uart_SendDeal_OpusDecodeStatus(Uartport, value); | ||
484 | -} | ||
485 | - | ||
486 | - | ||
487 | -/************* | ||
488 | - * | ||
489 | - * 发送探照灯爆闪频率 | ||
490 | - * | ||
491 | - * **************/ | ||
492 | -int JZsdk_Uart_Send_SearchLight_Frequency(int Uartport,int value) | ||
493 | -{ | ||
494 | - JZsdk_Uart_SendDeal_SearchLight_Frequency(Uartport, value); | ||
495 | -} | ||
496 | - | ||
497 | -/************* | ||
498 | - * | ||
499 | - * 发送探照灯模式 | ||
500 | - * | ||
501 | - * **************/ | ||
502 | -int JZsdk_Uart_Send_SearchLight_Mode(int Uartport,int value) | ||
503 | -{ | ||
504 | - JZsdk_Uart_SendDeal_SearchLight_Mode(Uartport, value); | ||
505 | -} | ||
506 | - | ||
507 | -/************* | ||
508 | - * | ||
509 | - * 发送探照灯亮度 | ||
510 | - * | ||
511 | - * **************/ | ||
512 | -int JZsdk_Uart_Send_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen) | ||
513 | -{ | ||
514 | - JZsdk_Uart_SendDeal_SearchLight_Lumen(Uartport, LeftLumen, RightLumen); | ||
515 | -} | ||
516 | - | ||
517 | -/************* | ||
518 | - * | ||
519 | - * 发送探照灯温度 | ||
520 | - * | ||
521 | - * **************/ | ||
522 | -int JZsdk_Uart_Send_SearchLight_Temperature(int Uartport,int LeftTemperature, int RightTemperature) | ||
523 | -{ | ||
524 | - JZsdk_Uart_SendDeal_SearchLight_Temperature(Uartport, LeftTemperature, RightTemperature); | ||
525 | -} | ||
526 | - | ||
527 | - | ||
528 | -/************* | ||
529 | - * | ||
530 | - * 发送对外供电电源的状态 | ||
531 | - * | ||
532 | - * **************/ | ||
533 | -int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status) | ||
534 | -{ | ||
535 | - JZsdk_Uart_SendDeal_OutputPowerStatus(Uartport, FrameSequence, status); | ||
536 | -} | ||
537 | - | ||
538 | -/******************************************************************************************************************************* | ||
539 | - * | ||
540 | - * 警灯部分 | ||
541 | - * | ||
542 | - * *******************************************************************************************************************************/ | ||
543 | -/************* | ||
544 | - * | ||
545 | - * 发送警灯状态 | ||
546 | - * | ||
547 | - * **************/ | ||
548 | -int JZsdk_Uart_Send_WarningLight_Status(int Uartport, int status, int mode) | ||
549 | -{ | ||
550 | - JZsdk_Uart_SendDeal_WarningLight_Status(Uartport, status, mode); | ||
551 | -} | ||
552 | - | ||
553 | -/************* | ||
554 | - * | ||
555 | - * 发送警灯颜色 | ||
556 | - * | ||
557 | - * **************/ | ||
558 | -int JZsdk_Uart_Send_WarningLight_Color(int Uartport, int color1, int color2) | ||
559 | -{ | ||
560 | - JZsdk_Uart_SendDeal_WarningLight_Color(Uartport, color1, color2); | ||
561 | -} | ||
562 | - | ||
563 | - | ||
564 | -/************* | ||
565 | - * | ||
566 | - * 查询警灯状态 | ||
567 | - * | ||
568 | - * **************/ | ||
569 | -int JZsdk_Uart_Send_CheckStatus_WarningLightStatus(int Uartport) | ||
570 | -{ | ||
571 | - JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(Uartport); | ||
572 | -} | ||
573 | - | ||
574 | - | ||
575 | -/************* | ||
576 | - * | ||
577 | - * 查询警灯颜色 | ||
578 | - * | ||
579 | - * **************/ | ||
580 | -int JZsdk_Uart_Send_CheckStatus_WarningLightColor(int Uartport) | ||
581 | -{ | ||
582 | - JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(Uartport); | ||
583 | -} |
JZsdk_hal/JZsdk_uart/JZsdk_Uart_Input.h
已删除
100644 → 0
1 | -/** | ||
2 | - ******************************************************************** | ||
3 | - * @file JZsdk_Uart_Input.h | ||
4 | - * JZsdk_Uart_Input | ||
5 | - * | ||
6 | - ********************************************************************* | ||
7 | - */ | ||
8 | - | ||
9 | -/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | ||
10 | -#ifndef JZSDK_UART_INPUT_H | ||
11 | -#define JZSDK_UART_INPUT_H | ||
12 | - | ||
13 | -/* Includes ------------------------------------------------------------------*/ | ||
14 | - | ||
15 | -#ifdef __cplusplus | ||
16 | -extern "C" { | ||
17 | -#endif | ||
18 | - | ||
19 | - | ||
20 | -/* Exported constants --------------------------------------------------------*/ | ||
21 | -/* 常亮定义*/ | ||
22 | - | ||
23 | -/* Exported types ------------------------------------------------------------*/ | ||
24 | - | ||
25 | -/* Exported functions --------------------------------------------------------*/ | ||
26 | -int JZsdk_Uart_Init(int UART_DEV_NAME); | ||
27 | -int JZsdk_Get_UartDev_UseFlag(int UART_DEV_NAME); | ||
28 | - | ||
29 | -int JZsdk_Uart_Reply_PlayStatus_end(int PortNum); | ||
30 | -int JZsdk_Uart_Send_PlayStatus(int Uartport ,int num); | ||
31 | -int JZsdk_Uart_Reply_Volume(int Uartport,int volume); | ||
32 | -int JZsdk_Uart_Reply_TTS_tone(int Uartport,int tone); | ||
33 | -int JZsdk_Uart_Reply_TTS_speed(int Uartport,int speed); | ||
34 | -int JZsdk_Uart_Reply_AudioPlayLoopStatus(int Uartport,int speed); | ||
35 | -int JZsdk_Uart_Send_OpusDecodeStatus(int Uartport,int value); | ||
36 | - | ||
37 | -int JZsdk_Uart_Send_CustomOrder(int UartPort, char *frame, int frame_len); | ||
38 | -int JZsdk_Uart_Send_ConnectFrame(int PortNum); | ||
39 | - | ||
40 | -int JZsdk_Uart_Reply_GimbalPitchAngle(int Uartport,int angle); | ||
41 | -int JZsdk_Uart_Send_SetGimbalPitch(int Uartport,int angle); | ||
42 | -int JZsdk_Uart_Send_SetGimbalFineTuningPitch(int Uartport,int angle); | ||
43 | -int JZsdk_Uart_Send_Gimbal_Pitch(int Uartport, int pitch); | ||
44 | -int JZsdk_Uart_Send_CheckStatus_GimbalFineTuningPitch(int Uartport,int FrameSequence); | ||
45 | -int JZsdk_Uart_Send_GimbalFineTuningPitch(int Uartport,int FrameSequence, int Pitch); | ||
46 | -int JZsdk_Uart_Send_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value); | ||
47 | -int JZsdk_Uart_Send_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); | ||
48 | -int JZsdk_Uart_Send_GimbalLinkageControl(int Uartport,int FrameSequence, int value); | ||
49 | -int JZsdk_Uart_Send_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); | ||
50 | -int JZsdk_Uart_Send_SetGimbalRange(int Uartport,int FrameSequence, int value); | ||
51 | - | ||
52 | -int JZsdk_Uart_Send_SearchLight_SetFrequency(int Uartport,int Frequency); | ||
53 | -int JZsdk_Uart_Send_SearchLight_Control(int Uartport,int mode); | ||
54 | -int JZsdk_Uart_Send_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen); | ||
55 | - | ||
56 | -int JZsdk_Uart_Send_MessageSubcription_Control(int Uartport,int value); | ||
57 | - | ||
58 | -int JZsdk_Uart_Send_Set_WarningLight_Status(int Uartport,int status, int mode); | ||
59 | -int JZsdk_Uart_Send_Set_WarningLight_Color(int Uartport,int color1, int color2); | ||
60 | - | ||
61 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Frequency(int Uartport); | ||
62 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Lumen(int Uartport); | ||
63 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_Mode(int Uartport); | ||
64 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_LightAttribute(int Uartport); | ||
65 | -int JZsdk_Uart_Send_SearchLight_CheckStatus_SearchLightTemperture(int Uartport); | ||
66 | - | ||
67 | -int JZsdk_Uart_Send_SearchLight_Frequency(int Uartport,int value); | ||
68 | -int JZsdk_Uart_Send_SearchLight_Mode(int Uartport,int value); | ||
69 | -int JZsdk_Uart_Send_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen); | ||
70 | -int JZsdk_Uart_Send_SearchLight_Temperature(int Uartport,int LeftTemperature, int RightTemperature); | ||
71 | - | ||
72 | - | ||
73 | -int JZsdk_Uart_Send_WarningLight_Status(int Uartport, int status, int mode); | ||
74 | -int JZsdk_Uart_Send_WarningLight_Color(int Uartport, int color1, int color2); | ||
75 | -int JZsdk_Uart_Send_CheckStatus_WarningLightStatus(int Uartport); | ||
76 | -int JZsdk_Uart_Send_CheckStatus_WarningLightColor(int Uartport); | ||
77 | - | ||
78 | - | ||
79 | -int JZsdk_Uart_Send_OutputPowerStatus(int Uartport, int FrameSequence, int status); | ||
80 | - | ||
81 | -int JZsdk_Uart_BitRateChange(int UART_DEV_NAME, int BitRate); | ||
82 | -int JZsdk_Uart_SecondInit(int UART_DEV_NAME, int BitRate); | ||
83 | - | ||
84 | -#ifdef __cplusplus | ||
85 | -} | ||
86 | -#endif | ||
87 | - | ||
88 | -#endif |
此 diff 太大无法显示。
1 | -/** | ||
2 | - ******************************************************************** | ||
3 | - * @file JZsdk_Uart_SendDeal.h | ||
4 | - * | ||
5 | - * | ||
6 | - ********************************************************************* | ||
7 | - */ | ||
8 | - | ||
9 | -/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/ | ||
10 | -#ifndef JZSDK_IART_SENDDEAL_H | ||
11 | -#define JZSDK_IART_SENDDEAL_H | ||
12 | - | ||
13 | -/* Includes ------------------------------------------------------------------*/ | ||
14 | -#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h" | ||
15 | - | ||
16 | -#ifdef __cplusplus | ||
17 | -extern "C" { | ||
18 | -#endif | ||
19 | - | ||
20 | -/* Exported constants --------------------------------------------------------*/ | ||
21 | -/* 常亮定义*/ | ||
22 | - | ||
23 | - | ||
24 | -/* Exported types ------------------------------------------------------------*/ | ||
25 | -int JZsdk_Uart_SendDeal_Send_Connect(int Uartport , int FrameSequence,int Version_flag); | ||
26 | -int JZsdk_Uart_SendDeal_ConnectFrame(int PortNum); | ||
27 | -int JZsdk_Uart_SendDeal_Send_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus); | ||
28 | - | ||
29 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_PowerStatus(int Uartport, int FrameSequence, int status); | ||
30 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(int Uartport , int FrameSequence,int HeartBeatStatus); | ||
31 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Ask_TimeStamp(int Uartport , int FrameSequence); | ||
32 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllVersion(int Uartport, int FrameSequence, int DeviceID, int MajorVersion, int MinorVersion, int ModifyVersion, int DebugVersion); | ||
33 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_SendAllSerialNumber(int Uartport, int FrameSequence, int DeviceID, unsigned char *SerialNumber, int SerialNumberLen); | ||
34 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_DeviceMessage(int UartPort, int FrameSequence, unsigned char *message, unsigned int messageLen); | ||
35 | - | ||
36 | -int JZsdk_Uart_SendDeal_Reply_SecondaryDeviceName(int Uartport , int device_name, int FrameSequence); | ||
37 | -int JZsdk_Uart_SendDeal_QuerySecondaryDeviceName(int Uartport ,int FrameSequence); | ||
38 | - | ||
39 | - | ||
40 | - | ||
41 | -int JZsdk_Uart_SendDeal_Reply_Sucesss(int Uartport ,int FrameSequence); | ||
42 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_CheckError(int Uartport ,int FrameSequence); | ||
43 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Reply_DecodeError(int Uartport ,int FrameSequence); | ||
44 | - | ||
45 | - | ||
46 | - | ||
47 | -int JZsdk_Uart_SendDeal_Reply_Failure(int Uartport ,int FrameSequence); | ||
48 | -T_JZsdkReturnCode JZsdk_Uart_SentDeal_Reply_Musiclist(int UartPort ,int FrameSequence, int music_sum ,char **MusicName ,int *MusicNameLength); | ||
49 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_2(int Uartport, int FrameSequence, unsigned char *name, unsigned int namelen, unsigned int Filesize, unsigned int Time); | ||
50 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioDetailMessage(int Uartport,int FrameSequence, unsigned char type ,unsigned char *data, unsigned int datalen); | ||
51 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Start(int Uartport, int FrameSequence, int music_sum); | ||
52 | -T_JZsdkReturnCode JZsdk_Uart_SendDeal_Send_AudioList_Stop(int Uartport, int FrameSequence); | ||
53 | - | ||
54 | - | ||
55 | - | ||
56 | -int JZsdk_Uart_SendDeal_Send_PlayStatus_end(int Uartport); | ||
57 | -int JZsdk_Uart_SendDeal_Send_PlayStatus(int Uartport ,int num); | ||
58 | -int JZsdk_Uart_SendDeal_Reply_MusicName(int Uartport ,char *music_name, int music_name_len); | ||
59 | -int JZsdk_Uart_SendDeal_Reply_Volume(int Uartport ,int num); | ||
60 | -int JZsdk_Uart_SendDeal_OpusDecodeStatus(int Uartport,int value); | ||
61 | - | ||
62 | -int JZsdk_Uart_SendDeal_Reply_GimbalPitchAngle(int Uartport ,int angle); | ||
63 | -int JZsdk_Uart_SendDeal_Set_GimbalPitchAngle(int Uartport ,int angle); | ||
64 | -int JZsdk_Uart_SendDeal_Reply_GimbalFineTuningPitch(int Uartport, int FrameSequence, int FineTunigPitch); | ||
65 | -int JZsdk_Uart_SendDeal_Set_GimbalFineTuningPitch(int Uartport, int PitchFineTuning); | ||
66 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalFineTuningPitch(int Uartport, int FrameSequence); | ||
67 | -int JZsdk_Uart_SendDeal_Set_GimbalLinkageControl(int Uartport,int FrameSequence, int value); | ||
68 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalLinkage(int Uartport,int FrameSequence); | ||
69 | -int JZsdk_Uart_SendDeal_GimbalLinkageControl(int Uartport,int FrameSequence,int value); | ||
70 | -int JZsdk_Uart_SendDeal_CheckStatus_GimbalAngle(int Uartport ,int FrameSequence); | ||
71 | -int JZsdk_Uart_SendDeal_SetGimbalRange(int Uartport,int FrameSequence,int value); | ||
72 | - | ||
73 | - | ||
74 | -int JZsdk_Uart_SendDeal_Reply_SoftVersion(int Uartport ,char majorVersion, char minorVersion, char modifyVersion, char debugVersion); | ||
75 | -int JZsdk_Uart_SendDeal_Reply_LoopPlayStatus(int Uartport ,int status); | ||
76 | -int JZsdk_Uart_SendDeal_Reply_TTS_tone(int Uartport ,int tone); | ||
77 | -int JZsdk_Uart_SendDeal_Reply_TTS_speed(int Uartport ,int speed); | ||
78 | - | ||
79 | -int JZsdk_Uart_SendDeal_Set_SearchLightFrequency(int Uartport ,int Frequency); | ||
80 | -int JZsdk_Uart_SendDeal_SearchLight_Control(int Uartport,int mode); | ||
81 | -int JZsdk_Uart_SendDeal_SearchLight_SetLumen(int Uartport, int LeftLumen, int RightLumen); | ||
82 | -int JZsdk_Uart_SendDeal_MessageSubcription_Control(int Uartport, int value); | ||
83 | - | ||
84 | -int JZsdk_Uart_SendDeal_Set_WarningLight_Status(int Uartport,int status, int mode); | ||
85 | -int JZsdk_Uart_SendDeal_Set_WarningLight_Color(int Uartport,int color1, int color2); | ||
86 | - | ||
87 | -int JZsdk_Uart_SendDeal_SerialNumber(int UartPort, int FrameSequence, char *SerialNumber, int SerialNumberLenth); | ||
88 | -int JZsdk_Uart_Reply_CheckSpecialParameters(int Uartport,int FrameSequence,int type, int value); | ||
89 | - | ||
90 | - | ||
91 | - | ||
92 | - | ||
93 | - | ||
94 | - | ||
95 | -int JZsdk_Uart_SendDeal_SearchLight_Frequency(int Uartport, int Frequency); | ||
96 | -int JZsdk_Uart_SendDeal_SearchLight_Mode(int Uartport, int mode); | ||
97 | -int JZsdk_Uart_SendDeal_SearchLight_Lumen(int Uartport,int LeftLumen, int RightLumen); | ||
98 | -int JZsdk_Uart_SendDeal_SearchLight_Temperature(int Uartport, int LeftTemperature, int RightTemperature); | ||
99 | - | ||
100 | - | ||
101 | -//查询探照灯频率 | ||
102 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Frequency(int Uartport); | ||
103 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Lumen(int Uartport); | ||
104 | -int JZsdk_Uart_SendDeal_Set_SearchLight_CheckStatus_Mode(int Uartport); | ||
105 | -int JZsdk_Uart_SendDeal_CheckStatus_LightAttribute(int Uartport); | ||
106 | -int JZsdk_Uart_SendDeal_CheckStatus_SearchLightTemperture(int Uartport); | ||
107 | - | ||
108 | - | ||
109 | -int JZsdk_Uart_SendDeal_WarningLight_Status(int Uartport, int status, int mode); | ||
110 | -int JZsdk_Uart_SendDeal_WarningLight_Color(int Uartport, int color1, int color2); | ||
111 | -int JZsdk_Uart_SendDeal_CheckStatus_WarningLightStatus(int Uartport); | ||
112 | -int JZsdk_Uart_SendDeal_CheckStatus_WarningLightColor(int Uartport); | ||
113 | - | ||
114 | -int JZsdk_Uart_SendDeal_OutputPowerStatus(int Uartport, int FrameSequence, int status); | ||
115 | - | ||
116 | - | ||
117 | -/* Exported functions --------------------------------------------------------*/ | ||
118 | - | ||
119 | -#ifdef __cplusplus | ||
120 | -} | ||
121 | -#endif | ||
122 | - | ||
123 | -#endif |
@@ -7,14 +7,14 @@ | @@ -7,14 +7,14 @@ | ||
7 | #include <unistd.h> | 7 | #include <unistd.h> |
8 | #include <termios.h> | 8 | #include <termios.h> |
9 | #include <sys/time.h> | 9 | #include <sys/time.h> |
10 | -#include "JZsdk_uart/Uart_Config.h" | ||
11 | 10 | ||
12 | #include "JZsdkLib.h" | 11 | #include "JZsdkLib.h" |
13 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | 12 | +#include "BaseConfig.h" |
13 | + | ||
14 | #include "JZsdk_TaskManagement/TaskManagement.h" | 14 | #include "JZsdk_TaskManagement/TaskManagement.h" |
15 | #include "JZsdk_Uart_UartDeal.h" | 15 | #include "JZsdk_Uart_UartDeal.h" |
16 | 16 | ||
17 | -#include "Hal_Recv/HalRecv_type1/HalRecv_type1.h" | 17 | +#include "Hal_Recv/HalRecv.h" |
18 | 18 | ||
19 | #if APP_VERSION == APP_PSDK | 19 | #if APP_VERSION == APP_PSDK |
20 | #include "data_transmission/test_data_transmission.h" | 20 | #include "data_transmission/test_data_transmission.h" |
@@ -302,7 +302,7 @@ static void *UartDeal_deal(void *arg) | @@ -302,7 +302,7 @@ static void *UartDeal_deal(void *arg) | ||
302 | if (args->MessageLength > 0) | 302 | if (args->MessageLength > 0) |
303 | { | 303 | { |
304 | //处理数据 | 304 | //处理数据 |
305 | - ResidualLength = HalRecv_tpye1_PreliminaryScreeningOfData(args->Message, args->MessageLength, args->UartDevName); | 305 | + ResidualLength = HalRecv_type1_PreliminaryScreeningOfData(args->Message, args->MessageLength, args->UartDevName); |
306 | 306 | ||
307 | //如果还有剩余的长度 | 307 | //如果还有剩余的长度 |
308 | if (ResidualLength != 0) //将其返还到缓冲区 | 308 | if (ResidualLength != 0) //将其返还到缓冲区 |
@@ -357,6 +357,32 @@ static void *UartDeal_deal(void *arg) | @@ -357,6 +357,32 @@ static void *UartDeal_deal(void *arg) | ||
357 | * | 357 | * |
358 | **********************************************************************************************************************/ | 358 | **********************************************************************************************************************/ |
359 | 359 | ||
360 | +/********** | ||
361 | + * | ||
362 | + * 无任务发送函数 | ||
363 | + * | ||
364 | + * ***********/ | ||
365 | +T_JZsdkReturnCode JZsdk_Uart_UartSend_NotTask(int Uart_Name, unsigned char *str, int str_lenth) | ||
366 | +{ | ||
367 | + if (Uart_Name == UART_4G) | ||
368 | + { | ||
369 | + printf("向4G设备发送\n"); | ||
370 | + write(Uart_4G_fd, str, str_lenth); | ||
371 | + } | ||
372 | + else if (Uart_Name == UART_DEV_1) | ||
373 | + { | ||
374 | + printf("向串口1号设备发送\n"); | ||
375 | + write(Uart_DEV1_fd, str, str_lenth); | ||
376 | + } | ||
377 | + else if (Uart_Name = UART_DEV_2) | ||
378 | + { | ||
379 | + printf("向串口2号设备发送\n"); | ||
380 | + write(Uart_DEV2_fd, str, str_lenth); | ||
381 | + } | ||
382 | + | ||
383 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
384 | +} | ||
385 | + | ||
360 | 386 | ||
361 | typedef struct { | 387 | typedef struct { |
362 | char* str; | 388 | char* str; |
@@ -448,39 +474,36 @@ T_JZsdkReturnCode JZsdk_Uart_UartSend(int UartPort, unsigned char *send, int num | @@ -448,39 +474,36 @@ T_JZsdkReturnCode JZsdk_Uart_UartSend(int UartPort, unsigned char *send, int num | ||
448 | * 串口识别符关闭 | 474 | * 串口识别符关闭 |
449 | * | 475 | * |
450 | * ****************/ | 476 | * ****************/ |
451 | -int JZsdk_Uart_CloseUartFd(int UartPort) | 477 | +static T_JZsdkReturnCode JZsdk_Uart_CloseUartFd(int UartPort) |
452 | { | 478 | { |
453 | if (UartPort == UART_4G) | 479 | if (UartPort == UART_4G) |
454 | { | 480 | { |
455 | JZSDK_LOG_INFO("关闭4g串口识别符\n"); | 481 | JZSDK_LOG_INFO("关闭4g串口识别符\n"); |
456 | close(Uart_4G_fd); | 482 | close(Uart_4G_fd); |
457 | - return 0; | 483 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
458 | } | 484 | } |
459 | else if (UartPort == UART_DEV_1) | 485 | else if (UartPort == UART_DEV_1) |
460 | { | 486 | { |
461 | JZSDK_LOG_INFO("关闭串口1识别符\n"); | 487 | JZSDK_LOG_INFO("关闭串口1识别符\n"); |
462 | close(Uart_DEV1_fd); | 488 | close(Uart_DEV1_fd); |
463 | - return 0; | 489 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
464 | } | 490 | } |
465 | else if (UartPort == UART_DEV_2) | 491 | else if (UartPort == UART_DEV_2) |
466 | { | 492 | { |
467 | JZSDK_LOG_INFO("关闭串口2识别符\n"); | 493 | JZSDK_LOG_INFO("关闭串口2识别符\n"); |
468 | close(Uart_DEV1_fd); | 494 | close(Uart_DEV1_fd); |
469 | - return 0; | 495 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
470 | } | 496 | } |
471 | } | 497 | } |
472 | 498 | ||
473 | - | ||
474 | - | ||
475 | - | ||
476 | -static void *CloseUart(void *arg) | 499 | +T_JZsdkReturnCode JZsdk_Uart_CloseUartThead(int UartPort) |
477 | { | 500 | { |
478 | - s_SerialInitArg *args = (s_SerialInitArg *)arg; | ||
479 | - int UartPort = args->UartDevName; | ||
480 | - int BitRate = args->BitRate; | 501 | + //将串口描述符关闭 |
502 | + JZsdk_Uart_CloseUartFd(UartPort); | ||
481 | 503 | ||
482 | - Recv_Thread = JZ_FLAGCODE_ON; | ||
483 | - Deal_Thread = JZ_FLAGCODE_ON; | 504 | + //关闭对应的线程 |
505 | + Deal_Thread = JZ_FLAGCODE_ON; //将处理标志位打开 | ||
506 | + Recv_Thread = JZ_FLAGCODE_ON; //将存储标志位打开 | ||
484 | 507 | ||
485 | if (UartPort == UART_4G) | 508 | if (UartPort == UART_4G) |
486 | { | 509 | { |
@@ -499,52 +522,17 @@ static void *CloseUart(void *arg) | @@ -499,52 +522,17 @@ static void *CloseUart(void *arg) | ||
499 | } | 522 | } |
500 | else | 523 | else |
501 | { | 524 | { |
502 | - return 0; | 525 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
503 | } | 526 | } |
504 | 527 | ||
505 | //直到某个串口达成了关闭,这里不能明确到判断哪个串口关闭,但是识别第一个关闭的串口 | 528 | //直到某个串口达成了关闭,这里不能明确到判断哪个串口关闭,但是识别第一个关闭的串口 |
506 | while ( (Recv_Thread != JZ_FLAGCODE_OFF) && (Deal_Thread != JZ_FLAGCODE_OFF)) | 529 | while ( (Recv_Thread != JZ_FLAGCODE_OFF) && (Deal_Thread != JZ_FLAGCODE_OFF)) |
507 | { | 530 | { |
508 | - delayMs(1); | 531 | + delayUs(500); |
509 | } | 532 | } |
510 | 533 | ||
511 | //保证全部注销后 | 534 | //保证全部注销后 |
512 | - JZSDK_LOG_INFO("串口注销完毕"); | ||
513 | - | ||
514 | - //创建新的 | ||
515 | - JZsdk_Uart_SecondInit(UartPort, BitRate); | ||
516 | - | ||
517 | - free(args); | ||
518 | -} | ||
519 | - | ||
520 | -/**************** | ||
521 | - * | ||
522 | - * 线程关闭, 并创建一个新的串口 | ||
523 | - * | ||
524 | - * ****************/ | ||
525 | -int JZsdk_Uart_CloseUartThead(int UartPort, int BitRate) | ||
526 | -{ | ||
527 | - | ||
528 | - //将串口描述符关闭 | ||
529 | - JZsdk_Uart_CloseUartFd(UartPort); | 535 | + JZSDK_LOG_INFO("0x%x 串口注销完毕", UartPort); |
530 | 536 | ||
531 | - s_SerialInitArg *parameter = (s_SerialInitArg *)malloc(sizeof(s_SerialInitArg)); | ||
532 | - parameter->UartDevName = UartPort; | ||
533 | - parameter->BitRate = BitRate; | ||
534 | - | ||
535 | - | ||
536 | - // 创建关闭串口的线程 | ||
537 | - pthread_t CloseThread; | ||
538 | - pthread_attr_t task_attribute; // 线程属性 | ||
539 | - pthread_attr_setdetachstate(&task_attribute, PTHREAD_CREATE_DETACHED); // 设置线程分离属性 | ||
540 | - | ||
541 | - pthread_attr_init(&task_attribute); | ||
542 | - | ||
543 | - | ||
544 | - // 创建串口数据处理线程 | ||
545 | - if (pthread_create(&CloseThread, &task_attribute, CloseUart, parameter) != 0) | ||
546 | - { | ||
547 | - JZSDK_LOG_ERROR("Failed to create receive thread"); | ||
548 | - return 1; | ||
549 | - } | 537 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
550 | } | 538 | } |
@@ -25,8 +25,7 @@ extern "C" { | @@ -25,8 +25,7 @@ extern "C" { | ||
25 | /* Exported functions --------------------------------------------------------*/ | 25 | /* Exported functions --------------------------------------------------------*/ |
26 | T_JZsdkReturnCode JZsdk_Uart_UartSend(int UartPort ,unsigned char *send, int num); | 26 | T_JZsdkReturnCode JZsdk_Uart_UartSend(int UartPort ,unsigned char *send, int num); |
27 | int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name); | 27 | int JZsdk_Uart_UartDeal_Receive(int Uart_fd, int Uart_Dev_name); |
28 | -int JZsdk_Uart_CloseUartFd(int UartPort); | ||
29 | -int JZsdk_Uart_CloseUartThead(int UartPort, int BitRate); | 28 | +T_JZsdkReturnCode JZsdk_Uart_CloseUartThead(int UartPort); |
30 | T_JZsdkReturnCode JZsdk_Uart_UartSend_NotTask(int Uart_Name, unsigned char *str, int str_lenth); | 29 | T_JZsdkReturnCode JZsdk_Uart_UartSend_NotTask(int Uart_Name, unsigned char *str, int str_lenth); |
31 | int UartDeal_Recv_interface(int type, int Uart_fd , unsigned char *getbuf, int getbufLen); | 30 | int UartDeal_Recv_interface(int type, int Uart_fd , unsigned char *getbuf, int getbufLen); |
32 | 31 |
1 | -#include <stdio.h> | ||
2 | -#include <string.h> | ||
3 | -#include <stdlib.h> | ||
4 | - | ||
5 | -#include <fcntl.h> | ||
6 | -#include <unistd.h> | ||
7 | -#include <termios.h> | ||
8 | -#include <sys/time.h> | ||
9 | - | ||
10 | -#include "JZsdkLib.h" | ||
11 | - | ||
12 | -/******************************************* | ||
13 | -* | ||
14 | -* 使能一个串口 返回设备号 | ||
15 | -* 变量1 串口设备名 | ||
16 | - 变量2 比特率 | ||
17 | - 返回 int 设备号 | ||
18 | - 例子: UartDeal_Base_CreateReceive("/dev/ttyS2", 115200) | ||
19 | - | ||
20 | -*******************************************/ | ||
21 | -int UartConnection_UartEnabled(char *UartDev, int BitRate) | ||
22 | -{ | ||
23 | - int ret = 0; | ||
24 | - int UartReceive_fd = 0; | ||
25 | - pthread_t UartReceive_task; | ||
26 | - char PrintStr[256]; | ||
27 | - | ||
28 | - //1、读取串口 | ||
29 | - UartReceive_fd = open(UartDev,O_RDWR); | ||
30 | - if(UartReceive_fd < 0) | ||
31 | - { | ||
32 | - snprintf(PrintStr, 256, "打开%s失败", UartDev); | ||
33 | - printf("%s\n", PrintStr); | ||
34 | - return -1; | ||
35 | - } | ||
36 | - else | ||
37 | - { | ||
38 | - snprintf(PrintStr, 256, "打开%s成功", UartDev); | ||
39 | - printf("%s\n", PrintStr); | ||
40 | - } | ||
41 | - | ||
42 | - //2、获取终端信息 | ||
43 | - struct termios options; | ||
44 | - if(tcgetattr(UartReceive_fd,&options)!= 0) //获取终端信息 | ||
45 | - { | ||
46 | - printf("获取终端信息失败!\n"); | ||
47 | - return -1; | ||
48 | - } | ||
49 | - | ||
50 | - //3、设置比特率 | ||
51 | - switch (BitRate) | ||
52 | - { | ||
53 | - case 115200: | ||
54 | - cfsetispeed(&options, B115200); | ||
55 | - cfsetospeed(&options, B115200); | ||
56 | - break; | ||
57 | - case 230400: | ||
58 | - cfsetispeed(&options, B230400); | ||
59 | - cfsetospeed(&options, B230400); | ||
60 | - break; | ||
61 | - case 460800: | ||
62 | - cfsetispeed(&options, B460800); | ||
63 | - cfsetospeed(&options, B460800); | ||
64 | - break; | ||
65 | - case 921600: | ||
66 | - cfsetispeed(&options, B921600); | ||
67 | - cfsetospeed(&options, B921600); | ||
68 | - break; | ||
69 | - case 1000000: | ||
70 | - cfsetispeed(&options, B1000000); | ||
71 | - cfsetospeed(&options, B1000000); | ||
72 | - break; | ||
73 | - default: | ||
74 | - return -1; | ||
75 | - break; | ||
76 | - } | ||
77 | - | ||
78 | - options.c_cflag |= (unsigned) CLOCAL; | ||
79 | - options.c_cflag |= (unsigned) CREAD; | ||
80 | - options.c_cflag &= ~(unsigned) CRTSCTS; | ||
81 | - options.c_cflag &= ~(unsigned) CSIZE; | ||
82 | - options.c_cflag |= (unsigned) CS8; | ||
83 | - options.c_cflag &= ~(unsigned) PARENB; | ||
84 | - options.c_iflag &= ~(unsigned) INPCK; | ||
85 | - options.c_cflag &= ~(unsigned) CSTOPB; | ||
86 | - options.c_oflag &= ~(unsigned) OPOST; | ||
87 | - options.c_lflag &= ~((unsigned) ICANON | (unsigned) ECHO | (unsigned) ECHOE | (unsigned) ISIG); | ||
88 | - options.c_iflag &= ~((unsigned) BRKINT | (unsigned) ICRNL | (unsigned) INPCK | (unsigned) ISTRIP | (unsigned) IXON); | ||
89 | - options.c_cc[VTIME] = 0; | ||
90 | - options.c_cc[VMIN] = 0; | ||
91 | - | ||
92 | - | ||
93 | - tcflush(UartReceive_fd,TCIOFLUSH); //刷清输入、输出队列 | ||
94 | - tcsetattr(UartReceive_fd,TCSAFLUSH,&options); //串口设置使能 | ||
95 | - | ||
96 | - JZSDK_LOG_INFO("使能串口 波特率%d成功",BitRate); | ||
97 | - | ||
98 | - return UartReceive_fd; | ||
99 | -} |
@@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
16 | #include "Gimbal/Gimbal.h" | 16 | #include "Gimbal/Gimbal.h" |
17 | #include "Gimbal/Gimbal_DataDeal/Gimbal_DataDeal.h" | 17 | #include "Gimbal/Gimbal_DataDeal/Gimbal_DataDeal.h" |
18 | #include "Gimbal/Gimbal_MotorFineTuning/MotorFineTuning.h" | 18 | #include "Gimbal/Gimbal_MotorFineTuning/MotorFineTuning.h" |
19 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
20 | 19 | ||
21 | #include "BaseConfig.h" | 20 | #include "BaseConfig.h" |
22 | 21 | ||
@@ -112,20 +111,7 @@ static T_JZsdkReturnCode Gimal_MotorInit() | @@ -112,20 +111,7 @@ static T_JZsdkReturnCode Gimal_MotorInit() | ||
112 | 111 | ||
113 | } | 112 | } |
114 | 113 | ||
115 | -//初始化云台模块 | ||
116 | -T_JZsdkReturnCode Gimbal_Init() | ||
117 | -{ | ||
118 | - //舵机初始化 | ||
119 | - Gimal_MotorInit(); | ||
120 | - | ||
121 | - //云台微调初始化 | ||
122 | - MotorFineTuning_Init(&g_MotorFineTuningPitch, &g_MotorFineTuningYaw, &g_MotorFineTuningRoll); | ||
123 | 114 | ||
124 | - //云台flag打开 | ||
125 | - g_JZsdk_GimbalStatusFlag = JZ_FLAGCODE_ON; | ||
126 | - | ||
127 | - JZSDK_LOG_INFO("JZsdk_Gimbal_Module_init"); | ||
128 | -} | ||
129 | 115 | ||
130 | //设置云台俯仰角度 | 116 | //设置云台俯仰角度 |
131 | T_JZsdkReturnCode Gimbal_Set_PitchAngle(int angle) | 117 | T_JZsdkReturnCode Gimbal_Set_PitchAngle(int angle) |
@@ -558,4 +544,98 @@ T_JZsdkReturnCode Gimbal_Flush_Pitch() | @@ -558,4 +544,98 @@ T_JZsdkReturnCode Gimbal_Flush_Pitch() | ||
558 | g_Flush_Pitch = JZ_FLAGCODE_ON; | 544 | g_Flush_Pitch = JZ_FLAGCODE_ON; |
559 | 545 | ||
560 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 546 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
547 | +} | ||
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | ||
552 | + | ||
553 | + | ||
554 | + | ||
555 | + | ||
556 | + | ||
557 | + | ||
558 | + | ||
559 | + | ||
560 | + | ||
561 | + | ||
562 | + | ||
563 | + | ||
564 | + | ||
565 | + | ||
566 | + | ||
567 | + | ||
568 | + | ||
569 | + | ||
570 | + | ||
571 | + | ||
572 | + | ||
573 | + | ||
574 | + | ||
575 | + | ||
576 | + | ||
577 | +/************************** | ||
578 | + * | ||
579 | + * | ||
580 | + * 云台独立控制模式初始化 | ||
581 | + * | ||
582 | + * | ||
583 | + * **************************/ | ||
584 | +static T_JZsdkReturnCode Gimbal_Init_Gimbal_Init_TransparentControl() | ||
585 | +{ | ||
586 | + | ||
587 | +} | ||
588 | + | ||
589 | +/************************** | ||
590 | + * | ||
591 | + * | ||
592 | + * 云台独立控制模式初始化 | ||
593 | + * | ||
594 | + * | ||
595 | + * **************************/ | ||
596 | +static T_JZsdkReturnCode Gimbal_Init_IndependentControl() | ||
597 | +{ | ||
598 | + //舵机初始化 | ||
599 | + Gimal_MotorInit(); | ||
600 | + | ||
601 | + //云台微调初始化 | ||
602 | + MotorFineTuning_Init(&g_MotorFineTuningPitch, &g_MotorFineTuningYaw, &g_MotorFineTuningRoll); | ||
603 | +} | ||
604 | + | ||
605 | +/*************************** | ||
606 | + * | ||
607 | + * 初始化云台模块 | ||
608 | + * 云台模块目前有两种方案 | ||
609 | + * | ||
610 | + * 第一种 | ||
611 | + * 单一机子,如u3,使用的是独立控制 | ||
612 | + * | ||
613 | + * 第二种 组合机 | ||
614 | + * 机子作为中继器,使用的是透传 | ||
615 | + * | ||
616 | + * ******************************/ | ||
617 | +T_JZsdkReturnCode Gimbal_Init(enum JZ_MODULE_CONTROL_WAY Mode) | ||
618 | +{ | ||
619 | + switch (Mode) | ||
620 | + { | ||
621 | + //独立控制模式 | ||
622 | + case JZ_MODULE_CONTROL_WAY_INDEPENDENT: | ||
623 | + Gimbal_Init_IndependentControl(); | ||
624 | + break; | ||
625 | + | ||
626 | + //透传模式 | ||
627 | + case JZ_MODULE_CONTROL_WAY_TRANSPARENT: | ||
628 | + Gimbal_Init_Gimbal_Init_TransparentControl(); | ||
629 | + break; | ||
630 | + | ||
631 | + default: | ||
632 | + JZSDK_LOG_ERROR("云台初始化失败,初始化模式选择错误"); | ||
633 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
634 | + break; | ||
635 | + } | ||
636 | + | ||
637 | + //云台flag打开 | ||
638 | + g_JZsdk_GimbalStatusFlag = JZ_FLAGCODE_ON; | ||
639 | + | ||
640 | + JZSDK_LOG_INFO("JZsdk_Gimbal_Module_init"); | ||
561 | } | 641 | } |
@@ -23,7 +23,8 @@ extern "C" { | @@ -23,7 +23,8 @@ extern "C" { | ||
23 | /* Exported types ------------------------------------------------------------*/ | 23 | /* Exported types ------------------------------------------------------------*/ |
24 | 24 | ||
25 | /* Exported functions --------------------------------------------------------*/ | 25 | /* Exported functions --------------------------------------------------------*/ |
26 | -T_JZsdkReturnCode Gimbal_Init(); | 26 | +T_JZsdkReturnCode Gimbal_Init(enum JZ_MODULE_CONTROL_WAY Mode); |
27 | + | ||
27 | T_JZsdkReturnCode Get_JZsdk_GimbalStatusFlag(); | 28 | T_JZsdkReturnCode Get_JZsdk_GimbalStatusFlag(); |
28 | 29 | ||
29 | 30 |
@@ -5,13 +5,12 @@ | @@ -5,13 +5,12 @@ | ||
5 | #include "JZsdkLib.h" | 5 | #include "JZsdkLib.h" |
6 | #include "BaseConfig.h" | 6 | #include "BaseConfig.h" |
7 | 7 | ||
8 | -#include "JZsdk_uart/UartConnection/UartConnection.h" | ||
9 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
10 | - | ||
11 | #include "JZsdk_TaskManagement/TaskManagement.h" | 8 | #include "JZsdk_TaskManagement/TaskManagement.h" |
12 | #include "Gimbal_SpecialUart/Gimbal_SpecialUart.h" | 9 | #include "Gimbal_SpecialUart/Gimbal_SpecialUart.h" |
13 | #include "../Gimbal_Param.h" | 10 | #include "../Gimbal_Param.h" |
14 | 11 | ||
12 | +#include "Hal_Send/HalSend.h" | ||
13 | + | ||
15 | #if WIRINGPI_STATUS == VERSION_SWITCH_ON | 14 | #if WIRINGPI_STATUS == VERSION_SWITCH_ON |
16 | #include <wiringPi.h> | 15 | #include <wiringPi.h> |
17 | #endif | 16 | #endif |
@@ -113,12 +112,12 @@ T_JZsdkReturnCode Gimbal_DataDeal_SetRealAngle(int angle) | @@ -113,12 +112,12 @@ T_JZsdkReturnCode Gimbal_DataDeal_SetRealAngle(int angle) | ||
113 | || DEVICE_VERSION == TF_A1 | 112 | || DEVICE_VERSION == TF_A1 |
114 | 113 | ||
115 | //发送角度给串口2 | 114 | //发送角度给串口2 |
116 | - JZsdk_Uart_Send_SetGimbalPitch(UART_DEV_2, angle); | 115 | + HalSend_type1Send_Set_GimbalPitchAngle(UART_DEV_2, angle); |
117 | 116 | ||
118 | #elif DEVICE_VERSION == JZ_H1T | 117 | #elif DEVICE_VERSION == JZ_H1T |
119 | 118 | ||
120 | //发送角度给串口1 | 119 | //发送角度给串口1 |
121 | - JZsdk_Uart_Send_SetGimbalPitch(UART_DEV_1, angle); | 120 | + HalSend_type1Send_Set_GimbalPitchAngle(UART_DEV_1, angle); |
122 | 121 | ||
123 | #else | 122 | #else |
124 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | 123 | return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; |
@@ -269,11 +268,11 @@ T_JZsdkReturnCode Gimbal_DataDeal_SetPitchRange(int Range) | @@ -269,11 +268,11 @@ T_JZsdkReturnCode Gimbal_DataDeal_SetPitchRange(int Range) | ||
269 | 268 | ||
270 | if (Range == 0xFF) | 269 | if (Range == 0xFF) |
271 | { | 270 | { |
272 | - JZsdk_Uart_Send_SetGimbalRange(UART_DEV_2, 0, Range); | 271 | + HalSend_type1Send_SetGimbalRange(UART_DEV_2, 0, Range); |
273 | } | 272 | } |
274 | else if (Range == 0x00) | 273 | else if (Range == 0x00) |
275 | { | 274 | { |
276 | - JZsdk_Uart_Send_SetGimbalRange(UART_DEV_2, 0, Range); | 275 | + HalSend_type1Send_SetGimbalRange(UART_DEV_2, 0, Range); |
277 | } | 276 | } |
278 | 277 | ||
279 | #elif DEVICE_VERSION == JZ_H1T | 278 | #elif DEVICE_VERSION == JZ_H1T |
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "./SearchLight_V3S_H1T.h" | 2 | #include "./SearchLight_V3S_H1T.h" |
3 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
4 | #include "BaseConfig.h" | 3 | #include "BaseConfig.h" |
5 | 4 | ||
5 | +#include "Hal_Send/HalSend.h" | ||
6 | + | ||
6 | //设置探照灯频率 | 7 | //设置探照灯频率 |
7 | T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightFrequency(int value) | 8 | T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightFrequency(int value) |
8 | { | 9 | { |
9 | //向H1T的单片机发送调节频率帧 | 10 | //向H1T的单片机发送调节频率帧 |
10 | - JZsdk_Uart_Send_SearchLight_SetFrequency(UART_DEV_1, value); | 11 | + HalSend_type1Send_Set_SearchLightFrequency(UART_DEV_1, value); |
11 | 12 | ||
12 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 13 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
13 | } | 14 | } |
@@ -16,7 +17,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightFrequency(int value) | @@ -16,7 +17,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightFrequency(int value) | ||
16 | T_JZsdkReturnCode SearchLight_V3S_H1T_SearchLightControl(int mode) | 17 | T_JZsdkReturnCode SearchLight_V3S_H1T_SearchLightControl(int mode) |
17 | { | 18 | { |
18 | //向H1T的单片机发送探照灯控制帧 | 19 | //向H1T的单片机发送探照灯控制帧 |
19 | - JZsdk_Uart_Send_SearchLight_Control(UART_DEV_1, mode); | 20 | + HalSend_type1Send_SearchLight_Control(UART_DEV_1, mode); |
20 | 21 | ||
21 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 22 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
22 | } | 23 | } |
@@ -25,7 +26,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_SearchLightControl(int mode) | @@ -25,7 +26,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_SearchLightControl(int mode) | ||
25 | T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightLumen(int LeftLumen, int RightLumen) | 26 | T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightLumen(int LeftLumen, int RightLumen) |
26 | { | 27 | { |
27 | //向H1T的单片机发送探照灯控制帧 | 28 | //向H1T的单片机发送探照灯控制帧 |
28 | - JZsdk_Uart_Send_SearchLight_SetLumen(UART_DEV_1, LeftLumen, RightLumen); | 29 | + HalSend_type1Send_SearchLight_SetLumen(UART_DEV_1, LeftLumen, RightLumen); |
29 | 30 | ||
30 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 31 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
31 | } | 32 | } |
@@ -34,7 +35,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightLumen(int LeftLumen, int Ri | @@ -34,7 +35,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_Set_SearchLightLumen(int LeftLumen, int Ri | ||
34 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightMode() | 35 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightMode() |
35 | { | 36 | { |
36 | //向H1T的单片机发送探照灯灯光模式查询帧 | 37 | //向H1T的单片机发送探照灯灯光模式查询帧 |
37 | - JZsdk_Uart_Send_SearchLight_CheckStatus_Mode(UART_DEV_1); | 38 | + HalSend_type1Send_CheckStatus_SearchLight_Mode(UART_DEV_1); |
38 | 39 | ||
39 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 40 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
40 | } | 41 | } |
@@ -43,7 +44,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightMode() | @@ -43,7 +44,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightMode() | ||
43 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightLumen() | 44 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightLumen() |
44 | { | 45 | { |
45 | //向H1T的单片机发送探照灯灯光模式查询帧 | 46 | //向H1T的单片机发送探照灯灯光模式查询帧 |
46 | - JZsdk_Uart_Send_SearchLight_CheckStatus_Lumen(UART_DEV_1); | 47 | + HalSend_type1Send_CheckStatus_SearchLight_Lumen(UART_DEV_1); |
47 | 48 | ||
48 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 49 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
49 | } | 50 | } |
@@ -52,7 +53,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightLumen() | @@ -52,7 +53,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightLumen() | ||
52 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightFrequency() | 53 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightFrequency() |
53 | { | 54 | { |
54 | //向H1T的单片机发送探照灯灯光模式查询帧 | 55 | //向H1T的单片机发送探照灯灯光模式查询帧 |
55 | - JZsdk_Uart_Send_SearchLight_CheckStatus_Frequency(UART_DEV_1); | 56 | + HalSend_type1Send_CheckStatus_SearchLight_Frequency(UART_DEV_1); |
56 | 57 | ||
57 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 58 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
58 | } | 59 | } |
@@ -62,7 +63,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightFrequency() | @@ -62,7 +63,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightFrequency() | ||
62 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightAttribute() | 63 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightAttribute() |
63 | { | 64 | { |
64 | //向H1T的单片机发送探照灯灯光模式查询帧 | 65 | //向H1T的单片机发送探照灯灯光模式查询帧 |
65 | - JZsdk_Uart_Send_SearchLight_CheckStatus_LightAttribute(UART_DEV_1); | 66 | + HalSend_type1Send_CheckStatus_SearchLight_Attribute(UART_DEV_1); |
66 | 67 | ||
67 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 68 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
68 | } | 69 | } |
@@ -71,7 +72,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightAttribute() | @@ -71,7 +72,7 @@ T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_LightAttribute() | ||
71 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_SearchLightTemperture() | 72 | T_JZsdkReturnCode SearchLight_V3S_H1T_CheckStatus_SearchLightTemperture() |
72 | { | 73 | { |
73 | //向H1T的单片机发送探照灯灯光模式查询帧 | 74 | //向H1T的单片机发送探照灯灯光模式查询帧 |
74 | - JZsdk_Uart_Send_SearchLight_CheckStatus_SearchLightTemperture(UART_DEV_1); | 75 | + HalSend_type1Send_CheckStatus_SearchLight_Temperture(UART_DEV_1); |
75 | 76 | ||
76 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 77 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
77 | } | 78 | } |
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "./SearchLight_V3S_TFA1.h" | 2 | #include "./SearchLight_V3S_TFA1.h" |
3 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | 3 | + |
4 | #include "BaseConfig.h" | 4 | #include "BaseConfig.h" |
5 | +#include "Hal_Send/HalSend.h" | ||
5 | 6 | ||
6 | 7 | ||
7 | T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightFrequency(int value) | 8 | T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightFrequency(int value) |
8 | { | 9 | { |
9 | //向u3的单片机发送调节频率帧 | 10 | //向u3的单片机发送调节频率帧 |
10 | - JZsdk_Uart_Send_SearchLight_SetFrequency(UART_DEV_2, value); | 11 | + HalSend_type1Send_Set_SearchLightFrequency(UART_DEV_2, value); |
11 | 12 | ||
12 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 13 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
13 | } | 14 | } |
@@ -15,7 +16,7 @@ T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightFrequency(int value) | @@ -15,7 +16,7 @@ T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightFrequency(int value) | ||
15 | T_JZsdkReturnCode SearchLight_V3S_TFA1_SearchLightControl(int mode) | 16 | T_JZsdkReturnCode SearchLight_V3S_TFA1_SearchLightControl(int mode) |
16 | { | 17 | { |
17 | //向u3的单片机发送探照灯控制帧 | 18 | //向u3的单片机发送探照灯控制帧 |
18 | - JZsdk_Uart_Send_SearchLight_Control(UART_DEV_2, mode); | 19 | + HalSend_type1Send_SearchLight_Control(UART_DEV_2, mode); |
19 | 20 | ||
20 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 21 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
21 | } | 22 | } |
@@ -24,7 +25,7 @@ T_JZsdkReturnCode SearchLight_V3S_TFA1_SearchLightControl(int mode) | @@ -24,7 +25,7 @@ T_JZsdkReturnCode SearchLight_V3S_TFA1_SearchLightControl(int mode) | ||
24 | T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightLumen(int LeftLumen, int RightLumen) | 25 | T_JZsdkReturnCode SearchLight_V3S_TFA1_Set_SearchLightLumen(int LeftLumen, int RightLumen) |
25 | { | 26 | { |
26 | //向tfa1的单片机发送探照灯控制帧 | 27 | //向tfa1的单片机发送探照灯控制帧 |
27 | - JZsdk_Uart_Send_SearchLight_SetLumen(UART_DEV_2, LeftLumen, RightLumen); | 28 | + HalSend_type1Send_SearchLight_SetLumen(UART_DEV_2, LeftLumen, RightLumen); |
28 | 29 | ||
29 | //向tfa1的单片机发送查询亮度帧 | 30 | //向tfa1的单片机发送查询亮度帧 |
30 | //JZsdk_Uart_Send_SearchLight_CheckStatus_Lumen(UART_DEV_2); | 31 | //JZsdk_Uart_Send_SearchLight_CheckStatus_Lumen(UART_DEV_2); |
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "./SearchLight_V3S_U3.h" | 2 | #include "./SearchLight_V3S_U3.h" |
3 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | 3 | + |
4 | #include "BaseConfig.h" | 4 | #include "BaseConfig.h" |
5 | +#include "Hal_Send/HalSend.h" | ||
5 | 6 | ||
6 | 7 | ||
7 | T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightFrequency(int value) | 8 | T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightFrequency(int value) |
8 | { | 9 | { |
9 | //向u3的单片机发送调节频率帧 | 10 | //向u3的单片机发送调节频率帧 |
10 | - JZsdk_Uart_Send_SearchLight_SetFrequency(UART_DEV_2, value); | 11 | + HalSend_type1Send_Set_SearchLightFrequency(UART_DEV_2, value); |
11 | 12 | ||
12 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 13 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
13 | } | 14 | } |
@@ -15,7 +16,7 @@ T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightFrequency(int value) | @@ -15,7 +16,7 @@ T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightFrequency(int value) | ||
15 | T_JZsdkReturnCode SearchLight_V3S_U3_SearchLightControl(int mode) | 16 | T_JZsdkReturnCode SearchLight_V3S_U3_SearchLightControl(int mode) |
16 | { | 17 | { |
17 | //向u3的单片机发送探照灯控制帧 | 18 | //向u3的单片机发送探照灯控制帧 |
18 | - JZsdk_Uart_Send_SearchLight_Control(UART_DEV_2, mode); | 19 | + HalSend_type1Send_SearchLight_Control(UART_DEV_2, mode); |
19 | 20 | ||
20 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 21 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
21 | } | 22 | } |
@@ -23,7 +24,7 @@ T_JZsdkReturnCode SearchLight_V3S_U3_SearchLightControl(int mode) | @@ -23,7 +24,7 @@ T_JZsdkReturnCode SearchLight_V3S_U3_SearchLightControl(int mode) | ||
23 | T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightLumen(int LeftLumen, int RightLumen) | 24 | T_JZsdkReturnCode SearchLight_V3S_U3_Set_SearchLightLumen(int LeftLumen, int RightLumen) |
24 | { | 25 | { |
25 | //向u3的单片机发送探照灯控制帧 | 26 | //向u3的单片机发送探照灯控制帧 |
26 | - JZsdk_Uart_Send_SearchLight_SetLumen(UART_DEV_2, LeftLumen, RightLumen); | 27 | + HalSend_type1Send_SearchLight_SetLumen(UART_DEV_2, LeftLumen, RightLumen); |
27 | 28 | ||
28 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 29 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
29 | } | 30 | } |
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "./WarningLight_V3S_H1T.h" | 2 | #include "./WarningLight_V3S_H1T.h" |
3 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
4 | #include "BaseConfig.h" | 3 | #include "BaseConfig.h" |
5 | 4 | ||
5 | +#include "Hal_Send/HalSend.h" | ||
6 | + | ||
6 | //设置警灯状态 | 7 | //设置警灯状态 |
7 | T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Status(int status, int mode) | 8 | T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Status(int status, int mode) |
8 | { | 9 | { |
9 | //向底座T60s发送警灯状态 | 10 | //向底座T60s发送警灯状态 |
10 | - JZsdk_Uart_Send_Set_WarningLight_Status(UART_DEV_1, status, mode); | 11 | + HalSend_type1Send_Set_WarningLight_Status(UART_DEV_1, status, mode); |
11 | 12 | ||
12 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 13 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
13 | } | 14 | } |
@@ -15,7 +16,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Status(int status, int m | @@ -15,7 +16,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Status(int status, int m | ||
15 | //设置警灯颜色 | 16 | //设置警灯颜色 |
16 | T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Color(int color1, int color2) | 17 | T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Color(int color1, int color2) |
17 | { | 18 | { |
18 | - JZsdk_Uart_Send_Set_WarningLight_Color(UART_DEV_1, color1, color2); | 19 | + HalSend_type1Send_Set_WarningLight_Color(UART_DEV_1, color1, color2); |
19 | 20 | ||
20 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 21 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
21 | } | 22 | } |
@@ -27,7 +28,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Color(int color1, int co | @@ -27,7 +28,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_Set_WarningLight_Color(int color1, int co | ||
27 | **********/ | 28 | **********/ |
28 | T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightStatus() | 29 | T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightStatus() |
29 | { | 30 | { |
30 | - JZsdk_Uart_Send_CheckStatus_WarningLightStatus(UART_DEV_1); | 31 | + HalSend_type1Send_CheckStatus_WarningLightStatus(UART_DEV_1); |
31 | 32 | ||
32 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 33 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
33 | } | 34 | } |
@@ -39,7 +40,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightStatus() | @@ -39,7 +40,7 @@ T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightStatus() | ||
39 | **********/ | 40 | **********/ |
40 | T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightColor() | 41 | T_JZsdkReturnCode WarningLight_V3S_H1T_CheckStatus_WarningLightColor() |
41 | { | 42 | { |
42 | - JZsdk_Uart_Send_CheckStatus_WarningLightColor(UART_DEV_1); | 43 | + HalSend_type1Send_CheckStatus_WarningLightColor(UART_DEV_1); |
43 | 44 | ||
44 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 45 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
45 | } | 46 | } |
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include "./WarningLight_V3S_TFA1.h" | 2 | #include "./WarningLight_V3S_TFA1.h" |
3 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
4 | #include "BaseConfig.h" | 3 | #include "BaseConfig.h" |
5 | 4 | ||
5 | +#include "Hal_Send/HalSend.h" | ||
6 | + | ||
6 | //设置警灯状态 | 7 | //设置警灯状态 |
7 | T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Status(int status, int mode) | 8 | T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Status(int status, int mode) |
8 | { | 9 | { |
9 | //向单片机发送警灯状态 | 10 | //向单片机发送警灯状态 |
10 | - JZsdk_Uart_Send_Set_WarningLight_Status(UART_DEV_2, status, mode); | 11 | + HalSend_type1Send_Set_WarningLight_Status(UART_DEV_2, status, mode); |
11 | 12 | ||
12 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 13 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
13 | } | 14 | } |
@@ -15,7 +16,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Status(int status, int | @@ -15,7 +16,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Status(int status, int | ||
15 | //设置警灯颜色 | 16 | //设置警灯颜色 |
16 | T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Color(int color1, int color2) | 17 | T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Color(int color1, int color2) |
17 | { | 18 | { |
18 | - JZsdk_Uart_Send_Set_WarningLight_Color(UART_DEV_2, color1, color2); | 19 | + HalSend_type1Send_Set_WarningLight_Color(UART_DEV_2, color1, color2); |
19 | 20 | ||
20 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 21 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
21 | } | 22 | } |
@@ -27,7 +28,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Color(int color1, int c | @@ -27,7 +28,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_Set_WarningLight_Color(int color1, int c | ||
27 | **********/ | 28 | **********/ |
28 | T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightStatus() | 29 | T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightStatus() |
29 | { | 30 | { |
30 | - JZsdk_Uart_Send_CheckStatus_WarningLightStatus(UART_DEV_2); | 31 | + HalSend_type1Send_CheckStatus_WarningLightStatus(UART_DEV_2); |
31 | 32 | ||
32 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 33 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
33 | } | 34 | } |
@@ -39,7 +40,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightStatus() | @@ -39,7 +40,7 @@ T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightStatus() | ||
39 | **********/ | 40 | **********/ |
40 | T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightColor() | 41 | T_JZsdkReturnCode WarningLight_V3S_TFA1_CheckStatus_WarningLightColor() |
41 | { | 42 | { |
42 | - JZsdk_Uart_Send_CheckStatus_WarningLightColor(UART_DEV_2); | 43 | + HalSend_type1Send_CheckStatus_WarningLightColor(UART_DEV_2); |
43 | 44 | ||
44 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 45 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
45 | } | 46 | } |
@@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
2 | #include <pthread.h> | 2 | #include <pthread.h> |
3 | 3 | ||
4 | #include "JZsdkLib.h" | 4 | #include "JZsdkLib.h" |
5 | +#include "Hal_Send/HalSend.h" | ||
6 | + | ||
5 | #include "./Megaphone.h" | 7 | #include "./Megaphone.h" |
6 | #include "UI_control/UI_control.h" | 8 | #include "UI_control/UI_control.h" |
7 | #include "AudioDeal/AudioDeal.h" | 9 | #include "AudioDeal/AudioDeal.h" |
@@ -11,9 +13,8 @@ | @@ -11,9 +13,8 @@ | ||
11 | #include "DeviceInfo/DeviceInfo.h" | 13 | #include "DeviceInfo/DeviceInfo.h" |
12 | #include "BaseConfig.h" | 14 | #include "BaseConfig.h" |
13 | 15 | ||
14 | -#include "JZsdk_uart/JZsdk_Uart_Input.h" | ||
15 | #include "UI_control/Psdk_UI_io.h" | 16 | #include "UI_control/Psdk_UI_io.h" |
16 | - | 17 | +#include "JZsdk_Hal.h" |
17 | 18 | ||
18 | #include "Megaphone/MegTempControl/MegTempControl.h" | 19 | #include "Megaphone/MegTempControl/MegTempControl.h" |
19 | #include "./VolumeLimit.h" | 20 | #include "./VolumeLimit.h" |
@@ -1399,19 +1400,19 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag) | @@ -1399,19 +1400,19 @@ T_JZsdkReturnCode Megaphone_PrintVolume(int Value, int flag) | ||
1399 | 1400 | ||
1400 | //通知其他设备的ui界面变化 | 1401 | //通知其他设备的ui界面变化 |
1401 | //如果4G模块有启动 | 1402 | //如果4G模块有启动 |
1402 | - if ( (JZsdk_Get_UartDev_UseFlag(UART_4G) == JZ_FLAGCODE_ON)) | 1403 | + if ( (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON)) |
1403 | { | 1404 | { |
1404 | - JZsdk_Uart_Reply_Volume(UART_4G, g_Megaphone_Volume); | 1405 | + HalSend_type1Send_Reply_Volume(UART_4G, g_Megaphone_Volume); |
1405 | } | 1406 | } |
1406 | //如果设备1有启动 | 1407 | //如果设备1有启动 |
1407 | - if ( (JZsdk_Get_UartDev_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) ) | 1408 | + if ( (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) ) |
1408 | { | 1409 | { |
1409 | - JZsdk_Uart_Reply_Volume(UART_DEV_1, g_Megaphone_Volume); | 1410 | + HalSend_type1Send_Reply_Volume(UART_DEV_1, g_Megaphone_Volume); |
1410 | } | 1411 | } |
1411 | //如果设备2有启动 | 1412 | //如果设备2有启动 |
1412 | - if ( (JZsdk_Get_UartDev_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) ) | 1413 | + if ( (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) ) |
1413 | { | 1414 | { |
1414 | - JZsdk_Uart_Reply_Volume(UART_DEV_2, g_Megaphone_Volume); | 1415 | + HalSend_type1Send_Reply_Volume(UART_DEV_2, g_Megaphone_Volume); |
1415 | } | 1416 | } |
1416 | //如果psdk接口已经使用 | 1417 | //如果psdk接口已经使用 |
1417 | if ( (JZsdk_Get_Psdk_UIcontrol_UseFlag() == JZ_FLAGCODE_ON)) | 1418 | if ( (JZsdk_Get_Psdk_UIcontrol_UseFlag() == JZ_FLAGCODE_ON)) |
@@ -51,17 +51,17 @@ T_JZsdkReturnCode PowerManger_SetPowerStatus(int status) | @@ -51,17 +51,17 @@ T_JZsdkReturnCode PowerManger_SetPowerStatus(int status) | ||
51 | // T_JZsdkReturnCode PowerManger_HeartBeatAsk() | 51 | // T_JZsdkReturnCode PowerManger_HeartBeatAsk() |
52 | // { | 52 | // { |
53 | // //如果4G模块有启动 | 53 | // //如果4G模块有启动 |
54 | -// if (JZsdk_Get_UartDev_UseFlag(UART_4G) == JZ_FLAGCODE_ON) | 54 | +// if (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) |
55 | // { | 55 | // { |
56 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_4G, 0, 1); | 56 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_4G, 0, 1); |
57 | // } | 57 | // } |
58 | // //如果设备1有启动 | 58 | // //如果设备1有启动 |
59 | -// if (JZsdk_Get_UartDev_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) | 59 | +// if (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) |
60 | // { | 60 | // { |
61 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_DEV_1, 0, 1); | 61 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_DEV_1, 0, 1); |
62 | // } | 62 | // } |
63 | // //如果设备2有启动 | 63 | // //如果设备2有启动 |
64 | -// if (JZsdk_Get_UartDev_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) | 64 | +// if (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) |
65 | // { | 65 | // { |
66 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_DEV_2, 0, 1); | 66 | // JZsdk_Uart_SendDeal_Ask_HeartBeatStatus(UART_DEV_2, 0, 1); |
67 | // } | 67 | // } |
@@ -76,17 +76,17 @@ T_JZsdkReturnCode PowerManger_SetPowerStatus(int status) | @@ -76,17 +76,17 @@ T_JZsdkReturnCode PowerManger_SetPowerStatus(int status) | ||
76 | // T_JZsdkReturnCode UI_control_Ask_TimeStamp() | 76 | // T_JZsdkReturnCode UI_control_Ask_TimeStamp() |
77 | // { | 77 | // { |
78 | // //如果4G模块有启动 | 78 | // //如果4G模块有启动 |
79 | -// if (JZsdk_Get_UartDev_UseFlag(UART_4G) == JZ_FLAGCODE_ON) | 79 | +// if (JZsdk_HalPort_UseFlag(UART_4G) == JZ_FLAGCODE_ON) |
80 | // { | 80 | // { |
81 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_4G,0); | 81 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_4G,0); |
82 | // } | 82 | // } |
83 | // //如果设备1有启动 | 83 | // //如果设备1有启动 |
84 | -// if (JZsdk_Get_UartDev_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) | 84 | +// if (JZsdk_HalPort_UseFlag(UART_DEV_1) == JZ_FLAGCODE_ON) |
85 | // { | 85 | // { |
86 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_DEV_1,0); | 86 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_DEV_1,0); |
87 | // } | 87 | // } |
88 | // //如果设备2有启动 | 88 | // //如果设备2有启动 |
89 | -// if (JZsdk_Get_UartDev_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) | 89 | +// if (JZsdk_HalPort_UseFlag(UART_DEV_2) == JZ_FLAGCODE_ON) |
90 | // { | 90 | // { |
91 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_DEV_2,0); | 91 | // JZsdk_Uart_SendDeal_Ask_TimeStamp(UART_DEV_2,0); |
92 | // } | 92 | // } |
@@ -8,6 +8,8 @@ | @@ -8,6 +8,8 @@ | ||
8 | #include "JZsdk_uart/JZsdk_Uart_Input.h" | 8 | #include "JZsdk_uart/JZsdk_Uart_Input.h" |
9 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" | 9 | #include "JZsdk_Base/JZsdk_FrameComparsion/JZsdk_FrameComparsion.h" |
10 | 10 | ||
11 | +#include "Hal_Send/HalSend.h" | ||
12 | + | ||
11 | extern int Connectmode; | 13 | extern int Connectmode; |
12 | 14 | ||
13 | T_JZsdkReturnCode TestMegaphone_Init() | 15 | T_JZsdkReturnCode TestMegaphone_Init() |
@@ -15,7 +17,7 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -15,7 +17,7 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
15 | //1、重复发送连接帧,知道收到连接成功帧 | 17 | //1、重复发送连接帧,知道收到连接成功帧 |
16 | while (Connectmode == 0) | 18 | while (Connectmode == 0) |
17 | { | 19 | { |
18 | - JZsdk_Uart_Send_ConnectFrame(UART_DEV_1); | 20 | + HalSend_type1Send_ConnectFrame(UART_DEV_1); |
19 | 21 | ||
20 | delayMs(100); | 22 | delayMs(100); |
21 | } | 23 | } |
@@ -35,27 +37,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -35,27 +37,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
35 | memset(ControlFrame,0,sizeof(ControlFrame)); | 37 | memset(ControlFrame,0,sizeof(ControlFrame)); |
36 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); | 38 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); |
37 | ControlFrame[9] = 0x20; | 39 | ControlFrame[9] = 0x20; |
38 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 40 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
39 | 41 | ||
40 | //修改音色 为放中文女生 | 42 | //修改音色 为放中文女生 |
41 | memset(ControlFrame,0,sizeof(ControlFrame)); | 43 | memset(ControlFrame,0,sizeof(ControlFrame)); |
42 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); | 44 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); |
43 | ControlFrame[9] = 0x01; | 45 | ControlFrame[9] = 0x01; |
44 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 46 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
45 | 47 | ||
46 | //播放喊话器测试喊话器测试 | 48 | //播放喊话器测试喊话器测试 |
47 | memset(ControlFrame,0,sizeof(ControlFrame)); | 49 | memset(ControlFrame,0,sizeof(ControlFrame)); |
48 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 50 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
49 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 51 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
50 | 52 | ||
51 | memset(ControlFrame,0,sizeof(ControlFrame)); | 53 | memset(ControlFrame,0,sizeof(ControlFrame)); |
52 | memcpy(ControlFrame, "喊话器32音量", sizeof("喊话器32音量")); | 54 | memcpy(ControlFrame, "喊话器32音量", sizeof("喊话器32音量")); |
53 | ControlFrameLen = sizeof("喊话器32音量"); | 55 | ControlFrameLen = sizeof("喊话器32音量"); |
54 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 56 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
55 | 57 | ||
56 | memset(ControlFrame,0,sizeof(ControlFrame)); | 58 | memset(ControlFrame,0,sizeof(ControlFrame)); |
57 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 59 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
58 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 60 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
59 | 61 | ||
60 | delayS(5); | 62 | delayS(5); |
61 | 63 | ||
@@ -63,21 +65,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -63,21 +65,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
63 | memset(ControlFrame,0,sizeof(ControlFrame)); | 65 | memset(ControlFrame,0,sizeof(ControlFrame)); |
64 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); | 66 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); |
65 | ControlFrame[9] = 0x40; | 67 | ControlFrame[9] = 0x40; |
66 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 68 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
67 | 69 | ||
68 | //播放喊话器测试喊话器测试 | 70 | //播放喊话器测试喊话器测试 |
69 | memset(ControlFrame,0,sizeof(ControlFrame)); | 71 | memset(ControlFrame,0,sizeof(ControlFrame)); |
70 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 72 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
71 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 73 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
72 | 74 | ||
73 | memset(ControlFrame,0,sizeof(ControlFrame)); | 75 | memset(ControlFrame,0,sizeof(ControlFrame)); |
74 | memcpy(ControlFrame, "喊话器64音量", sizeof("喊话器64音量")); | 76 | memcpy(ControlFrame, "喊话器64音量", sizeof("喊话器64音量")); |
75 | ControlFrameLen = sizeof("喊话器64音量"); | 77 | ControlFrameLen = sizeof("喊话器64音量"); |
76 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 78 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
77 | 79 | ||
78 | memset(ControlFrame,0,sizeof(ControlFrame)); | 80 | memset(ControlFrame,0,sizeof(ControlFrame)); |
79 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 81 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
80 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 82 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
81 | 83 | ||
82 | delayS(5); | 84 | delayS(5); |
83 | 85 | ||
@@ -85,21 +87,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -85,21 +87,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
85 | memset(ControlFrame,0,sizeof(ControlFrame)); | 87 | memset(ControlFrame,0,sizeof(ControlFrame)); |
86 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); | 88 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); |
87 | ControlFrame[9] = 0x40; | 89 | ControlFrame[9] = 0x40; |
88 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 90 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
89 | 91 | ||
90 | //播放喊话器测试喊话器测试 | 92 | //播放喊话器测试喊话器测试 |
91 | memset(ControlFrame,0,sizeof(ControlFrame)); | 93 | memset(ControlFrame,0,sizeof(ControlFrame)); |
92 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 94 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
93 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 95 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
94 | 96 | ||
95 | memset(ControlFrame,0,sizeof(ControlFrame)); | 97 | memset(ControlFrame,0,sizeof(ControlFrame)); |
96 | memcpy(ControlFrame, "喊话器100音量", sizeof("喊话器100音量")); | 98 | memcpy(ControlFrame, "喊话器100音量", sizeof("喊话器100音量")); |
97 | ControlFrameLen = sizeof("喊话器100音量"); | 99 | ControlFrameLen = sizeof("喊话器100音量"); |
98 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 100 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
99 | 101 | ||
100 | memset(ControlFrame,0,sizeof(ControlFrame)); | 102 | memset(ControlFrame,0,sizeof(ControlFrame)); |
101 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 103 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
102 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 104 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
103 | 105 | ||
104 | delayS(5); | 106 | delayS(5); |
105 | 107 | ||
@@ -107,38 +109,38 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -107,38 +109,38 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
107 | memset(ControlFrame,0,sizeof(ControlFrame)); | 109 | memset(ControlFrame,0,sizeof(ControlFrame)); |
108 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); | 110 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); |
109 | ControlFrame[9] = 0x64; | 111 | ControlFrame[9] = 0x64; |
110 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 112 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
111 | 113 | ||
112 | //播放喊话器测试喊话器测试 | 114 | //播放喊话器测试喊话器测试 |
113 | memset(ControlFrame,0,sizeof(ControlFrame)); | 115 | memset(ControlFrame,0,sizeof(ControlFrame)); |
114 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 116 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
115 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 117 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
116 | 118 | ||
117 | memset(ControlFrame,0,sizeof(ControlFrame)); | 119 | memset(ControlFrame,0,sizeof(ControlFrame)); |
118 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); | 120 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); |
119 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); | 121 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); |
120 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 122 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
121 | 123 | ||
122 | memset(ControlFrame,0,sizeof(ControlFrame)); | 124 | memset(ControlFrame,0,sizeof(ControlFrame)); |
123 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 125 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
124 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 126 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
125 | 127 | ||
126 | delayS(7); | 128 | delayS(7); |
127 | 129 | ||
128 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | ||
129 | - //播放喊话器测试喊话器测试 | 130 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 1); |
131 | +0 //播放喊话器测试喊话器测试 | ||
130 | memset(ControlFrame,0,sizeof(ControlFrame)); | 132 | memset(ControlFrame,0,sizeof(ControlFrame)); |
131 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 133 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
132 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 134 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
133 | 135 | ||
134 | memset(ControlFrame,0,sizeof(ControlFrame)); | 136 | memset(ControlFrame,0,sizeof(ControlFrame)); |
135 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); | 137 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); |
136 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); | 138 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); |
137 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 139 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
138 | 140 | ||
139 | memset(ControlFrame,0,sizeof(ControlFrame)); | 141 | memset(ControlFrame,0,sizeof(ControlFrame)); |
140 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 142 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
141 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 143 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
142 | 144 | ||
143 | delayS(7); | 145 | delayS(7); |
144 | 146 | ||
@@ -152,27 +154,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -152,27 +154,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
152 | memset(ControlFrame,0,sizeof(ControlFrame)); | 154 | memset(ControlFrame,0,sizeof(ControlFrame)); |
153 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); | 155 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_VOLUME ,ControlFrame, &ControlFrameLen); |
154 | ControlFrame[9] = 0x64; | 156 | ControlFrame[9] = 0x64; |
155 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 157 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
156 | 158 | ||
157 | //修改音色 为放中文女生 | 159 | //修改音色 为放中文女生 |
158 | memset(ControlFrame,0,sizeof(ControlFrame)); | 160 | memset(ControlFrame,0,sizeof(ControlFrame)); |
159 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); | 161 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); |
160 | ControlFrame[9] = 0x01; | 162 | ControlFrame[9] = 0x01; |
161 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 163 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
162 | 164 | ||
163 | //播放喊话器测试喊话器测试 | 165 | //播放喊话器测试喊话器测试 |
164 | memset(ControlFrame,0,sizeof(ControlFrame)); | 166 | memset(ControlFrame,0,sizeof(ControlFrame)); |
165 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 167 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
166 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 168 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
167 | 169 | ||
168 | memset(ControlFrame,0,sizeof(ControlFrame)); | 170 | memset(ControlFrame,0,sizeof(ControlFrame)); |
169 | memcpy(ControlFrame, "中文音色测试", sizeof("中文音色测试")); | 171 | memcpy(ControlFrame, "中文音色测试", sizeof("中文音色测试")); |
170 | ControlFrameLen = sizeof("中文音色测试"); | 172 | ControlFrameLen = sizeof("中文音色测试"); |
171 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 173 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
172 | 174 | ||
173 | memset(ControlFrame,0,sizeof(ControlFrame)); | 175 | memset(ControlFrame,0,sizeof(ControlFrame)); |
174 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 176 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
175 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 177 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
176 | 178 | ||
177 | delayS(5); | 179 | delayS(5); |
178 | 180 | ||
@@ -186,21 +188,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -186,21 +188,21 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
186 | memset(ControlFrame,0,sizeof(ControlFrame)); | 188 | memset(ControlFrame,0,sizeof(ControlFrame)); |
187 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); | 189 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); |
188 | ControlFrame[9] = 0x36; | 190 | ControlFrame[9] = 0x36; |
189 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 191 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
190 | 192 | ||
191 | //播放喊话器测试喊话器测试 | 193 | //播放喊话器测试喊话器测试 |
192 | memset(ControlFrame,0,sizeof(ControlFrame)); | 194 | memset(ControlFrame,0,sizeof(ControlFrame)); |
193 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 195 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
194 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 196 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
195 | 197 | ||
196 | memset(ControlFrame,0,sizeof(ControlFrame)); | 198 | memset(ControlFrame,0,sizeof(ControlFrame)); |
197 | memcpy(ControlFrame, "广东话音色测试", sizeof("广东话音色测试")); | 199 | memcpy(ControlFrame, "广东话音色测试", sizeof("广东话音色测试")); |
198 | ControlFrameLen = sizeof("广东话音色测试"); | 200 | ControlFrameLen = sizeof("广东话音色测试"); |
199 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 201 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
200 | 202 | ||
201 | memset(ControlFrame,0,sizeof(ControlFrame)); | 203 | memset(ControlFrame,0,sizeof(ControlFrame)); |
202 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 204 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
203 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 205 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
204 | 206 | ||
205 | delayS(5); | 207 | delayS(5); |
206 | 208 | ||
@@ -214,12 +216,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -214,12 +216,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
214 | memset(ControlFrame,0,sizeof(ControlFrame)); | 216 | memset(ControlFrame,0,sizeof(ControlFrame)); |
215 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 217 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
216 | ControlFrame[9] = 0x01; | 218 | ControlFrame[9] = 0x01; |
217 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 219 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
218 | 220 | ||
219 | //下一曲音乐播放 | 221 | //下一曲音乐播放 |
220 | memset(ControlFrame,0,sizeof(ControlFrame)); | 222 | memset(ControlFrame,0,sizeof(ControlFrame)); |
221 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_NEXTSONG ,ControlFrame, &ControlFrameLen); | 223 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_NEXTSONG ,ControlFrame, &ControlFrameLen); |
222 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 224 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
223 | 225 | ||
224 | //循环播放5分钟 | 226 | //循环播放5分钟 |
225 | delayS(300); | 227 | delayS(300); |
@@ -228,12 +230,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -228,12 +230,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
228 | memset(ControlFrame,0,sizeof(ControlFrame)); | 230 | memset(ControlFrame,0,sizeof(ControlFrame)); |
229 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 231 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
230 | ControlFrame[9] = 0x00; | 232 | ControlFrame[9] = 0x00; |
231 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 233 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
232 | 234 | ||
233 | //关闭播放 | 235 | //关闭播放 |
234 | memset(ControlFrame,0,sizeof(ControlFrame)); | 236 | memset(ControlFrame,0,sizeof(ControlFrame)); |
235 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); | 237 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); |
236 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 238 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
237 | 239 | ||
238 | delayS(5); | 240 | delayS(5); |
239 | 241 | ||
@@ -241,27 +243,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -241,27 +243,27 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
241 | memset(ControlFrame,0,sizeof(ControlFrame)); | 243 | memset(ControlFrame,0,sizeof(ControlFrame)); |
242 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 244 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
243 | ControlFrame[9] = 0x01; | 245 | ControlFrame[9] = 0x01; |
244 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 246 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
245 | 247 | ||
246 | //修改音色 为放中文女生 | 248 | //修改音色 为放中文女生 |
247 | memset(ControlFrame,0,sizeof(ControlFrame)); | 249 | memset(ControlFrame,0,sizeof(ControlFrame)); |
248 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); | 250 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_SET_TONE ,ControlFrame, &ControlFrameLen); |
249 | ControlFrame[9] = 0x01; | 251 | ControlFrame[9] = 0x01; |
250 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 252 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
251 | 253 | ||
252 | //播放喊话器测试喊话器测试 | 254 | //播放喊话器测试喊话器测试 |
253 | memset(ControlFrame,0,sizeof(ControlFrame)); | 255 | memset(ControlFrame,0,sizeof(ControlFrame)); |
254 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 256 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
255 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 257 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
256 | 258 | ||
257 | memset(ControlFrame,0,sizeof(ControlFrame)); | 259 | memset(ControlFrame,0,sizeof(ControlFrame)); |
258 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); | 260 | memcpy(ControlFrame, "喊话器测试,喊话器测试", sizeof("喊话器测试,喊话器测试")); |
259 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); | 261 | ControlFrameLen = sizeof("喊话器测试,喊话器测试"); |
260 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 262 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
261 | 263 | ||
262 | memset(ControlFrame,0,sizeof(ControlFrame)); | 264 | memset(ControlFrame,0,sizeof(ControlFrame)); |
263 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 265 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
264 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 266 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
265 | 267 | ||
266 | //循环播放3分钟 | 268 | //循环播放3分钟 |
267 | delayS(180); | 269 | delayS(180); |
@@ -270,12 +272,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -270,12 +272,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
270 | memset(ControlFrame,0,sizeof(ControlFrame)); | 272 | memset(ControlFrame,0,sizeof(ControlFrame)); |
271 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 273 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
272 | ControlFrame[9] = 0x00; | 274 | ControlFrame[9] = 0x00; |
273 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 275 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
274 | 276 | ||
275 | //关闭播放 | 277 | //关闭播放 |
276 | memset(ControlFrame,0,sizeof(ControlFrame)); | 278 | memset(ControlFrame,0,sizeof(ControlFrame)); |
277 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); | 279 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); |
278 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 280 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
279 | 281 | ||
280 | delayS(5); | 282 | delayS(5); |
281 | 283 | ||
@@ -289,12 +291,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -289,12 +291,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
289 | memset(ControlFrame,0,sizeof(ControlFrame)); | 291 | memset(ControlFrame,0,sizeof(ControlFrame)); |
290 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 292 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
291 | ControlFrame[9] = 0x01; | 293 | ControlFrame[9] = 0x01; |
292 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 294 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
293 | 295 | ||
294 | //上一曲音乐播放 | 296 | //上一曲音乐播放 |
295 | memset(ControlFrame,0,sizeof(ControlFrame)); | 297 | memset(ControlFrame,0,sizeof(ControlFrame)); |
296 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_LASTSONG ,ControlFrame, &ControlFrameLen); | 298 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_LASTSONG ,ControlFrame, &ControlFrameLen); |
297 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 299 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
298 | 300 | ||
299 | //循环播放5分钟 | 301 | //循环播放5分钟 |
300 | delayS(300); | 302 | delayS(300); |
@@ -303,12 +305,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -303,12 +305,12 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
303 | memset(ControlFrame,0,sizeof(ControlFrame)); | 305 | memset(ControlFrame,0,sizeof(ControlFrame)); |
304 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); | 306 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_PLAY_LOOP ,ControlFrame, &ControlFrameLen); |
305 | ControlFrame[9] = 0x00; | 307 | ControlFrame[9] = 0x00; |
306 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 308 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
307 | 309 | ||
308 | //关闭播放 | 310 | //关闭播放 |
309 | memset(ControlFrame,0,sizeof(ControlFrame)); | 311 | memset(ControlFrame,0,sizeof(ControlFrame)); |
310 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); | 312 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_AUDIO_STOP ,ControlFrame, &ControlFrameLen); |
311 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 313 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
312 | 314 | ||
313 | 315 | ||
314 | /*********************************************************************************************************************************** | 316 | /*********************************************************************************************************************************** |
@@ -319,14 +321,14 @@ T_JZsdkReturnCode TestMegaphone_Init() | @@ -319,14 +321,14 @@ T_JZsdkReturnCode TestMegaphone_Init() | ||
319 | 321 | ||
320 | memset(ControlFrame,0,sizeof(ControlFrame)); | 322 | memset(ControlFrame,0,sizeof(ControlFrame)); |
321 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); | 323 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_START ,ControlFrame, &ControlFrameLen); |
322 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 324 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
323 | 325 | ||
324 | memset(ControlFrame,0,sizeof(ControlFrame)); | 326 | memset(ControlFrame,0,sizeof(ControlFrame)); |
325 | memcpy(ControlFrame, "测试完成,测试完成", sizeof("测试完成,测试完成")); | 327 | memcpy(ControlFrame, "测试完成,测试完成", sizeof("测试完成,测试完成")); |
326 | ControlFrameLen = sizeof("测试完成,测试完成"); | 328 | ControlFrameLen = sizeof("测试完成,测试完成"); |
327 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 329 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 0); |
328 | 330 | ||
329 | memset(ControlFrame,0,sizeof(ControlFrame)); | 331 | memset(ControlFrame,0,sizeof(ControlFrame)); |
330 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); | 332 | JZsdk_GetFrameTemplate(JZ_INSCODE_5AFRAME_TTS_TRANS_STOP ,ControlFrame, &ControlFrameLen); |
331 | - JZsdk_Uart_Send_CustomOrder(UART_DEV_1, ControlFrame, ControlFrameLen); | 333 | + HalSend_SendData(UART_DEV_1, ControlFrame, ControlFrameLen, 10; |
332 | } | 334 | } |
-
请 注册 或 登录 后发表评论