blob: bc29aa21fcb644f195c2ae6c15278069951a76e8 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**************************************************************************
2*
3* Copyright (c) 2013 ZTE Corporation.
4*
5***************************************************************************
6* Ä£ ¿é Ãû : cc
7* ÎÄ ¼þ Ãû : cc_proc.h
8* Ïà¹ØÎļþ :
9* ʵÏÖ¹¦ÄÜ :ccÃüÁî·¢Ëͺͽá¹û´¦ÀíÄ£¿éºê¡¢ÀàÐͶ¨Òå
10* ×÷ Õß :
11* °æ ±¾ :
12* Íê³ÉÈÕÆÚ :
13* ÆäËü˵Ã÷ :
14**************************************************************************/
15
16/**************************************************************************
17* Ð޸ļǼ :
18***************************************************************************/
19/**************************************************************************
20* Ð޸ıàºÅ : 0001
21* ÐÞ ¸Ä ÈË :
22* ÐÞ¸ÄÈÕÆÚ :
23* ÐÞ¸ÄÄÚÈÝ :
24**************************************************************************/
25#ifndef _CC_PROC_H
26#define _CC_PROC_H
27
28/**************************************************************************
29* #includeÇø
30**************************************************************************/
31//#include "Drvs_voiceprocess.h"
32#include "stdio.h"
33#include "at_msg.h"
34#include "os_type_def.h"
35#include "at_other_api.h"
36/**************************************************************************
37* ³£Á¿¶¨ÒåÇø
38**************************************************************************/
39#define ZAT_TAB_REPLACE ((unsigned char )(0xFC)) /* ÖÆ±í·ûÌæ»»·û */
40#define ZAT_NULL_FILL ((unsigned char )(0xFD)) /* ¿Õ´®Õ¼Î»·û */
41#define ZAT_SPACE_REPLACE ((unsigned char )(0xFE)) /* ¿Õ¸ñÌæ»»·û */
42
43#define ZCC_APP_AT_BUF_MAX_LEN 400
44#define ZCC_APP_AT_BUF_WAIT_TIME 300
45#define ZCC_MSG_DATA_MAXLEN 640
46
47/**************************************************************************
48* Êý¾Ý½á¹¹¶¨ÒåÇø
49**************************************************************************/
50typedef VOID (*pCcSlaveFsmFunc)(UINT8);
51
52#define SC_LEN 29
53#define SC_MAXLEN (SC_LEN-1) // ǰתºÅÂ볤¶È×î´óΪ SC_MAXLEN -5
54typedef struct
55{
56 UINT8 scName;
57 UINT8 scMinLen; //ÆÚÍûµÄ²¹³äÒµÎñ²Ù×÷Âë×îС³¤¶È
58 UINT8 scMaxLen; //ÆÚÍûµÄ²¹³äÒµÎñ²Ù×÷Âë×î´ó³¤¶È
59 char sc[SC_LEN];
60}T_zCc_ScTab;
61typedef enum
62{
63 CC_APP_AT_CMD_NONE,
64
65 CC_APP_AT_CMD_REQ_D,
66 CC_APP_AT_CMD_REQ_A,
67 CC_APP_AT_CMD_REQ_CHUP,
68 CC_APP_AT_CMD_REQ_ZLEDVOLTE,
69
70 CC_APP_AT_CMD_REQ_VTS,
71 CC_APP_AT_CMD_REQ_CMUT,
72 CC_APP_AT_CMD_REQ_CLVL,
73 CC_APP_AT_CMD_REQ_VOICELOOP,
74 CC_APP_AT_CMD_REQ_IMSPLUS,
75
76 CC_APP_AT_CMD_REQ_SET_CHLD,
77 CC_APP_AT_CMD_REQ_SET_CCFC,
78 CC_APP_AT_CMD_REQ_SET_CCWA,
79 CC_APP_AT_CMD_REQ_SET_CLCK,
80 CC_APP_AT_CMD_REQ_GET_CCFC,
81 CC_APP_AT_CMD_REQ_GET_CCWA,
82 CC_APP_AT_CMD_REQ_SET_CPWD,
83
84 CC_APP_AT_CMD_REQ_GET_CLCC,
85}E_CC_APP_AtReqCmdId;
86/* Define known events. Events are received from vTSP and SIP. */
87typedef enum {
88 ZCC_NO_E = 0,
89 //ZCC_RESET_E = 1,
90 ZCC_DTMF_E = 1,
91 //ZCC_DTMFLE_E = 2,
92 //ZCC_DTMFTE_E = 3,
93 ZCC_DIAL_E = 4,
94 ZCC_CNCT_E = 5,
95 ZCC_DISCN_E = 6,
96 ZCC_BSY_E = 7,
97 ZCC_MATCH_E = 8,
98 ZCC_TIMER_E = 16,
99
100 ZCC_SEIZE_E = 20,
101 ZCC_RELEASE_E = 21,
102 ZCC_FLASH_E = 22,
103
104 ZCC_CIDCW_E = 29,
105 ZCC_SINVITE_E = 42,
106 ZCC_SDISCN_MO_E = 43,
107 ZCC_SANS_E = 44,
108 ZCC_SRING_E = 45,
109 ZCC_SDIALLING_E = 46,
110 ZCC_BUSYTONETIMER_E = 47,
111 ZCC_HOOKOFFTIMER_E = 48,
112 ZCC_SSDIALTONETIMER_E = 49,
113 ZCC_DTMFTIMER_E = 50,
114 ZCC_TKYTIMER_E = 51,
115 ZCC_SDISCN_MT_E = 52,
116 ZCC_SDIAL_ERR_E = 53,
117 ZCC_HOOKOFF_IDLE_TIMER_E = 54,
118 ZCC_RESOURCE_READY_E = 115,
119 ZCC_ASSIST_MSG_E = 128
120} T_zCc_Event;/* ÏûÏ¢½á¹¹Ìå */
121
122
123typedef SINT32 (*zCcApp_RecvAtIndFun)(MSG_BUF *ptMsgBuf);
124typedef SINT32 (*zCcApp_AtIndProcFun)(MSG_BUF *ptMsgBuf);
125typedef struct
126{
127 int AtIndCmd;
128 zCcApp_RecvAtIndFun RecvAtIndProcFun;
129}T_CC_APP_RecvAtIndItem;
130
131SINT32 zCc_DsciIndProc(MSG_BUF *ptMsgBuf);
132//SINT32 zCc_CendIndProc(MSG_BUF *ptMsgBuf);
133SINT32 zCc_ZcpiIndProc(MSG_BUF *ptMsgBuf);
134SINT32 zCc_ZimsplusProc(MSG_BUF *ptMsgBuf);
135SINT32 zCc_ZvoicechnlProc(MSG_BUF *ptMsgBuf);
136
137
138typedef struct
139{
140 ULONG cmdId;
141 zCcApp_AtIndProcFun AtIndProcFun;
142}T_CC_APP_AtIndProcItem;
143
144
145
146extern char g_zCcApp_AtIndBuf[ZCC_APP_AT_BUF_MAX_LEN+1];
147SINT32 zCcApp_AtIndProc(char* AtBuff, SINT32 AtLen);
148VOID zCc_SendAtDialReq(PSTR pAtCmdPara);
149VOID zCc_SendAtDtmfReq(char* dtmfchar);
150SINT32 zCc_SendAtChldReq(int chldtype);
151VOID zCc_SendAtAnswerReq(VOID);
152VOID zCc_SendAtHangupReq(VOID);
153SINT32 zCc_RecvDsciInd(MSG_BUF *ptMsgBuf);
154SINT32 zCc_RecvZcpiInd(MSG_BUF *ptMsgBuf);
155SINT32 zCc_RecvImsplusInd(MSG_BUF *ptMsgBuf);
156SINT32 zCc_RecvZvoiceChnl(MSG_BUF *ptMsgBuf);
157VOID zCc_DigitsMatchRltProc(UINT8 ret);
158UINT8 zCc_DigitsMatch(VOID);
159VOID zCc_ClearDigits(VOID);
160VOID zCc_InitSlaveObj(UINT8 slave);
161VOID zCc_SIdleState(UINT8 slave);
162VOID zCc_SDtState(UINT8 slave);
163VOID zCc_SDaccmState(UINT8 slave);
164VOID zCc_SDialingState(UINT8 slave);
165VOID zCc_SRingbackState(UINT8 slave);
166VOID zCc_STalkingState(UINT8 slave);
167VOID zCc_SWaitResourceState(UINT8 slave);
168VOID zCc_STryingState(UINT8 slave);
169VOID zCc_SBsyToneState(UINT8 slave);
170VOID zCc_STkytState(UINT8 slave);
171VOID zCc_SSilState(UINT8 slave);
172VOID zCcApp_Dial(char *ptMsgBuf);
173SINT32 zCcApp_Answer(VOID);
174SINT32 zCcApp_Chup(VOID);
175SINT32 zCcApp_Vts(char* dtmfchar);
176SINT32 zCcApp_Chld(int chldtype);
177UINT8 zCc_CallCount(VOID);
178void zCcApp_SetAtChnlCmdId(E_CC_APP_AtReqCmdId AtCmdId);
179VOID zCc_RunSlave(UINT8 slave);
180VOID zCc_RunMaster(MSG_BUF *ptMsgBuf);
181SINT32 zCcApp_Ccfc(T_zCcapp_CcfcReq *ptccfcreq);
182SINT32 zCcApp_Clck(T_zCcapp_ClckReq *ptclckreq);
183SINT32 zCcApp_SetImsPlus(int rate, int setfg);
184SINT32 zCcApp_AtIndRspProc(MSG_BUF *ptMsgBuf);
185SINT32 zCc_RecvRsp(MSG_BUF *ptMsgBuf);
186LONG zCcApp_send_message(unsigned short Msg_cmd,unsigned short us_DataLen,unsigned char *pData);
187VOID zCc_SendAtImsPlusReq(int rate, int setfg);
188
189VOID zCc_CheckSlaveState(const char *tips);
190VOID zCc_ShowAllSlave(VOID);
191void zCcApp_Vts_CleanReq(void);
192void zCcApp_Vts_Rsp(void);
193
194#endif