blob: 44e3e13f09135191907a7af622e8774f1e5d2fd3 [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_EM_API__
36#define __RIL_EM_API__
37
38#include <vendor-ril/telephony/ril.h>
39#include <string>
40#include <vector>
41
42#include "common.h"
43
44typedef struct em_arry_{
45 char *name; /* main test name. */
46 int subcnt;
47 struct em_arry_ *subarray; /* Function to call to do the job. */
48 int unsol;
49 int reply;
50} em_arry_t;
51extern em_arry_t lte_info[];
52extern em_arry_t ims_setting[];
53extern em_arry_t ims_common[];
54extern em_arry_t ims_call[] ;
55extern em_arry_t ims_registration[];
56extern em_arry_t ims[];
57extern em_arry_t gprs[];
58extern em_arry_t networkselection[];
59extern em_arry_t modem_cta[];
60extern em_arry_t modem_fta[];
61extern em_arry_t modem_C2K_Test_MODEM[];
62extern em_arry_t modemtest[];
63extern em_arry_t hspa[];
64extern em_arry_t cfu[];
65extern em_arry_t bandmode[];
66extern em_arry_t networkinfo[];
67extern em_arry_t antenna_4Gmode[];
68extern em_arry_t antenna_3Gmode[];
69extern em_arry_t antennatest[];
70extern em_arry_t time_reg[];
71extern em_arry_t c2k_modem_setting[];
72extern em_arry_t set_get[];
73extern em_arry_t rfdesense_gsm_band[];
74extern em_arry_t rfdesense_gsm_pattern[];
75extern em_arry_t rfdesense_gsm_sub[];
76extern em_arry_t rfdesense_gsm[];
77extern em_arry_t rfdesense_tdscdma_band[];
78extern em_arry_t rfdesense_tdscdma_sub[];
79extern em_arry_t rfdesense_tdscdma[];
80extern em_arry_t rfdesense_wcdma_band[];
81extern em_arry_t rfdesense_wcdma_sub[];
82extern em_arry_t rfdesense_wcdma[];
83extern em_arry_t rfdesense_lte_mode[];
84extern em_arry_t rfdesense_fdd_band[] ;
85extern em_arry_t rfdesense_lte_bandwidth[];
86extern em_arry_t rfdesense_lte_mcs[];
87extern em_arry_t rfdesense_fdd_sub[];
88extern em_arry_t rfdesense_lte_fdd[];
89extern em_arry_t rfdesense_tdd_band[];
90extern em_arry_t rfdesense_tdd_config[];
91extern em_arry_t rfdesense_tdd_special[];
92extern em_arry_t rfdesense_tdd_sub[];
93extern em_arry_t rfdesense_lte_tdd[];
94extern em_arry_t rfdesense_cdma_band[];
95extern em_arry_t rfdesense_cdma_modulation[];
96extern em_arry_t rfdesense_cdma_sub[];
97extern em_arry_t rfdesense_cdma[];
98extern em_arry_t sub_tx_test[];
99extern em_arry_t desense_test[];
100extern em_arry_t emmain[];
101
102#define RET_STRING_IMS_SUCCESS "IMS test success\ndone\n"
103#define RET_STRING_IMS_FAIL "IMS test fail\ndone\n"
104#define RET_STRING_GPRS_SUCCESS "GPRS test success\ndone\n"
105#define RET_STRING_GPRS_FAIL "GPRS test fail\ndone\n"
106#define RET_STRING_NWSELECTION_SUCCESS "Network Selection success\ndone\n"
107#define RET_STRING_NWSELECTION_FAIL "Network Selection fail\ndone\n"
108#define RET_STRING_MODEMTEST_SUCCESS "Modem test success\ndone\n"
109#define RET_STRING_MODEMTEST_FAIL "Modem test fail\ndone\n"
110#define RET_STRING_HSPA_SUCCESS "HSPA test success\ndone\n"
111#define RET_STRING_HSPA_FAIL "HSPA test fail\ndone\n"
112#define RET_STRING_LTE_SUCCESS "LTE success\ndone\n"
113#define RET_STRING_LTE_FAIL "LTE fail\ndone\n"
114#define RET_STRING_CFU_SUCCESS "CFU success\ndone\n"
115#define RET_STRING_CFU_FAIL "CFU fail\ndone\n"
116#define RET_STRING_BANDMODE_SUCCESS "Bandmode success\ndone\n"
117#define RET_STRING_BANDMODE_FAIL "Bandmode fail\ndone\n"
118#define RET_STRING_NWINFO_SUCCESS "NetworkInfo success\ndone\n"
119#define RET_STRING_NWINFO_FAIL "NetworkInfo fail\ndone\n"
120#define RET_STRING_ANTENNATEST_SUCCESS "Antenna test success\ndone\n"
121#define RET_STRING_ANTENNATEST_FAIL "Antenna test fail\ndone\n"
122#define RET_STRING_C2K_MODEM_SETTING_SUCCESS "c2k modem setting success\ndone\n";
123#define RET_STRING_C2K_MODEM_SETTING_FAIL "c2k modem setting fail\ndone\n";
124
125int emImsStart(int argc, int *item,char *value);
126int emGprsStart(int argc, int *item,char *value);
127int emNetworkSelectionStart(int argc,int selectpos);
128int emModemtestStart(int argc, int multicnt,int *item);
129int emHspaStart(int argc, int *item);
130int lte_em_start(int argc, int multicnt,int *item);
131int em_el1_start(int argc, int multicnt,int *item);
132int emCfuStart(int argc, int *item);
133int emBandmodeStart(int len,int *item,int multilen,char *value[]);
134int emNwInfoStart(int argc, int multicnt,int *item);
135int emAntennaTestStart(int argc, int *item,char *value);
136int emC2kModemSettingStart(int argc, int multicnt,int *item);
137int emRfDesenseStart(int len,int *item,int multilen,char *value[]);
138
139std::vector<std::string> getCdmaCmdArr(std::vector<std::string> cmdArray);
140int em_result_notify_fail(std::string str);
141int em_result_notify_ok(std::string str);
142int em_result_notify_error(std::string str);
143int emResultNotifyWithDone(std::string str);
144int emResultNotifyEx(std::string str);
145int em_result_only_msg(std::string str);
146void emSendATCommand(const char *cmd, int soc_id);
147void emEnableRadio(bool isEnable, int soc_id);
148int em_start(int argc, char *argv[], RIL_SOCKET_ID socket_id, RequestInfo *pRI);
149#endif