blob: 63e0578f9ee94daccd7ce2485954e8ef7b3bff26 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* 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
43using::android::Parcel;
44
45#define MAX_IMSI 20
46int getDeviceIdentity(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
47int getIMEI(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
48int getIMEISV(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
49int getBasebandVersion(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
50int resetRadio(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
51int getScreenState(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
52int setTRM(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
53int setIMSEnable(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
54int sendATCMD(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
55void parseAtCmd(const char* line);
56int setIMSCfg(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
57#ifdef KEEP_ALIVE
58int startKeepAlivePro(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
59int stopKeepAlivePro(int argc, char **argv, RIL_SOCKET_ID socket_id, RequestInfo *pRI);
60void handleKeepAliveResponse(int request, const void* data, size_t datalen, RIL_SOCKET_ID soc_id, bool is_error);
61
62
63/*****mobiletek-add****/
64typedef enum{
65 LYNQ_CALL_ON=0,
66 LYNQ_CALL_OFF,
67}lynqCallStatus;
68typedef struct {
69int32_t token;
70int callid;
71int toa;
72char * addr;
73int isMpty;
74int isMT;
75int selflen;
76RIL_CallState callState;
77RIL_Errno lynq_error;
78} lynq_call_list;
79typedef 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
89extern lynq_call_list **pCallList;
90extern callInfoLink * callInfoLinkhead;
91
92extern lynqCallStatus s_callStatus;
93
94callInfoLink * create_callInfoLink();
95
96typedef 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;
105extern lynqQueue * LynqQueueHead;
106
107lynqQueue * createLynqQueue();
108int lynqApiInit();
109lynqQueue * searchRequestinQueue(int32_t request,lynqQueue *head);
110lynqQueue * searchTokeninQueue(int32_t token,lynqQueue *head);
111void lynqDeQueue(int32_t token);
112int getCallStatus(void);
113int setCallStatus(lynqCallStatus callStatus);
114
115typedef 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;
127extern simInfoLink *simInfoLinkHead;
128char * lynqStrdupReadString(Parcel &p);
129simInfoLink *createSimInfoLink();
130void LYNQ_DispatchResponse(int request,int32_t token,RIL_Errno respe,lynq_call_list**nodeCallList,void *response,size_t respLen);
131void updateLinkCallInfo(callInfoLink * callInfoLinkhead,lynq_call_list** nodeCallList);
132callInfoLink* addCallInfo(int tok,int request,RIL_Errno respe,callInfoLink* head,lynq_call_list** nodeCallList);
133void printlist(callInfoLink * callInfoLinkhead);
134
135void setCallList(int token,RIL_Call **pCallLists,size_t respLen,RIL_Errno error);
136int callListToParcel(void *response,size_t responselen,Parcel &p);
137
138void updateAsyncData(RIL_Token t, RIL_Errno e,void * response, size_t responselen,lynqQueue* head);
139
140
141
142void freeCallList(int respLen);
143
144void addSimInfo(int request,RIL_Errno respe,int32_t token,simInfoLink *NodeSimInfoLink,void *response,size_t respLen);
145simInfoLink * inSimQueue(int request,int32_t token,simInfoLink *head);
146simInfoLink * deSimQueue(simInfoLink *head,int32_t token);
147void LYNQ_DispatchRequest(int32_t request,int32_t token);
148void 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