rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /* Copyright Statement: |
| 2 | * |
| 3 | * This software/firmware and related documentation ("MediaTek Software") are |
| 4 | * protected under relevant copyright laws. The information contained herein |
| 5 | * is confidential and proprietary to MediaTek Inc. and/or its licensors. |
| 6 | * Without the prior written permission of MediaTek inc. and/or its licensors, |
| 7 | * any reproduction, modification, use or disclosure of MediaTek Software, |
| 8 | * and information contained herein, in whole or in part, shall be strictly prohibited. |
| 9 | */ |
| 10 | /* MediaTek Inc. (C) 2010. All rights reserved. |
| 11 | * |
| 12 | * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 13 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 14 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON |
| 15 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 18 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 19 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 20 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH |
| 21 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES |
| 22 | * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES |
| 23 | * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK |
| 24 | * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR |
| 25 | * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND |
| 26 | * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 27 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 28 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO |
| 29 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 30 | * |
| 31 | * The following software/firmware and/or related documentation ("MediaTek Software") |
| 32 | * have been modified by MediaTek Inc. All revisions are subject to any receiver's |
| 33 | * applicable license agreements with MediaTek Inc. |
| 34 | */ |
| 35 | #ifndef __RIL_STAM__ |
| 36 | #define __RIL_STAM__ |
| 37 | #include <vendor-ril/telephony/ril.h> |
| 38 | #include "common.h" |
| 39 | |
| 40 | //#include <vendor-ril/telephony/mtk_ril_sp.h> |
| 41 | //#include "Parcel.h" |
| 42 | |
| 43 | using::android::Parcel; |
| 44 | |
| 45 | #define MAX_IMSI 20 |
| 46 | int getDeviceIdentity(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 47 | int getIMEI(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 48 | int getIMEISV(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 49 | int getBasebandVersion(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 50 | int resetRadio(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 51 | int getScreenState(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 52 | int setTRM(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 53 | int setIMSEnable(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 54 | int sendATCMD(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 55 | void parseAtCmd(const char* line); |
| 56 | int setIMSCfg(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 57 | #ifdef KEEP_ALIVE |
| 58 | int startKeepAlivePro(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 59 | int stopKeepAlivePro(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 60 | void handleKeepAliveResponse(int request, const void* data, size_t datalen, RIL_SOCKET_ID soc_id, bool is_error); |
| 61 | |
| 62 | |
| 63 | /*****mobiletek-add****/ |
| 64 | typedef enum{ |
| 65 | LYNQ_CALL_ON=0, |
| 66 | LYNQ_CALL_OFF, |
| 67 | }lynqCallStatus; |
| 68 | typedef struct { |
| 69 | int32_t token; |
| 70 | int callid; |
| 71 | int toa; |
| 72 | char * addr; |
| 73 | int isMpty; |
| 74 | int isMT; |
| 75 | int selflen; |
| 76 | RIL_CallState callState; |
| 77 | RIL_Errno lynq_error; |
| 78 | } lynq_call_list; |
| 79 | typedef struct callInfo |
| 80 | { |
| 81 | int32_t token; |
| 82 | int request; |
| 83 | RIL_Errno Error_tok; |
| 84 | Parcel parcel; |
| 85 | lynq_call_list **calllist_tok; |
| 86 | struct callInfo * next; |
| 87 | }callInfoLink; |
| 88 | |
| 89 | extern lynq_call_list **pCallList; |
| 90 | extern callInfoLink * callInfoLinkhead; |
| 91 | |
| 92 | extern lynqCallStatus s_callStatus; |
| 93 | |
| 94 | callInfoLink * create_callInfoLink(); |
| 95 | |
| 96 | typedef struct LQueue |
| 97 | { |
| 98 | int32_t token; |
| 99 | int request; |
| 100 | RIL_Errno t_Errno; //token error number. |
| 101 | int E_status; |
| 102 | Parcel parcel; |
| 103 | struct LQueue * next; |
| 104 | }lynqQueue; |
| 105 | extern lynqQueue * LynqQueueHead; |
| 106 | |
| 107 | lynqQueue * createLynqQueue(); |
| 108 | int lynqApiInit(); |
| 109 | lynqQueue * searchRequestinQueue(int32_t request,lynqQueue *head); |
| 110 | lynqQueue * searchTokeninQueue(int32_t token,lynqQueue *head); |
| 111 | void lynqDeQueue(int32_t token); |
| 112 | int getCallStatus(void); |
| 113 | int setCallStatus(lynqCallStatus callStatus); |
| 114 | |
| 115 | typedef struct simInfo{ |
| 116 | int32_t token; |
| 117 | int request; |
| 118 | int simInfoLen; |
| 119 | RIL_CardState card_status; |
| 120 | RIL_AppType card_type; |
| 121 | RIL_PinState pin_state; |
| 122 | RIL_Errno Error_tok; |
| 123 | char imsi[MAX_IMSI]; |
| 124 | //char *imsi; |
| 125 | struct simInfo* next; |
| 126 | }simInfoLink; |
| 127 | extern simInfoLink *simInfoLinkHead; |
| 128 | char * lynqStrdupReadString(Parcel &p); |
| 129 | simInfoLink *createSimInfoLink(); |
| 130 | void LYNQ_DispatchResponse(int request,int32_t token,RIL_Errno respe,lynq_call_list**nodeCallList,void *response,size_t respLen); |
| 131 | void updateLinkCallInfo(callInfoLink * callInfoLinkhead,lynq_call_list** nodeCallList); |
| 132 | callInfoLink* addCallInfo(int tok,int request,RIL_Errno respe,callInfoLink* head,lynq_call_list** nodeCallList); |
| 133 | void printlist(callInfoLink * callInfoLinkhead); |
| 134 | |
| 135 | void setCallList(int token,RIL_Call **pCallLists,size_t respLen,RIL_Errno error); |
| 136 | int callListToParcel(void *response,size_t responselen,Parcel &p); |
| 137 | |
| 138 | void updateAsyncData(RIL_Token t, RIL_Errno e,void * response, size_t responselen,lynqQueue* head); |
| 139 | |
| 140 | |
| 141 | |
| 142 | void freeCallList(int respLen); |
| 143 | |
| 144 | void addSimInfo(int request,RIL_Errno respe,int32_t token,simInfoLink *NodeSimInfoLink,void *response,size_t respLen); |
| 145 | simInfoLink * inSimQueue(int request,int32_t token,simInfoLink *head); |
| 146 | simInfoLink * deSimQueue(simInfoLink *head,int32_t token); |
| 147 | void LYNQ_DispatchRequest(int32_t request,int32_t token); |
| 148 | void addImsiInfo(int request,RIL_Errno respe,int32_t token,simInfoLink *head,void *response,size_t respLen); |
| 149 | |
| 150 | /*****moblietek-end****/ |
| 151 | #endif /*KEEP_ALIVE*/ |
| 152 | #endif |