yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | /**************************************************************************
|
| 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
|
| 42 | typedef struct
|
| 43 | {
|
| 44 | UINT8 set[(FD_SET_SIZE + 8 - 1) / 8];
|
| 45 | } fd_set;
|
| 46 | struct timeval
|
| 47 | {
|
| 48 | UINT32 tv_sec; /* seconds */
|
| 49 | UINT32 tv_usec; /* microseconds */
|
| 50 | };
|
| 51 |
|
| 52 | #define FD_SET(fd, fdset) \
|
| 53 | true
|
| 54 | #define FD_ZERO(fdset) memset(fdset, 0, sizeof(fd_set))
|
| 55 |
|
| 56 | #define FD_ISSET(fd, fdset) \
|
| 57 | true
|
| 58 |
|
| 59 | #endif
|
| 60 | typedef 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
|
| 74 | int zCc_CleanCCMSG(void);
|
| 75 | int zCcApp_GetAtCmdFd(void);
|
| 76 | int zCcApp_PortRecv(int fdcom, CHAR *data, int datalen);
|
| 77 | int zCcApp_PortSend(int fdcom, CHAR *data, int datalen);
|
| 78 | int zCcApp_StartComm(void);
|
| 79 | int zCcApp_StartComm(void);
|
| 80 | int zCcApp_PortOpen(char* DevName);
|
| 81 | int zCcApp_GetAtIndFd(void);
|
| 82 | int zCcApp_GetAtCCFd(void);
|
| 83 | #endif
|
| 84 |
|
| 85 | #endif
|