lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /**************************************************************************
|
| 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 | **************************************************************************/
|
| 50 | typedef VOID (*pCcSlaveFsmFunc)(UINT8);
|
| 51 |
|
| 52 | #define SC_LEN 29
|
| 53 | #define SC_MAXLEN (SC_LEN-1) // ǰתºÅÂ볤¶È×î´óΪ SC_MAXLEN -5
|
| 54 | typedef struct
|
| 55 | {
|
| 56 | UINT8 scName;
|
| 57 | UINT8 scMinLen; //ÆÚÍûµÄ²¹³äÒµÎñ²Ù×÷Âë×îС³¤¶È
|
| 58 | UINT8 scMaxLen; //ÆÚÍûµÄ²¹³äÒµÎñ²Ù×÷Âë×î´ó³¤¶È
|
| 59 | char sc[SC_LEN];
|
| 60 | }T_zCc_ScTab;
|
| 61 | typedef 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. */
|
| 87 | typedef 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 |
|
| 123 | typedef SINT32 (*zCcApp_RecvAtIndFun)(MSG_BUF *ptMsgBuf);
|
| 124 | typedef SINT32 (*zCcApp_AtIndProcFun)(MSG_BUF *ptMsgBuf);
|
| 125 | typedef struct
|
| 126 | {
|
| 127 | int AtIndCmd;
|
| 128 | zCcApp_RecvAtIndFun RecvAtIndProcFun;
|
| 129 | }T_CC_APP_RecvAtIndItem;
|
| 130 |
|
| 131 | SINT32 zCc_DsciIndProc(MSG_BUF *ptMsgBuf);
|
| 132 | //SINT32 zCc_CendIndProc(MSG_BUF *ptMsgBuf);
|
| 133 | SINT32 zCc_ZcpiIndProc(MSG_BUF *ptMsgBuf);
|
| 134 | SINT32 zCc_ZimsplusProc(MSG_BUF *ptMsgBuf);
|
| 135 | SINT32 zCc_ZvoicechnlProc(MSG_BUF *ptMsgBuf);
|
| 136 |
|
| 137 |
|
| 138 | typedef struct
|
| 139 | {
|
| 140 | ULONG cmdId;
|
| 141 | zCcApp_AtIndProcFun AtIndProcFun;
|
| 142 | }T_CC_APP_AtIndProcItem;
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 | extern char g_zCcApp_AtIndBuf[ZCC_APP_AT_BUF_MAX_LEN+1];
|
| 147 | SINT32 zCcApp_AtIndProc(char* AtBuff, SINT32 AtLen);
|
| 148 | VOID zCc_SendAtDialReq(PSTR pAtCmdPara);
|
| 149 | VOID zCc_SendAtDtmfReq(char* dtmfchar);
|
| 150 | SINT32 zCc_SendAtChldReq(int chldtype);
|
| 151 | VOID zCc_SendAtAnswerReq(VOID);
|
| 152 | VOID zCc_SendAtHangupReq(VOID);
|
| 153 | SINT32 zCc_RecvDsciInd(MSG_BUF *ptMsgBuf);
|
| 154 | SINT32 zCc_RecvZcpiInd(MSG_BUF *ptMsgBuf);
|
| 155 | SINT32 zCc_RecvImsplusInd(MSG_BUF *ptMsgBuf);
|
| 156 | SINT32 zCc_RecvZvoiceChnl(MSG_BUF *ptMsgBuf);
|
| 157 | VOID zCc_DigitsMatchRltProc(UINT8 ret);
|
| 158 | UINT8 zCc_DigitsMatch(VOID);
|
| 159 | VOID zCc_ClearDigits(VOID);
|
| 160 | VOID zCc_InitSlaveObj(UINT8 slave);
|
| 161 | VOID zCc_SIdleState(UINT8 slave);
|
| 162 | VOID zCc_SDtState(UINT8 slave);
|
| 163 | VOID zCc_SDaccmState(UINT8 slave);
|
| 164 | VOID zCc_SDialingState(UINT8 slave);
|
| 165 | VOID zCc_SRingbackState(UINT8 slave);
|
| 166 | VOID zCc_STalkingState(UINT8 slave);
|
| 167 | VOID zCc_SWaitResourceState(UINT8 slave);
|
| 168 | VOID zCc_STryingState(UINT8 slave);
|
| 169 | VOID zCc_SBsyToneState(UINT8 slave);
|
| 170 | VOID zCc_STkytState(UINT8 slave);
|
| 171 | VOID zCc_SSilState(UINT8 slave);
|
| 172 | VOID zCcApp_Dial(char *ptMsgBuf);
|
| 173 | SINT32 zCcApp_Answer(VOID);
|
| 174 | SINT32 zCcApp_Chup(VOID);
|
| 175 | SINT32 zCcApp_Vts(char* dtmfchar);
|
| 176 | SINT32 zCcApp_Chld(int chldtype);
|
| 177 | UINT8 zCc_CallCount(VOID);
|
| 178 | void zCcApp_SetAtChnlCmdId(E_CC_APP_AtReqCmdId AtCmdId);
|
| 179 | VOID zCc_RunSlave(UINT8 slave);
|
| 180 | VOID zCc_RunMaster(MSG_BUF *ptMsgBuf);
|
| 181 | SINT32 zCcApp_Ccfc(T_zCcapp_CcfcReq *ptccfcreq);
|
| 182 | SINT32 zCcApp_Clck(T_zCcapp_ClckReq *ptclckreq);
|
| 183 | SINT32 zCcApp_SetImsPlus(int rate, int setfg);
|
| 184 | SINT32 zCcApp_AtIndRspProc(MSG_BUF *ptMsgBuf);
|
| 185 | SINT32 zCc_RecvRsp(MSG_BUF *ptMsgBuf);
|
| 186 | LONG zCcApp_send_message(unsigned short Msg_cmd,unsigned short us_DataLen,unsigned char *pData);
|
| 187 | VOID zCc_SendAtImsPlusReq(int rate, int setfg);
|
| 188 |
|
| 189 | VOID zCc_CheckSlaveState(const char *tips);
|
| 190 | VOID zCc_ShowAllSlave(VOID);
|
| 191 | void zCcApp_Vts_CleanReq(void);
|
| 192 | void zCcApp_Vts_Rsp(void);
|
| 193 |
|
| 194 | #endif
|