blob: 85118327055426e151e992f96cb25bc6c17f9dc6 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/**************************************************************************
2*
3* Copyright (c) 2013 ZTE Corporation.
4*
5***************************************************************************
6* Ä£ ¿é Ãû : cc
7* ÎÄ ¼þ Ãû : cc_com.h
8* Ïà¹ØÎļþ :
9* ʵÏÖ¹¦ÄÜ : ccÄ£¿é¹«¹²ºê¡¢ÀàÐͶ¨Òå
10* ×÷ Õß :
11* °æ ±¾ :
12* Íê³ÉÈÕÆÚ :
13* ÆäËü˵Ã÷ :
14**************************************************************************/
15
16/**************************************************************************
17* Ð޸ļǼ :
18***************************************************************************/
19/**************************************************************************
20* Ð޸ıàºÅ :
21* ÐÞ ¸Ä ÈË :
22* ÐÞ¸ÄÈÕÆÚ :
23* ÐÞ¸ÄÄÚÈÝ :
24**************************************************************************/
25#ifndef _cc_com_h_
26#define _cc_com_h_
27
28#include <sys/types.h>
29#include "os_type_def.h"
30
31
32#define _USE_PRINTF
33#ifdef _USE_PRINTF
34 #define Z_PRINTF(X) zOss_Printf X
35#else
36 #define Z_PRINTF(X)
37#endif
38
39#define FD_SET_SIZE 10
40
41#ifdef TEST_CCAPP
42typedef struct
43{
44 UINT8 set[(FD_SET_SIZE + 8 - 1) / 8];
45} fd_set;
46struct timeval
47{
48 UINT32 tv_sec; /* seconds */
49 UINT32 tv_usec; /* microseconds */
50};
51
52#define FD_SET(fd, fdset) \
53true
54#define FD_ZERO(fdset) memset(fdset, 0, sizeof(fd_set))
55
56#define FD_ISSET(fd, fdset) \
57true
58
59#endif
60typedef struct
61{
62 CHAR prompt; //prompt after reciving data
63 int baudrate; //baudrate
64 CHAR databit; //data bits, 5, 6, 7, 8
65 CHAR debug; //debug mode, 0: none, 1: debug
66 CHAR echo; //echo mode, 0: none, 1: echo
67 CHAR fctl; //flow control, 0: none, 1: hardware, 2: software
68 CHAR tty; //tty: 0, 1, 2, 3, 4, 5, 6, 7
69 CHAR parity; //parity 0: none, 1: odd, 2: even
70 CHAR stopbit; //stop bits, 1, 2
71 int reserved; //reserved, must be zero
72}T_CC_APP_Portinfo;
73#ifndef TEST_CCAPP
74int zCc_CleanCCMSG(void);
75int zCcApp_GetAtCmdFd(void);
76int zCcApp_PortRecv(int fdcom, CHAR *data, int datalen);
77int zCcApp_PortSend(int fdcom, CHAR *data, int datalen);
78int zCcApp_StartComm(void);
79int zCcApp_StartComm(void);
80int zCcApp_PortOpen(char* DevName);
81int zCcApp_GetAtIndFd(void);
82int zCcApp_GetAtCCFd(void);
83#endif
84
85#endif