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_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 | |
| 44 | typedef 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; |
| 51 | extern em_arry_t lte_info[]; |
| 52 | extern em_arry_t ims_setting[]; |
| 53 | extern em_arry_t ims_common[]; |
| 54 | extern em_arry_t ims_call[] ; |
| 55 | extern em_arry_t ims_registration[]; |
| 56 | extern em_arry_t ims[]; |
| 57 | extern em_arry_t gprs[]; |
| 58 | extern em_arry_t networkselection[]; |
| 59 | extern em_arry_t modem_cta[]; |
| 60 | extern em_arry_t modem_fta[]; |
| 61 | extern em_arry_t modem_C2K_Test_MODEM[]; |
| 62 | extern em_arry_t modemtest[]; |
| 63 | extern em_arry_t hspa[]; |
| 64 | extern em_arry_t cfu[]; |
| 65 | extern em_arry_t bandmode[]; |
| 66 | extern em_arry_t networkinfo[]; |
| 67 | extern em_arry_t antenna_4Gmode[]; |
| 68 | extern em_arry_t antenna_3Gmode[]; |
| 69 | extern em_arry_t antennatest[]; |
| 70 | extern em_arry_t time_reg[]; |
| 71 | extern em_arry_t c2k_modem_setting[]; |
| 72 | extern em_arry_t set_get[]; |
| 73 | extern em_arry_t rfdesense_gsm_band[]; |
| 74 | extern em_arry_t rfdesense_gsm_pattern[]; |
| 75 | extern em_arry_t rfdesense_gsm_sub[]; |
| 76 | extern em_arry_t rfdesense_gsm[]; |
| 77 | extern em_arry_t rfdesense_tdscdma_band[]; |
| 78 | extern em_arry_t rfdesense_tdscdma_sub[]; |
| 79 | extern em_arry_t rfdesense_tdscdma[]; |
| 80 | extern em_arry_t rfdesense_wcdma_band[]; |
| 81 | extern em_arry_t rfdesense_wcdma_sub[]; |
| 82 | extern em_arry_t rfdesense_wcdma[]; |
| 83 | extern em_arry_t rfdesense_lte_mode[]; |
| 84 | extern em_arry_t rfdesense_fdd_band[] ; |
| 85 | extern em_arry_t rfdesense_lte_bandwidth[]; |
| 86 | extern em_arry_t rfdesense_lte_mcs[]; |
| 87 | extern em_arry_t rfdesense_fdd_sub[]; |
| 88 | extern em_arry_t rfdesense_lte_fdd[]; |
| 89 | extern em_arry_t rfdesense_tdd_band[]; |
| 90 | extern em_arry_t rfdesense_tdd_config[]; |
| 91 | extern em_arry_t rfdesense_tdd_special[]; |
| 92 | extern em_arry_t rfdesense_tdd_sub[]; |
| 93 | extern em_arry_t rfdesense_lte_tdd[]; |
| 94 | extern em_arry_t rfdesense_cdma_band[]; |
| 95 | extern em_arry_t rfdesense_cdma_modulation[]; |
| 96 | extern em_arry_t rfdesense_cdma_sub[]; |
| 97 | extern em_arry_t rfdesense_cdma[]; |
| 98 | extern em_arry_t sub_tx_test[]; |
| 99 | extern em_arry_t desense_test[]; |
| 100 | extern 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 | |
| 125 | int emImsStart(int argc, int *item,char *value); |
| 126 | int emGprsStart(int argc, int *item,char *value); |
| 127 | int emNetworkSelectionStart(int argc,int selectpos); |
| 128 | int emModemtestStart(int argc, int multicnt,int *item); |
| 129 | int emHspaStart(int argc, int *item); |
| 130 | int lte_em_start(int argc, int multicnt,int *item); |
| 131 | int em_el1_start(int argc, int multicnt,int *item); |
| 132 | int emCfuStart(int argc, int *item); |
| 133 | int emBandmodeStart(int len,int *item,int multilen,char *value[]); |
| 134 | int emNwInfoStart(int argc, int multicnt,int *item); |
| 135 | int emAntennaTestStart(int argc, int *item,char *value); |
| 136 | int emC2kModemSettingStart(int argc, int multicnt,int *item); |
| 137 | int emRfDesenseStart(int len,int *item,int multilen,char *value[]); |
| 138 | |
| 139 | std::vector<std::string> getCdmaCmdArr(std::vector<std::string> cmdArray); |
| 140 | int em_result_notify_fail(std::string str); |
| 141 | int em_result_notify_ok(std::string str); |
| 142 | int em_result_notify_error(std::string str); |
| 143 | int emResultNotifyWithDone(std::string str); |
| 144 | int emResultNotifyEx(std::string str); |
| 145 | int em_result_only_msg(std::string str); |
| 146 | void emSendATCommand(const char *cmd, int soc_id); |
| 147 | void emEnableRadio(bool isEnable, int soc_id); |
| 148 | int em_start(int argc, char *argv[], RIL_SOCKET_ID socket_id, RequestInfo *pRI); |
| 149 | #endif |