lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /**************************************************************************
|
| 2 | *
|
| 3 | * Protocol Stack Adapter Layer Telephone Interface
|
| 4 | *
|
| 5 | * Copyright (c) 2011 ZTE Corporation.
|
| 6 | *
|
| 7 | ***************************************************************************
|
| 8 | *
|
| 9 | * °æ±¾ËùÓÐ : ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾ ÊÖ»úÊÂÒµ²¿
|
| 10 | * Ä£ ¿é Ãû : PSI
|
| 11 | * ÎÄ ¼þ Ãû : zpsi_api.h
|
| 12 | * Îļþ±êʶ :
|
| 13 | * Ïà¹ØÎļþ :
|
| 14 | * ʵÏÖ¹¦ÄÜ : PSI×Óϵͳ¶Ôƽ̨ӦÓýӿÚ
|
| 15 | * ×÷ Õß :
|
| 16 | * °æ ±¾ :
|
| 17 | * Íê³ÉÈÕÆÚ : 2011.04.06
|
| 18 | * ÆäËü˵Ã÷ :
|
| 19 | **************************************************************************/
|
| 20 | #ifndef ZPSI_API_H
|
| 21 | #define ZPSI_API_H
|
| 22 |
|
| 23 | #define ZATI2_SM_IPV4_PDPADDR_LEN 4
|
| 24 | #define ZATI2_SM_IPV6_PDPADDR_LEN 16
|
| 25 |
|
| 26 | #define ZATI2_SM_MAX_PDPADDR_LEN (ZATI2_SM_IPV4_PDPADDR_LEN + ZATI2_SM_IPV6_PDPADDR_LEN)
|
| 27 |
|
| 28 | /* ½á¹¹Ì嶨Òå */
|
| 29 | typedef struct {
|
| 30 | UINT8 iCid;
|
| 31 | UINT8 iPdpType; /*
|
| 32 | * 0x01-PPP
|
| 33 | * 0x21-IPv4
|
| 34 | * 0x57-IPv6
|
| 35 | */
|
| 36 | UINT8 iPdpAddr[ZATI2_SM_MAX_PDPADDR_LEN]; /* È«0±íʾʹÓö¯Ì¬µØÖ·£¬Èç10.40.63.4±íʾΪ
|
| 37 | iPdpAddr[0]=10,iPdpAddr[1]=40,iPdpAddr[2]=63,iPdpAddr[3]=4*/
|
| 38 | UINT8 iGateWay[ZATI2_SM_MAX_PDPADDR_LEN]; /* ͬÉÏ */
|
| 39 | UINT8 iPrimaryDns[ZATI2_SM_MAX_PDPADDR_LEN]; /* ͬÉÏ */
|
| 40 | UINT8 iSecondaryDns[ZATI2_SM_MAX_PDPADDR_LEN]; /* ͬÉÏ */
|
| 41 | }T_ZAti_SmIpDnsInfo;
|
| 42 |
|
| 43 | typedef enum
|
| 44 | {
|
| 45 | ZATI2_CHIND_AT = 0, /* ָʾµ±Ç°Êý¾ÝΪATÃüÁî*/
|
| 46 | ZATI2_CHIND_PSD, /* ָʾµ±Ç°Êý¾ÝΪPSD*/
|
| 47 | ZATI2_CHIND_PSDV6, /* ָʾµ±Ç°Êý¾ÝΪPSDV6*/
|
| 48 | ZATI2_CHIND_CSD, /* ָʾµ±Ç°Êý¾ÝΪCSD*/
|
| 49 | ZATI2_CHIND_TURN_AT, /* ָʾµ±Ç°Í¨µÀ״̬Çл»ÎªÃüÁî̬£¬Ð¯´øÊý¾ÝÎÞЧ*/
|
| 50 | ZATI2_CHIND_TURN_PSD, /* ָʾµ±Ç°Í¨µÀ״̬Çл»ÎªPSD£¬Ð¯´øÊý¾ÝÎÞЧ*/
|
| 51 | ZATI2_CHIND_TURN_CSD, /* ָʾµ±Ç°Í¨µÀ״̬Çл»ÎªCSD£¬Ð¯´øÊý¾ÝÎÞЧ*/
|
| 52 | ZATI2_CHIND_MAX
|
| 53 | }
|
| 54 | T_zAti2_CtrmChInd;
|
| 55 |
|
| 56 | typedef enum
|
| 57 | {
|
| 58 | ZATI2_CHANNEL_SRV_MODE_INVAL = 0,
|
| 59 | ZATI2_CHANNEL_SRV_MODE_CMD,
|
| 60 | ZATI2_CHANNEL_SRV_MODE_DATA
|
| 61 | }T_zAti2_ChnlSrvModeType;
|
| 62 |
|
| 63 | typedef SINT32 (*T_ZAti2_AtRecvFunc)(UINT8 channelId, UINT8* pDataPtr, UINT16 iDataLen, T_zAti2_CtrmChInd iFlag);
|
| 64 | typedef BOOL (*OutputIpPacket_CB)(UINT8 chId ,VOID *packet, SINT32 packetLen, UINT8 flag);
|
| 65 | typedef BYTE (*T_zAti_AtChannelFunc)(UINT8 PsId);
|
| 66 | #ifdef Z_DUALCARD_DUALSTANDBY
|
| 67 | typedef SINT32 (*ZUSAT_SENDATCMDTOACCESSCHANNEL_FUNC)(UINT32 devId, UINT8 *data, UINT16 dataLen);
|
| 68 | #else
|
| 69 | typedef SINT32 (*ZUSAT_SENDATCMDTOACCESSCHANNEL_FUNC)(UINT8 *data, UINT16 dataLen);
|
| 70 | #endif
|
| 71 | /**************************************************************************
|
| 72 | * º¯ÊýÃû³Æ£º zPsi_RegOutputIpPacketCb
|
| 73 | * ¹¦ÄÜÃèÊö£º
|
| 74 | * ²ÎÊý˵Ã÷£º
|
| 75 | * ·µ »Ø Öµ£º ³É¹¦·µ»ØZATI2_SUCCESS
|
| 76 | * ÆäËü˵Ã÷£º Èë²Î°üÌå²»¿É±»Ð޸ģ¬Ç뿽³öºó²Ù×÷
|
| 77 | **************************************************************************/
|
| 78 | SINT32 zPsi_RegOutputIpPacketCb(OutputIpPacket_CB recvFunc);
|
| 79 |
|
| 80 | /**************************************************************************
|
| 81 | * º¯ÊýÃû³Æ : zAti2_Open
|
| 82 | * ¹¦ÄÜÃèÊö : ´ò¿ªÍ¨µÀ
|
| 83 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 84 | * iChnelId ͨµÀID
|
| 85 | * (OUT)£ºÎÞ
|
| 86 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS£»Ê§°Ü·µ»Ø´íÎóÀàÐÍ£»
|
| 87 | * ÆäËü˵Ã÷ : ÈÎÎñ¾ÍÐ÷ºó²ÅÄܽøÐÐͨµÀ²Ù×÷£»
|
| 88 | * ͬһ¸öͨµÀ£¬²»ÄÜÁ¬Ðø´ò¿ªÁ½´Î
|
| 89 | **************************************************************************/
|
| 90 | SINT32 zAti2_Open(UINT8 iChnelId);
|
| 91 |
|
| 92 | /**************************************************************************
|
| 93 | * º¯ÊýÃû³Æ : zAti2_Close
|
| 94 | * ¹¦ÄÜÃèÊö : ¹Ø±ÕͨµÀ
|
| 95 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 96 | * iChnelId ͨµÀID
|
| 97 | * (OUT)£ºÎÞ
|
| 98 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS£»Ê§°Ü·µ»ØZATI2_FAULSE£»
|
| 99 | * ÆäËü˵Ã÷ : ÈÎÎñ¾ÍÐ÷ºó²ÅÄܽøÐÐͨµÀ²Ù×÷£»
|
| 100 | * ͬһ¸öͨµÀ£¬²»ÄܹرÕÁ½´Î
|
| 101 | **************************************************************************/
|
| 102 | SINT32 zAti2_Close(UINT8 iChnelId);
|
| 103 | /**************************************************************************
|
| 104 | * º¯ÊýÃû³Æ : zAti2_RegRecvCb
|
| 105 | * ¹¦ÄÜÃèÊö : ×¢²á»Øµ÷º¯Êý
|
| 106 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 107 | * recvFunc »Øµ÷º¯Êý
|
| 108 | * (OUT)£ºÎÞ
|
| 109 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS£»Ê§°Ü·µ»Ø´íÎóÔÒò£»
|
| 110 | * ÆäËü˵Ã÷ : Ìṩ¸øÓû§·½º¯Êý½Ó¿Ú
|
| 111 | * Èë²ÎÖ¸ÕëÀàÐÍtypedef SINT32 (*T_ZAti2_RecvCb)(UINT8 channelId,
|
| 112 | * UINT8* pDataPtr, UINT16 iDataLen, UINT8 iFlag);
|
| 113 | **************************************************************************/
|
| 114 | SINT32 zAti2_RegRecvCb(T_ZAti2_AtRecvFunc recvFunc);
|
| 115 | /**************************************************************************
|
| 116 | * º¯ÊýÃû³Æ : zAti2_AtChannelFunc
|
| 117 | * ¹¦ÄÜÃèÊö : ×¢²á»Øµ÷º¯Êý
|
| 118 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 119 | * recvFunc »Øµ÷º¯Êý
|
| 120 | * (OUT)£ºÎÞ
|
| 121 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS£»Ê§°Ü·µ»Ø´íÎóÔÒò£»
|
| 122 | * ÆäËü˵Ã÷ : Ìṩ¸øÓû§·½º¯Êý½Ó¿Ú
|
| 123 | **************************************************************************/
|
| 124 | SINT32 zAti2_AtChannelFunc(T_zAti_AtChannelFunc pChannelFunc);
|
| 125 |
|
| 126 | /**************************************************************************
|
| 127 | * º¯ÊýÃû³Æ : zAti2_SetAlwaysAtReportChannel
|
| 128 | * ¹¦ÄÜÃèÊö : ʼÖÕÉϱ¨ATÃüÁîµÄͨµÀ×¢²á»Øµ÷º¯Êý£¬»Øµ÷º¯Êý·µ»Ø×¨ÓÃͨµÀºÅ¡£
|
| 129 | * µ±×¨ÓÃͨµÀºÅÓÐЧʱ£¬Ö÷¶¯Éϱ¨ÃüÁî²»ÊÜÊÇ·ñºÚÆÁ/ÁÁÆÁÓ°Ï죬¶¼ÔÚ´ËͨµÀÉϱ¨¡£
|
| 130 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 131 | * pChannelFunc - »Øµ÷º¯Êý£¬»Øµ÷º¯Êý·µ»Ø×¨ÓÃͨµÀºÅ¡£
|
| 132 | * ·µ »Ø Öµ :
|
| 133 | * ÆäËü˵Ã÷ : Ìṩ¸ø²Î¿¼Éè¼ÆµÄº¯Êý½Ó¿Ú
|
| 134 | **************************************************************************/
|
| 135 | SINT32 zAti2_SetAlwaysAtReportChannel(T_zAti_AtChannelFunc pChannelFunc);
|
| 136 |
|
| 137 | /**************************************************************************
|
| 138 | * º¯ÊýÃû³Æ : zAti2_Send
|
| 139 | * ¹¦ÄÜÃèÊö : ͨ¹ýͨµÀ·¢ËÍATÃüÁ»òÕßÊý¾Ý
|
| 140 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 141 | * iChnelId »Øµ÷º¯Êý
|
| 142 | * pDataPtr Êý¾ÝÖ¸Õë
|
| 143 | * iDataLen Êý¾Ý³¤¶È
|
| 144 | * iFlag
|
| 145 | * (OUT)£ºÎÞ
|
| 146 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS£»Ê§°Ü·µ»Ø´íÎóÔÒò£»
|
| 147 | * ÆäËü˵Ã÷ : Ìṩ¸øÓû§·½º¯Êý½Ó¿Ú
|
| 148 | **************************************************************************/
|
| 149 | SINT32 zAti2_Send(UINT8 iChnelId, UINT8 *pDataPtr, UINT16 iDataLen, T_zAti2_CtrmChInd iFlag);
|
| 150 |
|
| 151 | /**************************************************************************
|
| 152 | * º¯ÊýÃû³Æ : zAti2_IsAtChReady
|
| 153 | * ¹¦ÄÜÃèÊö : È·ÈÏÖ¸¶¨Í¨µÀ״̬
|
| 154 | * ²ÎÊý˵Ã÷ : (IN)£º
|
| 155 | * chID ͨµÀID
|
| 156 | * (OUT)£ºÎÞ
|
| 157 | * ·µ »Ø Öµ : ͨµÀ¿ÉÓ÷µ»ØOK,·ñÔò·µ»ØFALSE
|
| 158 | * ÆäËü˵Ã÷ : Ìṩ¸øÓû§·½º¯Êý½Ó¿Ú
|
| 159 | **************************************************************************/
|
| 160 | BOOL zAti2_IsAtChReady(UINT8 chID);
|
| 161 | /**********************************************************************
|
| 162 | *º¯ÊýÃû³Æ:zAti_SmIpPdpActReq
|
| 163 | *¹¦ÄÜÃèÊö:»ñÈ¡CIDµÄµØÖ·ÐÅÏ¢
|
| 164 | *²ÎÊý˵Ã÷:
|
| 165 | * iChnelId ͨµÀID
|
| 166 | * pAddr (OUT)µØÖ·ÐÅÏ¢
|
| 167 | *********************************************************************/
|
| 168 | BOOL zAti_SmIpPdpActReq(UINT8 iChnelId, T_ZAti_SmIpDnsInfo* pAddr);
|
| 169 | VOID zUsat_RegisterSendMsgFun(ZUSAT_SENDATCMDTOACCESSCHANNEL_FUNC tmpFun);
|
| 170 | void zUsat_SendAtCmd(UINT32 dev_fd, const UINT8 *strAtCmd, UINT16 atCmdLen, UINT32 extData);
|
| 171 | extern BYTE zAti_PppGetCid(BYTE bChnelId);
|
| 172 |
|
| 173 | /**************************************************************************
|
| 174 | * º¯ÊýÃû³Æ : zAti_GetEMCellInfo
|
| 175 | * ¹¦ÄÜÃèÊö : »ñÈ¡¹¤³ÌÄ£Ê½Ð¡ÇøÐÅÏ¢
|
| 176 | * ²ÎÊý˵Ã÷ : pEmInfo: ½á¹¹ÓÃT_zEM_EmInfo_Ind
|
| 177 | * bInstanceIdx: ´ý»ú²àʵÀýË÷ÒýºÅ,0±íʾ´ý»ú²à1£»1±íʾ´ý»ú²à2
|
| 178 | * µ¥´ý°æ±¾Ìî0£»Ë«´ý°æ±¾¸ù¾Ýʵ¼Ê´ý»ú²àÌîд0»òÕß1
|
| 179 | * ·µ »Ø Öµ : ³É¹¦·µ»ØZATI2_SUCCESS (0)
|
| 180 | * ÆäËü˵Ã÷ : Ìṩ¸øÓû§·½º¯Êý½Ó¿Ú£¬·µ»ØÊ§°Ü˵Ã÷ÔÝʱûÓлñÈ¡µ½
|
| 181 | **************************************************************************/
|
| 182 | SINT32 zAti_GetEMCellInfo(UINT8 *pEmInfo, UINT8 bInstanceIdx);
|
| 183 | #endif
|
| 184 |
|