111fccf17Sopenharmony_ci/* 211fccf17Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 311fccf17Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 411fccf17Sopenharmony_ci * you may not use this file except in compliance with the License. 511fccf17Sopenharmony_ci * You may obtain a copy of the License at 611fccf17Sopenharmony_ci * 711fccf17Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 811fccf17Sopenharmony_ci * 911fccf17Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1011fccf17Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1111fccf17Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1211fccf17Sopenharmony_ci * See the License for the specific language governing permissions and 1311fccf17Sopenharmony_ci * limitations under the License. 1411fccf17Sopenharmony_ci */ 1511fccf17Sopenharmony_ci 1611fccf17Sopenharmony_ci#include "ril_interface_test.h" 1711fccf17Sopenharmony_ci 1811fccf17Sopenharmony_ciusing namespace std; 1911fccf17Sopenharmony_cinamespace OHOS { 2011fccf17Sopenharmony_cinamespace Telephony { 2111fccf17Sopenharmony_ciusing namespace OHOS::HDI::Ril::V1_3; 2211fccf17Sopenharmony_cisptr<OHOS::HDI::Ril::V1_3::IRil> g_rilInterface = nullptr; 2311fccf17Sopenharmony_ciconstexpr int32_t DEFAULT_CHOICE = -1; 2411fccf17Sopenharmony_ciconstexpr int32_t MENU_OFFSET = 1; 2511fccf17Sopenharmony_ciconstexpr int32_t WAIT_TIME = 500000; 2611fccf17Sopenharmony_ciconstexpr int32_t IN_BUF_LEN = 1024; 2711fccf17Sopenharmony_ciconstexpr int32_t MAX_RANDOM = 100000000; 2811fccf17Sopenharmony_ciconstexpr int32_t MAX_CALL_TYPE = 3; 2911fccf17Sopenharmony_ciconstexpr int32_t STRESS_TEST_NUM = 10000; 3011fccf17Sopenharmony_ciconstexpr int32_t MAX_CALL_ID = 7; 3111fccf17Sopenharmony_ciconstexpr int32_t HANGUP_ACTIVE = 2; 3211fccf17Sopenharmony_ciconstexpr int32_t DTMF_ON_LEN = 300; 3311fccf17Sopenharmony_ciconstexpr int32_t RAT_TYPE_LTE = 5; 3411fccf17Sopenharmony_ciconstexpr int32_t BANDWIDTH_HYSTERESIS_MS = 3000; 3511fccf17Sopenharmony_ciconstexpr int32_t BANDWIDTH_HYSTERESIS_KBPS = 50; 3611fccf17Sopenharmony_ciconstexpr int32_t SIM_LOCK_MODE_QUERY = 2; 3711fccf17Sopenharmony_ciconstexpr int32_t MAX_UPLINK_LINK_BANDWIDTH[] = { 3811fccf17Sopenharmony_ci 100, 3911fccf17Sopenharmony_ci 500, 4011fccf17Sopenharmony_ci 1000, 4111fccf17Sopenharmony_ci 5000, 4211fccf17Sopenharmony_ci 10000, 4311fccf17Sopenharmony_ci 20000, 4411fccf17Sopenharmony_ci 50000, 4511fccf17Sopenharmony_ci 100000, 4611fccf17Sopenharmony_ci 200000, 4711fccf17Sopenharmony_ci}; 4811fccf17Sopenharmony_ciconstexpr int32_t MAX_DOWNLINK_LINK_BANDWIDTH[] = { 4911fccf17Sopenharmony_ci 100, // VoIP 5011fccf17Sopenharmony_ci 500, // Web 5111fccf17Sopenharmony_ci 1000, // SD 5211fccf17Sopenharmony_ci 5000, // HD 5311fccf17Sopenharmony_ci 10000, // file 5411fccf17Sopenharmony_ci 20000, // 4K 5511fccf17Sopenharmony_ci 50000, // LTE 5611fccf17Sopenharmony_ci 100000, 5711fccf17Sopenharmony_ci 200000, // 5G 5811fccf17Sopenharmony_ci 500000, 5911fccf17Sopenharmony_ci 1000000, 6011fccf17Sopenharmony_ci}; 6111fccf17Sopenharmony_citypedef enum { 6211fccf17Sopenharmony_ci HREQ_CALL_BASE = 0, 6311fccf17Sopenharmony_ci HREQ_CALL_GET_CALL_LIST, 6411fccf17Sopenharmony_ci HREQ_CALL_DIAL, 6511fccf17Sopenharmony_ci HREQ_CALL_HANGUP, 6611fccf17Sopenharmony_ci HREQ_CALL_REJECT, 6711fccf17Sopenharmony_ci HREQ_CALL_ANSWER, 6811fccf17Sopenharmony_ci HREQ_CALL_HOLD_CALL, // call hold value 6 6911fccf17Sopenharmony_ci HREQ_CALL_UNHOLD_CALL, // call active value 6 7011fccf17Sopenharmony_ci HREQ_CALL_SWITCH_CALL, 7111fccf17Sopenharmony_ci HREQ_CALL_COMBINE_CONFERENCE, 7211fccf17Sopenharmony_ci HREQ_CALL_SEPARATE_CONFERENCE, // Keep all other calls except the xth call 7311fccf17Sopenharmony_ci HREQ_CALL_CALL_SUPPLEMENT, 7411fccf17Sopenharmony_ci HREQ_CALL_SEND_DTMF, 7511fccf17Sopenharmony_ci HREQ_CALL_START_DTMF, 7611fccf17Sopenharmony_ci HREQ_CALL_STOP_DTMF, 7711fccf17Sopenharmony_ci HREQ_CALL_SET_CLIP, 7811fccf17Sopenharmony_ci HREQ_CALL_GET_CLIP, 7911fccf17Sopenharmony_ci HREQ_CALL_GET_CALL_WAITING, 8011fccf17Sopenharmony_ci HREQ_CALL_SET_CALL_WAITING, 8111fccf17Sopenharmony_ci HREQ_CALL_GET_CALL_RESTRICTION, 8211fccf17Sopenharmony_ci HREQ_CALL_SET_CALL_RESTRICTION, 8311fccf17Sopenharmony_ci HREQ_CALL_GET_CALL_TRANSFER_INFO, 8411fccf17Sopenharmony_ci HREQ_CALL_SET_CALL_TRANSFER_INFO, 8511fccf17Sopenharmony_ci HREQ_CALL_GET_CLIR, 8611fccf17Sopenharmony_ci HREQ_CALL_SET_CLIR, 8711fccf17Sopenharmony_ci HREQ_CALL_GET_CALL_PREFERENCE, 8811fccf17Sopenharmony_ci HREQ_CALL_SET_CALL_PREFERENCE, 8911fccf17Sopenharmony_ci HREQ_CALL_SET_USSD, 9011fccf17Sopenharmony_ci HREQ_CALL_GET_USSD, 9111fccf17Sopenharmony_ci HREQ_CALL_SET_MUTE, 9211fccf17Sopenharmony_ci HREQ_CALL_GET_MUTE, 9311fccf17Sopenharmony_ci HREQ_CALL_GET_EMERGENCY_LIST, 9411fccf17Sopenharmony_ci HREQ_CALL_SET_EMERGENCY_LIST, 9511fccf17Sopenharmony_ci HREQ_CALL_GET_FAIL_REASON, 9611fccf17Sopenharmony_ci HREQ_CALL_SET_BARRING_PASSWORD, 9711fccf17Sopenharmony_ci HREQ_SET_VONR_SWITCH, 9811fccf17Sopenharmony_ci 9911fccf17Sopenharmony_ci HREQ_SMS_BASE = 100, 10011fccf17Sopenharmony_ci HREQ_SMS_SEND_GSM_SMS, 10111fccf17Sopenharmony_ci HREQ_SMS_SEND_CDMA_SMS, 10211fccf17Sopenharmony_ci HREQ_SMS_ADD_SIM_MESSAGE, 10311fccf17Sopenharmony_ci HREQ_SMS_DEL_SIM_MESSAGE, 10411fccf17Sopenharmony_ci HREQ_SMS_UPDATE_SIM_MESSAGE, 10511fccf17Sopenharmony_ci HREQ_SMS_SEND_SMS_MORE_MODE, 10611fccf17Sopenharmony_ci HREQ_SMS_SEND_SMS_ACK, 10711fccf17Sopenharmony_ci HREQ_SMS_SET_SMSC_ADDR, 10811fccf17Sopenharmony_ci HREQ_SMS_GET_SMSC_ADDR, 10911fccf17Sopenharmony_ci HREQ_SMS_SET_CB_CONFIG, 11011fccf17Sopenharmony_ci HREQ_SMS_GET_CB_CONFIG, 11111fccf17Sopenharmony_ci HREQ_SMS_GET_CDMA_CB_CONFIG, 11211fccf17Sopenharmony_ci HREQ_SMS_SET_CDMA_CB_CONFIG, 11311fccf17Sopenharmony_ci HREQ_SMS_ADD_CDMA_SIM_MESSAGE, 11411fccf17Sopenharmony_ci HREQ_SMS_DEL_CDMA_SIM_MESSAGE, 11511fccf17Sopenharmony_ci HREQ_SMS_UPDATE_CDMA_SIM_MESSAGE, 11611fccf17Sopenharmony_ci 11711fccf17Sopenharmony_ci HREQ_SIM_BASE = 200, 11811fccf17Sopenharmony_ci HREQ_SIM_GET_SIM_STATUS, 11911fccf17Sopenharmony_ci HREQ_SIM_GET_IMSI, 12011fccf17Sopenharmony_ci HREQ_SIM_GET_SIM_IO, 12111fccf17Sopenharmony_ci HREQ_SIM_GET_SIM_LOCK_STATUS, 12211fccf17Sopenharmony_ci HREQ_SIM_SET_SIM_LOCK, 12311fccf17Sopenharmony_ci HREQ_SIM_CHANGE_SIM_PASSWORD, 12411fccf17Sopenharmony_ci HREQ_SIM_UNLOCK_PIN, 12511fccf17Sopenharmony_ci HREQ_SIM_UNLOCK_PUK, 12611fccf17Sopenharmony_ci HREQ_SIM_GET_SIM_PIN_INPUT_TIMES, 12711fccf17Sopenharmony_ci HREQ_SIM_UNLOCK_PIN2, 12811fccf17Sopenharmony_ci HREQ_SIM_UNLOCK_PUK2, 12911fccf17Sopenharmony_ci HREQ_SIM_GET_SIM_PIN2_INPUT_TIMES, 13011fccf17Sopenharmony_ci HREQ_SIM_SET_ACTIVE_SIM, 13111fccf17Sopenharmony_ci HREQ_SIM_GET_RADIO_PROTOCOL, 13211fccf17Sopenharmony_ci HREQ_SIM_SET_RADIO_PROTOCOL, 13311fccf17Sopenharmony_ci HREQ_SIM_STK_SEND_TERMINAL_RESPONSE, 13411fccf17Sopenharmony_ci HREQ_SIM_STK_SEND_ENVELOPE, 13511fccf17Sopenharmony_ci HREQ_SIM_STK_SEND_CALL_SETUP_REQUEST_RESULT, 13611fccf17Sopenharmony_ci HREQ_SIM_STK_IS_READY, 13711fccf17Sopenharmony_ci HREQ_SIM_OPEN_LOGICAL_CHANNEL, 13811fccf17Sopenharmony_ci HREQ_SIM_CLOSE_LOGICAL_CHANNEL, 13911fccf17Sopenharmony_ci HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL, 14011fccf17Sopenharmony_ci HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL, 14111fccf17Sopenharmony_ci HREQ_SIM_AUTHENTICATION, 14211fccf17Sopenharmony_ci HREQ_SIM_UNLOCK_SIM_LOCK, 14311fccf17Sopenharmony_ci HREQ_SIM_SEND_NCFG_OPER_INFO, 14411fccf17Sopenharmony_ci 14511fccf17Sopenharmony_ci HREQ_DATA_BASE = 300, 14611fccf17Sopenharmony_ci HREQ_DATA_SET_INIT_APN_INFO, 14711fccf17Sopenharmony_ci HREQ_DATA_DEACTIVATE_PDP_CONTEXT, 14811fccf17Sopenharmony_ci HREQ_DATA_ACTIVATE_PDP_CONTEXT, 14911fccf17Sopenharmony_ci HREQ_DATA_GET_PDP_CONTEXT_LIST, 15011fccf17Sopenharmony_ci HREQ_DATA_GET_LINK_BANDWIDTH_INFO, 15111fccf17Sopenharmony_ci HREQ_DATA_SET_LINK_BANDWIDTH_REPORTING_RULE, 15211fccf17Sopenharmony_ci HREQ_DATA_SET_DATA_PROFILE_INFO, 15311fccf17Sopenharmony_ci HREQ_DATA_SEND_DATA_PERFORMANCE_MODE, 15411fccf17Sopenharmony_ci HREQ_DATA_SEND_DATA_SLEEP_MODE, 15511fccf17Sopenharmony_ci HREQ_DATA_SET_DATA_PERMITTED, 15611fccf17Sopenharmony_ci HREQ_DATA_GET_LINK_CAPABILITY, 15711fccf17Sopenharmony_ci HREQ_DATA_CLEAN_ALL_CONNECTIONS, 15811fccf17Sopenharmony_ci 15911fccf17Sopenharmony_ci HREQ_NETWORK_BASE = 400, 16011fccf17Sopenharmony_ci HREQ_NETWORK_GET_SIGNAL_STRENGTH, 16111fccf17Sopenharmony_ci HREQ_NETWORK_GET_CS_REG_STATUS, 16211fccf17Sopenharmony_ci HREQ_NETWORK_GET_PS_REG_STATUS, 16311fccf17Sopenharmony_ci HREQ_NETWORK_GET_OPERATOR_INFO, 16411fccf17Sopenharmony_ci HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION, 16511fccf17Sopenharmony_ci HREQ_NETWORK_GET_NETWORK_SELECTION_MODE, 16611fccf17Sopenharmony_ci HREQ_NETWORK_SET_NETWORK_SELECTION_MODE, 16711fccf17Sopenharmony_ci HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST, 16811fccf17Sopenharmony_ci HREQ_NETWORK_GET_CURRENT_CELL_INFO, 16911fccf17Sopenharmony_ci HREQ_NETWORK_SET_PREFERRED_NETWORK, 17011fccf17Sopenharmony_ci HREQ_NETWORK_GET_PREFERRED_NETWORK, 17111fccf17Sopenharmony_ci HREQ_NETWORK_GET_RADIO_CAPABILITY, 17211fccf17Sopenharmony_ci HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG, 17311fccf17Sopenharmony_ci HREQ_NETWORK_SET_LOCATE_UPDATES, 17411fccf17Sopenharmony_ci HREQ_NETWORK_SET_NOTIFICATION_FILTER, 17511fccf17Sopenharmony_ci HREQ_NETWORK_SET_DEVICE_STATE, 17611fccf17Sopenharmony_ci HREQ_NETWORK_SET_NR_OPTION_MODE, 17711fccf17Sopenharmony_ci HREQ_NETWORK_GET_NR_OPTION_MODE, 17811fccf17Sopenharmony_ci HREQ_NETWORK_GET_RRC_CONNECTION_STATE, 17911fccf17Sopenharmony_ci HREQ_NETWORK_GET_NR_SSBID_INFO, 18011fccf17Sopenharmony_ci 18111fccf17Sopenharmony_ci HREQ_COMMON_BASE = 500, 18211fccf17Sopenharmony_ci HREQ_MODEM_SHUT_DOWN, 18311fccf17Sopenharmony_ci HREQ_MODEM_SET_RADIO_STATUS, 18411fccf17Sopenharmony_ci HREQ_MODEM_GET_RADIO_STATUS, 18511fccf17Sopenharmony_ci HREQ_MODEM_GET_IMEI, 18611fccf17Sopenharmony_ci HREQ_MODEM_GET_IMEISV, 18711fccf17Sopenharmony_ci HREQ_MODEM_GET_MEID, 18811fccf17Sopenharmony_ci HREQ_MODEM_GET_BASEBAND_VERSION, 18911fccf17Sopenharmony_ci HREQ_MODEM_GET_VOICE_RADIO, 19011fccf17Sopenharmony_ci HREQ_MODEM_EXIT = 1000 19111fccf17Sopenharmony_ci} HRilRequest; 19211fccf17Sopenharmony_ci 19311fccf17Sopenharmony_cienum class TestMenu : int32_t { NONE = -1, EXIT, MODEM, CALL, NETWORK, SIM, DATA, SMS, STRESS }; 19411fccf17Sopenharmony_ci 19511fccf17Sopenharmony_cistatic int32_t InputInt32(int32_t start, int32_t end, const string &title) 19611fccf17Sopenharmony_ci{ 19711fccf17Sopenharmony_ci int32_t choice; 19811fccf17Sopenharmony_ci bool firstFlg = true; 19911fccf17Sopenharmony_ci 20011fccf17Sopenharmony_ci do { 20111fccf17Sopenharmony_ci if (!firstFlg) { 20211fccf17Sopenharmony_ci cin.clear(); 20311fccf17Sopenharmony_ci cin.ignore(IN_BUF_LEN, '\n'); 20411fccf17Sopenharmony_ci cout << "---->Invalid Input, Please Enter Again !" << endl; 20511fccf17Sopenharmony_ci } 20611fccf17Sopenharmony_ci firstFlg = false; 20711fccf17Sopenharmony_ci cout << "---->Please Enter " << title << " (" << start << "-" << end << "): "; 20811fccf17Sopenharmony_ci cin >> choice; 20911fccf17Sopenharmony_ci } while (cin.fail() || choice < start || choice > end); 21011fccf17Sopenharmony_ci 21111fccf17Sopenharmony_ci return choice; 21211fccf17Sopenharmony_ci} 21311fccf17Sopenharmony_ci 21411fccf17Sopenharmony_ciint32_t RilInterfaceTest::GetSerialId() 21511fccf17Sopenharmony_ci{ 21611fccf17Sopenharmony_ci return rand() % MAX_RANDOM; 21711fccf17Sopenharmony_ci} 21811fccf17Sopenharmony_ci 21911fccf17Sopenharmony_civoid RilInterfaceTest::GetCallListTest(int32_t slotId) 22011fccf17Sopenharmony_ci{ 22111fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetCallListTest -->" << endl; 22211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetCallList(slotId, GetSerialId()); 22311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetCallListTest finish ret : " << ret << endl << endl; 22411fccf17Sopenharmony_ci} 22511fccf17Sopenharmony_ci 22611fccf17Sopenharmony_civoid RilInterfaceTest::RilCmDialTest(int32_t slotId) 22711fccf17Sopenharmony_ci{ 22811fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmDialTest -->" << endl; 22911fccf17Sopenharmony_ci DialInfo dialInfo = {}; 23011fccf17Sopenharmony_ci dialInfo.clir = 0; 23111fccf17Sopenharmony_ci cout << "---->Please enter the phone number:"; 23211fccf17Sopenharmony_ci cin >> dialInfo.address; 23311fccf17Sopenharmony_ci int32_t ret = g_rilInterface->Dial(slotId, GetSerialId(), dialInfo); 23411fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmDialTest finish ret : " << ret << endl << endl; 23511fccf17Sopenharmony_ci} 23611fccf17Sopenharmony_ci 23711fccf17Sopenharmony_civoid RilInterfaceTest::RilCmDialStressTest(int32_t slotId) 23811fccf17Sopenharmony_ci{ 23911fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmDialStressTest -->" << endl; 24011fccf17Sopenharmony_ci DialInfo dialInfo = {}; 24111fccf17Sopenharmony_ci dialInfo.clir = 0; 24211fccf17Sopenharmony_ci cout << "---->Please enter the phone number:"; 24311fccf17Sopenharmony_ci cin >> dialInfo.address; 24411fccf17Sopenharmony_ci int32_t ret = -1; 24511fccf17Sopenharmony_ci for (int32_t i = 0; i < STRESS_TEST_NUM; i++) { 24611fccf17Sopenharmony_ci ret = g_rilInterface->Dial(slotId, GetSerialId(), dialInfo); 24711fccf17Sopenharmony_ci } 24811fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmDialStressTest finish ret : " << ret << endl << endl; 24911fccf17Sopenharmony_ci} 25011fccf17Sopenharmony_ci 25111fccf17Sopenharmony_civoid RilInterfaceTest::HangupTest(int32_t slotId) 25211fccf17Sopenharmony_ci{ 25311fccf17Sopenharmony_ci cout << "RilInterfaceTest::HangupTest -->" << endl; 25411fccf17Sopenharmony_ci int32_t callIndex = InputInt32(1, MAX_CALL_ID, "Hangup call number"); 25511fccf17Sopenharmony_ci int ret = g_rilInterface->Hangup(slotId, GetSerialId(), callIndex); 25611fccf17Sopenharmony_ci cout << "RilInterfaceTest::HangupTest finish ret : " << ret << endl << endl; 25711fccf17Sopenharmony_ci} 25811fccf17Sopenharmony_ci 25911fccf17Sopenharmony_civoid RilInterfaceTest::RejectTest(int32_t slotId) 26011fccf17Sopenharmony_ci{ 26111fccf17Sopenharmony_ci cout << "RilInterfaceTest::RejectTest -->" << endl; 26211fccf17Sopenharmony_ci int ret = g_rilInterface->Reject(slotId, GetSerialId()); 26311fccf17Sopenharmony_ci cout << "RilInterfaceTest::RejectTest finish ret : " << ret << endl << endl; 26411fccf17Sopenharmony_ci} 26511fccf17Sopenharmony_ci 26611fccf17Sopenharmony_civoid RilInterfaceTest::AnswerCallTest(int32_t slotId) 26711fccf17Sopenharmony_ci{ 26811fccf17Sopenharmony_ci cout << "RilInterfaceTest::AnswerCallTest -->" << endl; 26911fccf17Sopenharmony_ci int ret = g_rilInterface->Answer(slotId, GetSerialId()); 27011fccf17Sopenharmony_ci cout << "RilInterfaceTest::AnswerCallTest finish ret : " << ret << endl << endl; 27111fccf17Sopenharmony_ci} 27211fccf17Sopenharmony_ci 27311fccf17Sopenharmony_civoid RilInterfaceTest::HoldCallTest(int32_t slotId) 27411fccf17Sopenharmony_ci{ 27511fccf17Sopenharmony_ci cout << "RilInterfaceTest::HoldCallTest -->" << endl; 27611fccf17Sopenharmony_ci int ret = g_rilInterface->HoldCall(slotId, GetSerialId()); 27711fccf17Sopenharmony_ci cout << "RilInterfaceTest::HoldCallTest finish ret : " << ret << endl << endl; 27811fccf17Sopenharmony_ci} 27911fccf17Sopenharmony_ci 28011fccf17Sopenharmony_civoid RilInterfaceTest::UnHoldCallTest(int32_t slotId) 28111fccf17Sopenharmony_ci{ 28211fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnHoldCallTest -->" << endl; 28311fccf17Sopenharmony_ci int ret = g_rilInterface->UnHoldCall(slotId, GetSerialId()); 28411fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnHoldCall finish ret : " << ret << endl << endl; 28511fccf17Sopenharmony_ci} 28611fccf17Sopenharmony_ci 28711fccf17Sopenharmony_civoid RilInterfaceTest::SwitchCallTest(int32_t slotId) 28811fccf17Sopenharmony_ci{ 28911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SwitchCallTest -->" << endl; 29011fccf17Sopenharmony_ci int ret = g_rilInterface->SwitchCall(slotId, GetSerialId()); 29111fccf17Sopenharmony_ci cout << "RilInterfaceTest::SwitchCallTest finish ret : " << ret << endl << endl; 29211fccf17Sopenharmony_ci} 29311fccf17Sopenharmony_ci 29411fccf17Sopenharmony_civoid RilInterfaceTest::RilCmJoinCallTest(int32_t slotId) 29511fccf17Sopenharmony_ci{ 29611fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmJoinCallTest -->" << endl; 29711fccf17Sopenharmony_ci int32_t callType = InputInt32(0, MAX_CALL_TYPE, "Call Type"); 29811fccf17Sopenharmony_ci int ret = g_rilInterface->CombineConference(slotId, GetSerialId(), callType); 29911fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmJoinCallTest finish ret : " << ret << endl << endl; 30011fccf17Sopenharmony_ci} 30111fccf17Sopenharmony_ci 30211fccf17Sopenharmony_civoid RilInterfaceTest::RilCmSplitCallTest(int32_t slotId) 30311fccf17Sopenharmony_ci{ 30411fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmSplitCallTest -->" << endl; 30511fccf17Sopenharmony_ci int32_t callIndex = InputInt32(1, MAX_CALL_ID, "The Split Call Number"); 30611fccf17Sopenharmony_ci cout << "call type:" << endl; 30711fccf17Sopenharmony_ci cout << "0: Voice call" << endl; 30811fccf17Sopenharmony_ci cout << "1: Video call: send one-way video, two-way voice" << endl; 30911fccf17Sopenharmony_ci cout << "2: Video call: one-way receiving video, two-way voice" << endl; 31011fccf17Sopenharmony_ci cout << "3: Video call: two-way video, two-way voice" << endl; 31111fccf17Sopenharmony_ci int32_t callType = InputInt32(0, MAX_CALL_TYPE, "Call Type"); 31211fccf17Sopenharmony_ci int ret = g_rilInterface->SeparateConference(slotId, GetSerialId(), callIndex, callType); 31311fccf17Sopenharmony_ci cout << "RilInterfaceTest::RilCmSplitCallTest finish ret : " << ret << endl << endl; 31411fccf17Sopenharmony_ci} 31511fccf17Sopenharmony_ci 31611fccf17Sopenharmony_civoid RilInterfaceTest::CallSupplementTest(int32_t slotId) 31711fccf17Sopenharmony_ci{ 31811fccf17Sopenharmony_ci cout << "RilInterfaceTest::CallSupplementTest -->" << endl; 31911fccf17Sopenharmony_ci cout << "---->CallSupplement Hangup hold wait: 1, Hangup active: 2: " << endl; 32011fccf17Sopenharmony_ci int32_t hangupType = InputInt32(1, HANGUP_ACTIVE, "Option"); 32111fccf17Sopenharmony_ci int ret = g_rilInterface->CallSupplement(slotId, GetSerialId(), hangupType); 32211fccf17Sopenharmony_ci cout << "RilInterfaceTest::CallSupplementTest finish ret : " << ret << endl << endl; 32311fccf17Sopenharmony_ci} 32411fccf17Sopenharmony_ci 32511fccf17Sopenharmony_civoid RilInterfaceTest::SendDtmfTest(int32_t slotId) 32611fccf17Sopenharmony_ci{ 32711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendDtmfTest -->" << endl; 32811fccf17Sopenharmony_ci DtmfInfo dtmfInfo = {}; 32911fccf17Sopenharmony_ci dtmfInfo.callId = 1; 33011fccf17Sopenharmony_ci dtmfInfo.onLength = DTMF_ON_LEN; 33111fccf17Sopenharmony_ci dtmfInfo.offLength = 0; 33211fccf17Sopenharmony_ci dtmfInfo.stringLength = 1; 33311fccf17Sopenharmony_ci cout << "---->Please input dtmf key: "; 33411fccf17Sopenharmony_ci cin >> dtmfInfo.dtmfKey; 33511fccf17Sopenharmony_ci cout << endl << "====>Send Dtmf Key: " << dtmfInfo.dtmfKey << endl; 33611fccf17Sopenharmony_ci 33711fccf17Sopenharmony_ci int ret = g_rilInterface->SendDtmf(slotId, GetSerialId(), dtmfInfo); 33811fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendDtmfTest finish ret : " << ret << endl << endl; 33911fccf17Sopenharmony_ci} 34011fccf17Sopenharmony_ci 34111fccf17Sopenharmony_civoid RilInterfaceTest::StartDtmfTest(int32_t slotId) 34211fccf17Sopenharmony_ci{ 34311fccf17Sopenharmony_ci cout << "RilInterfaceTest::StartDtmfTest -->" << endl; 34411fccf17Sopenharmony_ci DtmfInfo dtmfInfo = {}; 34511fccf17Sopenharmony_ci dtmfInfo.callId = 1; 34611fccf17Sopenharmony_ci cout << "---->Please input dtmf key: "; 34711fccf17Sopenharmony_ci cin >> dtmfInfo.dtmfKey; 34811fccf17Sopenharmony_ci cout << endl << "====>Start Dtmf Key: " << dtmfInfo.dtmfKey << endl; 34911fccf17Sopenharmony_ci int ret = g_rilInterface->StartDtmf(slotId, GetSerialId(), dtmfInfo); 35011fccf17Sopenharmony_ci cout << "RilInterfaceTest::StartDtmfTest finish ret : " << ret << endl << endl; 35111fccf17Sopenharmony_ci} 35211fccf17Sopenharmony_ci 35311fccf17Sopenharmony_civoid RilInterfaceTest::StopDtmfTest(int32_t slotId) 35411fccf17Sopenharmony_ci{ 35511fccf17Sopenharmony_ci cout << "RilInterfaceTest::StopDtmfTest -->" << endl; 35611fccf17Sopenharmony_ci DtmfInfo dtmfInfo = {}; 35711fccf17Sopenharmony_ci dtmfInfo.callId = 1; 35811fccf17Sopenharmony_ci cout << "---->Please input dtmf key: "; 35911fccf17Sopenharmony_ci cin >> dtmfInfo.dtmfKey; 36011fccf17Sopenharmony_ci cout << endl << "====>Start Dtmf Key: " << dtmfInfo.dtmfKey << endl; 36111fccf17Sopenharmony_ci int ret = g_rilInterface->StopDtmf(slotId, GetSerialId(), dtmfInfo); 36211fccf17Sopenharmony_ci cout << "RilInterfaceTest::StopDtmfTest finish ret : " << ret << endl << endl; 36311fccf17Sopenharmony_ci} 36411fccf17Sopenharmony_ci 36511fccf17Sopenharmony_civoid RilInterfaceTest::SetUssdCusdTest(int32_t slotId) 36611fccf17Sopenharmony_ci{ 36711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetUssdCusdTest -->" << endl; 36811fccf17Sopenharmony_ci int ret = g_rilInterface->SetUssd(slotId, GetSerialId(), "12345678"); 36911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetUssdCusdTest finish ret : " << ret << endl << endl; 37011fccf17Sopenharmony_ci} 37111fccf17Sopenharmony_ci 37211fccf17Sopenharmony_civoid RilInterfaceTest::GetUssdCusdTest(int32_t slotId) 37311fccf17Sopenharmony_ci{ 37411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetUssdCusdTest -->" << endl; 37511fccf17Sopenharmony_ci int ret = g_rilInterface->GetUssd(1, GetSerialId()); 37611fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetUssdCusdTest finish ret : " << ret << endl << endl; 37711fccf17Sopenharmony_ci} 37811fccf17Sopenharmony_ci 37911fccf17Sopenharmony_civoid RilInterfaceTest::SetMuteTest(int32_t slotId) 38011fccf17Sopenharmony_ci{ 38111fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetMuteTest -->" << endl; 38211fccf17Sopenharmony_ci cout << "---->Unmute: 0, Mute: 1: " << endl; 38311fccf17Sopenharmony_ci int32_t mute = InputInt32(0, 1, "Option"); 38411fccf17Sopenharmony_ci int ret = g_rilInterface->SetMute(slotId, GetSerialId(), mute); 38511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetMuteTest finish ret : " << ret << endl << endl; 38611fccf17Sopenharmony_ci} 38711fccf17Sopenharmony_ci 38811fccf17Sopenharmony_civoid RilInterfaceTest::GetMuteTest(int32_t slotId) 38911fccf17Sopenharmony_ci{ 39011fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetMuteTest -->" << endl; 39111fccf17Sopenharmony_ci int ret = g_rilInterface->GetMute(slotId, GetSerialId()); 39211fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetMuteTest finish ret : " << ret << endl << endl; 39311fccf17Sopenharmony_ci} 39411fccf17Sopenharmony_ci 39511fccf17Sopenharmony_civoid RilInterfaceTest::GetEmergencyListTest(int32_t slotId) 39611fccf17Sopenharmony_ci{ 39711fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetEmergencyListTest -->" << endl; 39811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetEmergencyCallList(slotId, GetSerialId()); 39911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetEmergencyListTest finish ret : " << ret << endl << endl; 40011fccf17Sopenharmony_ci} 40111fccf17Sopenharmony_ci 40211fccf17Sopenharmony_civoid RilInterfaceTest::SetEmergencyCallListTest(int32_t slotId) 40311fccf17Sopenharmony_ci{ 40411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetEmergencyCallListTest -->" << endl; 40511fccf17Sopenharmony_ci EmergencyInfoList emergencyInfoList; 40611fccf17Sopenharmony_ci EmergencyCall emergencyInfo = {}; 40711fccf17Sopenharmony_ci emergencyInfo.index = 1; 40811fccf17Sopenharmony_ci emergencyInfo.total = 1; 40911fccf17Sopenharmony_ci emergencyInfo.eccNum = "120"; 41011fccf17Sopenharmony_ci emergencyInfo.eccType = EccType::TYPE_CATEGORY; 41111fccf17Sopenharmony_ci emergencyInfo.simpresent = SimpresentType::TYPE_HAS_CARD; 41211fccf17Sopenharmony_ci emergencyInfo.mcc = "460"; 41311fccf17Sopenharmony_ci emergencyInfo.abnormalService = AbnormalServiceType::TYPE_ALL; 41411fccf17Sopenharmony_ci emergencyInfoList.calls.push_back(emergencyInfo); 41511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetEmergencyCallList(slotId, GetSerialId(), emergencyInfoList); 41611fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetEmergencyCallListTest finish ret : " << ret << endl << endl; 41711fccf17Sopenharmony_ci} 41811fccf17Sopenharmony_ci 41911fccf17Sopenharmony_civoid RilInterfaceTest::SetBarringPasswordTest(int32_t slotId) 42011fccf17Sopenharmony_ci{ 42111fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetBarringPasswordTest -->" << endl; 42211fccf17Sopenharmony_ci SetBarringInfo setBarringInfo; 42311fccf17Sopenharmony_ci setBarringInfo.fac = "AB"; 42411fccf17Sopenharmony_ci 42511fccf17Sopenharmony_ci cout << "Please input old password:"; 42611fccf17Sopenharmony_ci cin >> setBarringInfo.oldPassword; 42711fccf17Sopenharmony_ci cout << "Your input old password is : " << setBarringInfo.oldPassword << endl; 42811fccf17Sopenharmony_ci 42911fccf17Sopenharmony_ci cout << "Please input new password:"; 43011fccf17Sopenharmony_ci cin >> setBarringInfo.newPassword; 43111fccf17Sopenharmony_ci cout << "Your input new password is : " << setBarringInfo.newPassword << endl; 43211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetBarringPassword(slotId, GetSerialId(), setBarringInfo); 43311fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetBarringPasswordTest finish ret : " << ret << endl << endl; 43411fccf17Sopenharmony_ci} 43511fccf17Sopenharmony_ci 43611fccf17Sopenharmony_civoid RilInterfaceTest::GetFailReasonTest(int32_t slotId) 43711fccf17Sopenharmony_ci{ 43811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetFailReasonTest -->" << endl; 43911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetCallFailReason(slotId, GetSerialId()); 44011fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetFailReasonTest finish ret : " << ret << endl << endl; 44111fccf17Sopenharmony_ci} 44211fccf17Sopenharmony_ci 44311fccf17Sopenharmony_civoid RilInterfaceTest::IccRilSimIoForAppTest(int32_t slotId) 44411fccf17Sopenharmony_ci{ 44511fccf17Sopenharmony_ci cout << "RilInterfaceTest::IccRilSimIoForAppTest -->" << endl; 44611fccf17Sopenharmony_ci cout << "176 : READ BINARY" << endl; 44711fccf17Sopenharmony_ci cout << "178 : READ RECORD" << endl; 44811fccf17Sopenharmony_ci cout << "192 : GET RESPONSE" << endl; 44911fccf17Sopenharmony_ci cout << "214 : UPDATE BINARY" << endl; 45011fccf17Sopenharmony_ci cout << "220 : UPDATE RECORD" << endl; 45111fccf17Sopenharmony_ci cout << "242 : STATUS" << endl; 45211fccf17Sopenharmony_ci cout << "203 : RETRIEVE DATA" << endl; 45311fccf17Sopenharmony_ci cout << "219 : SET DATA" << endl; 45411fccf17Sopenharmony_ci cout << "Please input command type:"; 45511fccf17Sopenharmony_ci int32_t curCommand; 45611fccf17Sopenharmony_ci cin >> curCommand; 45711fccf17Sopenharmony_ci cout << "Your input command type is : " << curCommand << endl; 45811fccf17Sopenharmony_ci cout << "Please Input file id:"; 45911fccf17Sopenharmony_ci int32_t fileId; 46011fccf17Sopenharmony_ci cin >> fileId; 46111fccf17Sopenharmony_ci cout << "Your input file id is : " << fileId << endl; 46211fccf17Sopenharmony_ci cout << "Please Input file path:"; 46311fccf17Sopenharmony_ci string filePath; 46411fccf17Sopenharmony_ci cin >> filePath; 46511fccf17Sopenharmony_ci cout << "Your input file path is : " << filePath << endl; 46611fccf17Sopenharmony_ci cout << "Please Input p1:"; 46711fccf17Sopenharmony_ci int32_t p1; 46811fccf17Sopenharmony_ci cin >> p1; 46911fccf17Sopenharmony_ci cout << "Your input p1 is : " << p1 << endl; 47011fccf17Sopenharmony_ci cout << "Please Input p2:"; 47111fccf17Sopenharmony_ci int32_t p2; 47211fccf17Sopenharmony_ci cin >> p2; 47311fccf17Sopenharmony_ci cout << "Your input p2 is : " << p2 << endl; 47411fccf17Sopenharmony_ci cout << "Please Input p3:"; 47511fccf17Sopenharmony_ci int32_t p3; 47611fccf17Sopenharmony_ci cin >> p3; 47711fccf17Sopenharmony_ci cout << "Your input p3 is : " << p3 << endl; 47811fccf17Sopenharmony_ci cout << "Please Input command data:"; 47911fccf17Sopenharmony_ci string cmdData; 48011fccf17Sopenharmony_ci cin >> cmdData; 48111fccf17Sopenharmony_ci cout << "Your input command data is : " << cmdData << endl; 48211fccf17Sopenharmony_ci SimIoRequestInfo msg; 48311fccf17Sopenharmony_ci msg.command = curCommand; 48411fccf17Sopenharmony_ci msg.fileId = fileId; 48511fccf17Sopenharmony_ci msg.p1 = p1; 48611fccf17Sopenharmony_ci msg.p2 = p2; 48711fccf17Sopenharmony_ci msg.p3 = p3; 48811fccf17Sopenharmony_ci msg.data = cmdData; 48911fccf17Sopenharmony_ci msg.path = "3F00"; 49011fccf17Sopenharmony_ci msg.pin2 = ""; 49111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetSimIO(slotId, GetSerialId(), msg); 49211fccf17Sopenharmony_ci cout << "RilInterfaceTest::IccRilSimIoForAppTest --> finish ret : " << ret << endl << endl; 49311fccf17Sopenharmony_ci} 49411fccf17Sopenharmony_ci 49511fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmImsiForAppTest(int32_t slotId) 49611fccf17Sopenharmony_ci{ 49711fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmImsiForAppTest -->" << endl; 49811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetImsi(slotId, GetSerialId()); 49911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmImsiForAppTest finish ret : " << ret << endl << endl; 50011fccf17Sopenharmony_ci} 50111fccf17Sopenharmony_ci 50211fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmSignalIntensityTest(int32_t slotId) 50311fccf17Sopenharmony_ci{ 50411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmSignalIntensityTest -->" << endl; 50511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetSignalStrength(slotId, GetSerialId()); 50611fccf17Sopenharmony_ci cout << "GetRilCmSignalIntensityTest finish ret : " << ret << endl << endl; 50711fccf17Sopenharmony_ci} 50811fccf17Sopenharmony_ci 50911fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmIccCardStatusTest(int32_t slotId) 51011fccf17Sopenharmony_ci{ 51111fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmIccCardStatusTest -->" << endl; 51211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetSimStatus(slotId, GetSerialId()); 51311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmIccCardStatusTest finish ret : " << ret << endl << endl; 51411fccf17Sopenharmony_ci} 51511fccf17Sopenharmony_ci 51611fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmCsRegStatusTest(int32_t slotId) 51711fccf17Sopenharmony_ci{ 51811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmCsRegStatusTest -->" << endl; 51911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetCsRegStatus(slotId, GetSerialId()); 52011fccf17Sopenharmony_ci cout << "GetRilCmCsRegStatusTest finish ret : " << ret << endl << endl; 52111fccf17Sopenharmony_ci} 52211fccf17Sopenharmony_ci 52311fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmPsRegStatusTest(int32_t slotId) 52411fccf17Sopenharmony_ci{ 52511fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmPsRegStatusTest -->" << endl; 52611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetPsRegStatus(slotId, GetSerialId()); 52711fccf17Sopenharmony_ci cout << "GetRilCmPsRegStatusTest finish ret : " << ret << endl << endl; 52811fccf17Sopenharmony_ci} 52911fccf17Sopenharmony_ci 53011fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmCellInfoListTest(int32_t slotId) 53111fccf17Sopenharmony_ci{ 53211fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmCellInfoListTest -->" << endl; 53311fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetNeighboringCellInfoList(slotId, GetSerialId()); 53411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmOperatorTest -->" << endl; 53511fccf17Sopenharmony_ci cout << "GetRilCmCellInfoListTest finish ret : " << ret << endl << endl; 53611fccf17Sopenharmony_ci} 53711fccf17Sopenharmony_ci 53811fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCurrentCellInfoTest(int32_t slotId) 53911fccf17Sopenharmony_ci{ 54011fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCurrentCellInfoTest -->" << endl; 54111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetCurrentCellInfo(slotId, GetSerialId()); 54211fccf17Sopenharmony_ci cout << "GetRilCurrentCellInfoTest finish ret : " << ret << endl << endl; 54311fccf17Sopenharmony_ci} 54411fccf17Sopenharmony_ci 54511fccf17Sopenharmony_civoid RilInterfaceTest::GetRilCmOperatorTest(int32_t slotId) 54611fccf17Sopenharmony_ci{ 54711fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilCmOperatorTest -->" << endl; 54811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetOperatorInfo(slotId, GetSerialId()); 54911fccf17Sopenharmony_ci cout << "GetRilCmOperatorTest finish ret : " << ret << endl << endl; 55011fccf17Sopenharmony_ci} 55111fccf17Sopenharmony_ci 55211fccf17Sopenharmony_civoid RilInterfaceTest::GetRilNetworkSearchInfoTest(int32_t slotId) 55311fccf17Sopenharmony_ci{ 55411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilNetworkSearchInfoTest -->" << endl; 55511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetNetworkSearchInformation(slotId, GetSerialId()); 55611fccf17Sopenharmony_ci cout << "GetRilNetworkSearchInfoTest finish ret : " << ret << endl << endl; 55711fccf17Sopenharmony_ci} 55811fccf17Sopenharmony_ci 55911fccf17Sopenharmony_civoid RilInterfaceTest::GetRilNetworkSelectionModeTest(int32_t slotId) 56011fccf17Sopenharmony_ci{ 56111fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilNetworkSelectionModeTest -->" << endl; 56211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetNetworkSelectionMode(slotId, GetSerialId()); 56311fccf17Sopenharmony_ci cout << "GetRilNetworkSelectionModeTest finish ret : " << ret << endl << endl; 56411fccf17Sopenharmony_ci} 56511fccf17Sopenharmony_ci 56611fccf17Sopenharmony_civoid RilInterfaceTest::GetRilPreferredNetwrokTest(int32_t slotId) 56711fccf17Sopenharmony_ci{ 56811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRilPreferredNetwrokTest -->" << endl; 56911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetPreferredNetwork(slotId, GetSerialId()); 57011fccf17Sopenharmony_ci cout << "GetRilPreferredNetwrokTest finish ret : " << ret << endl << endl; 57111fccf17Sopenharmony_ci} 57211fccf17Sopenharmony_ci 57311fccf17Sopenharmony_civoid RilInterfaceTest::SetRilPreferredNetworkTest(int32_t slotId) 57411fccf17Sopenharmony_ci{ 57511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRilPreferredNetworkTest -->" << endl; 57611fccf17Sopenharmony_ci 57711fccf17Sopenharmony_ci int32_t preferredNetwork; 57811fccf17Sopenharmony_ci cout << "please enter the preferredNetwork:"; 57911fccf17Sopenharmony_ci cin >> preferredNetwork; 58011fccf17Sopenharmony_ci cout << preferredNetwork << endl; 58111fccf17Sopenharmony_ci 58211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetPreferredNetwork(slotId, GetSerialId(), preferredNetwork); 58311fccf17Sopenharmony_ci cout << "SetRilPreferredNetworkTest finish ret : " << ret << endl << endl; 58411fccf17Sopenharmony_ci} 58511fccf17Sopenharmony_ci 58611fccf17Sopenharmony_civoid RilInterfaceTest::SetRilLocationUpdateTest(int32_t slotId) 58711fccf17Sopenharmony_ci{ 58811fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRilLocationUpdateTest -->" << endl; 58911fccf17Sopenharmony_ci 59011fccf17Sopenharmony_ci int32_t mode; 59111fccf17Sopenharmony_ci cout << "please enter the mode[0-2]:"; 59211fccf17Sopenharmony_ci cin >> mode; 59311fccf17Sopenharmony_ci cout << mode << endl; 59411fccf17Sopenharmony_ci 59511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetLocateUpdates(slotId, GetSerialId(), static_cast<RilRegNotifyMode>(mode)); 59611fccf17Sopenharmony_ci cout << "SetRilLocationUpdateTest finish ret : " << ret << endl << endl; 59711fccf17Sopenharmony_ci} 59811fccf17Sopenharmony_ci 59911fccf17Sopenharmony_civoid RilInterfaceTest::SetRilNotificationFilterTest(int32_t slotId) 60011fccf17Sopenharmony_ci{ 60111fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRilNotificationFilterTest -->" << endl; 60211fccf17Sopenharmony_ci 60311fccf17Sopenharmony_ci int32_t filter; 60411fccf17Sopenharmony_ci cout << "please enter the filter:"; 60511fccf17Sopenharmony_ci cin >> filter; 60611fccf17Sopenharmony_ci cout << filter << endl; 60711fccf17Sopenharmony_ci 60811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetNotificationFilter(slotId, GetSerialId(), filter); 60911fccf17Sopenharmony_ci cout << "SetRilNotificationFilterTest finish ret : " << ret << endl << endl; 61011fccf17Sopenharmony_ci} 61111fccf17Sopenharmony_ci 61211fccf17Sopenharmony_civoid RilInterfaceTest::SetRilDeviceStateTest(int32_t slotId) 61311fccf17Sopenharmony_ci{ 61411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRilDeviceStateTest -->" << endl; 61511fccf17Sopenharmony_ci 61611fccf17Sopenharmony_ci int32_t deviceStateType; 61711fccf17Sopenharmony_ci bool deviceStateOn; 61811fccf17Sopenharmony_ci 61911fccf17Sopenharmony_ci cout << "please enter the deviceStateType:" << endl; 62011fccf17Sopenharmony_ci cin >> deviceStateType; 62111fccf17Sopenharmony_ci cout << deviceStateType << endl; 62211fccf17Sopenharmony_ci cout << "please enter the deviceStateOn:" << endl; 62311fccf17Sopenharmony_ci cin >> deviceStateOn; 62411fccf17Sopenharmony_ci cout << deviceStateOn << endl; 62511fccf17Sopenharmony_ci 62611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetDeviceState(slotId, GetSerialId(), deviceStateType, deviceStateOn); 62711fccf17Sopenharmony_ci cout << "SetRilDeviceStateTest finish ret : " << ret << endl << endl; 62811fccf17Sopenharmony_ci} 62911fccf17Sopenharmony_ci 63011fccf17Sopenharmony_civoid RilInterfaceTest::SetNrOptionModeTest(int32_t slotId) 63111fccf17Sopenharmony_ci{ 63211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetNrOptionModeTest -->" << endl; 63311fccf17Sopenharmony_ci 63411fccf17Sopenharmony_ci int32_t mode; 63511fccf17Sopenharmony_ci cout << "please enter the mode:" << endl; 63611fccf17Sopenharmony_ci cin >> mode; 63711fccf17Sopenharmony_ci cout << mode << endl; 63811fccf17Sopenharmony_ci 63911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetNrOptionMode(slotId, GetSerialId(), mode); 64011fccf17Sopenharmony_ci cout << "SetNrOptionModeTest finish ret : " << ret << endl << endl; 64111fccf17Sopenharmony_ci} 64211fccf17Sopenharmony_ci 64311fccf17Sopenharmony_civoid RilInterfaceTest::GetNrOptionModeTest(int32_t slotId) 64411fccf17Sopenharmony_ci{ 64511fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetNrOptionModeTest -->" << endl; 64611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetNrOptionMode(slotId, GetSerialId()); 64711fccf17Sopenharmony_ci cout << "GetNrOptionModeTest finish ret : " << ret << endl << endl; 64811fccf17Sopenharmony_ci} 64911fccf17Sopenharmony_ci 65011fccf17Sopenharmony_civoid RilInterfaceTest::GetRrcConnectionStateTest(int32_t slotId) 65111fccf17Sopenharmony_ci{ 65211fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRrcConnectionStateTest -->" << endl; 65311fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetRrcConnectionState(slotId, GetSerialId()); 65411fccf17Sopenharmony_ci cout << "GetRrcConnectionStateTest finish ret : " << ret << endl << endl; 65511fccf17Sopenharmony_ci} 65611fccf17Sopenharmony_ci 65711fccf17Sopenharmony_civoid RilInterfaceTest::GetNrSsbIdTest(int32_t slotId) 65811fccf17Sopenharmony_ci{ 65911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetNrSsbIdTest -->" << endl; 66011fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetNrSsbId(slotId, GetSerialId()); 66111fccf17Sopenharmony_ci cout << "GetNrSsbIdTest finish ret : " << ret << endl << endl; 66211fccf17Sopenharmony_ci} 66311fccf17Sopenharmony_ci 66411fccf17Sopenharmony_civoid RilInterfaceTest::SetRilNetworkSelectionModeTest(int32_t slotId) 66511fccf17Sopenharmony_ci{ 66611fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRilNetworkSelectionModeTest -->" << endl; 66711fccf17Sopenharmony_ci 66811fccf17Sopenharmony_ci int32_t mode; 66911fccf17Sopenharmony_ci std::string oper; 67011fccf17Sopenharmony_ci int64_t flag; 67111fccf17Sopenharmony_ci cout << "please enter the mode:"; 67211fccf17Sopenharmony_ci cin >> mode; 67311fccf17Sopenharmony_ci cout << mode << endl; 67411fccf17Sopenharmony_ci 67511fccf17Sopenharmony_ci if (mode != 0) { 67611fccf17Sopenharmony_ci cout << "please enter the operator:"; 67711fccf17Sopenharmony_ci cin >> oper; 67811fccf17Sopenharmony_ci cout << oper << endl; 67911fccf17Sopenharmony_ci } 68011fccf17Sopenharmony_ci cout << "please enter the flag:"; 68111fccf17Sopenharmony_ci cin >> flag; 68211fccf17Sopenharmony_ci cout << flag << endl; 68311fccf17Sopenharmony_ci SetNetworkModeInfo networkModeInfo = {}; 68411fccf17Sopenharmony_ci networkModeInfo.selectMode = mode; 68511fccf17Sopenharmony_ci networkModeInfo.oper = oper; 68611fccf17Sopenharmony_ci networkModeInfo.flag = flag; 68711fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetNetworkSelectionMode(slotId, GetSerialId(), networkModeInfo); 68811fccf17Sopenharmony_ci cout << "SetRilNetworkSelectionModeTest finish ret : " << ret << endl << endl; 68911fccf17Sopenharmony_ci} 69011fccf17Sopenharmony_ci 69111fccf17Sopenharmony_civoid RilInterfaceTest::GetPhysicalChannelConfigTest(int32_t slotId) 69211fccf17Sopenharmony_ci{ 69311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetPhysicalChannelConfigTest -->" << endl; 69411fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetPhysicalChannelConfig(slotId, GetSerialId()); 69511fccf17Sopenharmony_ci cout << "GetPhysicalChannelConfigTest finish ret : " << ret << endl << endl; 69611fccf17Sopenharmony_ci} 69711fccf17Sopenharmony_ci 69811fccf17Sopenharmony_civoid RilInterfaceTest::SendRilCmSmsTest(int32_t slotId) 69911fccf17Sopenharmony_ci{ 70011fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendRilCmSmsTest -->" << endl; 70111fccf17Sopenharmony_ci string smscPdu; 70211fccf17Sopenharmony_ci string pdu; 70311fccf17Sopenharmony_ci int32_t state; 70411fccf17Sopenharmony_ci 70511fccf17Sopenharmony_ci cout << "please entry smsc(Pdu):" << endl; 70611fccf17Sopenharmony_ci cin >> smscPdu; 70711fccf17Sopenharmony_ci cout << "please entry sms message(Pdu):" << endl; 70811fccf17Sopenharmony_ci cin >> pdu; 70911fccf17Sopenharmony_ci cout << "please entry sms message state:" << endl; 71011fccf17Sopenharmony_ci cin >> state; 71111fccf17Sopenharmony_ci 71211fccf17Sopenharmony_ci GsmSmsMessageInfo gsmSmsMessageInfo; 71311fccf17Sopenharmony_ci gsmSmsMessageInfo.serial = GetSerialId(); 71411fccf17Sopenharmony_ci gsmSmsMessageInfo.smscPdu = smscPdu; 71511fccf17Sopenharmony_ci gsmSmsMessageInfo.pdu = pdu; 71611fccf17Sopenharmony_ci gsmSmsMessageInfo.state = state; 71711fccf17Sopenharmony_ci 71811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendGsmSms(slotId, GetSerialId(), gsmSmsMessageInfo); 71911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendRilCmSmsTest --> SendRilCmSmsTest finished ret:" << ret << endl << endl; 72011fccf17Sopenharmony_ci} 72111fccf17Sopenharmony_ci 72211fccf17Sopenharmony_civoid RilInterfaceTest::SendRilCmSmsMoreModeTest(int32_t slotId) 72311fccf17Sopenharmony_ci{ 72411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendRilCmSmsMoreModeTest -->" << endl; 72511fccf17Sopenharmony_ci string smscPdu; 72611fccf17Sopenharmony_ci string pdu; 72711fccf17Sopenharmony_ci int32_t state; 72811fccf17Sopenharmony_ci 72911fccf17Sopenharmony_ci cout << "please entry smsc(Pdu):" << endl; 73011fccf17Sopenharmony_ci cin >> smscPdu; 73111fccf17Sopenharmony_ci cout << "please entry sms message(Pdu):" << endl; 73211fccf17Sopenharmony_ci cin >> pdu; 73311fccf17Sopenharmony_ci cout << "please entry sms message state:" << endl; 73411fccf17Sopenharmony_ci cin >> state; 73511fccf17Sopenharmony_ci 73611fccf17Sopenharmony_ci GsmSmsMessageInfo gsmSmsMessageInfo; 73711fccf17Sopenharmony_ci gsmSmsMessageInfo.serial = GetSerialId(); 73811fccf17Sopenharmony_ci gsmSmsMessageInfo.smscPdu = smscPdu; 73911fccf17Sopenharmony_ci gsmSmsMessageInfo.pdu = pdu; 74011fccf17Sopenharmony_ci gsmSmsMessageInfo.state = state; 74111fccf17Sopenharmony_ci 74211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendGsmSms(slotId, GetSerialId(), gsmSmsMessageInfo); 74311fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendRilCmSmsMoreModeTest --> SendRilCmSmsMoreModeTest finished ret:" << ret << endl 74411fccf17Sopenharmony_ci << endl; 74511fccf17Sopenharmony_ci} 74611fccf17Sopenharmony_ci 74711fccf17Sopenharmony_civoid RilInterfaceTest::SendSmsAckTest(int32_t slotId) 74811fccf17Sopenharmony_ci{ 74911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendSmsAckTest -->" << endl; 75011fccf17Sopenharmony_ci const int32_t memExceededCause = 0xD3; 75111fccf17Sopenharmony_ci bool success; 75211fccf17Sopenharmony_ci int32_t cause; 75311fccf17Sopenharmony_ci string pdu; 75411fccf17Sopenharmony_ci 75511fccf17Sopenharmony_ci cout << "send sms ack types are as follows:" << endl 75611fccf17Sopenharmony_ci << "\t[0]: report OK" << endl 75711fccf17Sopenharmony_ci << "\t[1]: report ERROR(Memory Capacity Exceeded)" << endl; 75811fccf17Sopenharmony_ci int32_t ackType = InputInt32(0, 1, "ack type"); 75911fccf17Sopenharmony_ci if (ackType == 1) { 76011fccf17Sopenharmony_ci success = 0; 76111fccf17Sopenharmony_ci cause = memExceededCause; 76211fccf17Sopenharmony_ci } else { 76311fccf17Sopenharmony_ci success = 1; 76411fccf17Sopenharmony_ci cause = 0; 76511fccf17Sopenharmony_ci } 76611fccf17Sopenharmony_ci cout << "please entry sms message(Pdu):" << endl; 76711fccf17Sopenharmony_ci cin >> pdu; 76811fccf17Sopenharmony_ci 76911fccf17Sopenharmony_ci ModeData modeData; 77011fccf17Sopenharmony_ci modeData.serial = GetSerialId(); 77111fccf17Sopenharmony_ci modeData.result = success; 77211fccf17Sopenharmony_ci modeData.mode = cause; 77311fccf17Sopenharmony_ci modeData.pdu = pdu; 77411fccf17Sopenharmony_ci 77511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendSmsAck(slotId, GetSerialId(), modeData); 77611fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendSmsAckTest --> SendSmsAckTest finished ret:" << ret << endl << endl; 77711fccf17Sopenharmony_ci} 77811fccf17Sopenharmony_ci 77911fccf17Sopenharmony_civoid RilInterfaceTest::GetSmscAddrTest(int32_t slotId) 78011fccf17Sopenharmony_ci{ 78111fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetSmscAddrTest -->" << endl; 78211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetSmscAddr(slotId, GetSerialId()); 78311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetSmscAddrTest --> GetSmscAddrTest finished ret:" << ret << endl << endl; 78411fccf17Sopenharmony_ci} 78511fccf17Sopenharmony_ci 78611fccf17Sopenharmony_civoid RilInterfaceTest::SetSmscAddrTest(int32_t slotId) 78711fccf17Sopenharmony_ci{ 78811fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetSmscAddrTest -->" << endl; 78911fccf17Sopenharmony_ci int32_t tosca; 79011fccf17Sopenharmony_ci string address; 79111fccf17Sopenharmony_ci cout << "please entry tosca:" << endl; 79211fccf17Sopenharmony_ci cin >> tosca; 79311fccf17Sopenharmony_ci cout << "please entry smsc:" << endl; 79411fccf17Sopenharmony_ci cin >> address; 79511fccf17Sopenharmony_ci 79611fccf17Sopenharmony_ci ServiceCenterAddress serviceCenterAddress; 79711fccf17Sopenharmony_ci serviceCenterAddress.serial = GetSerialId(); 79811fccf17Sopenharmony_ci serviceCenterAddress.tosca = tosca; 79911fccf17Sopenharmony_ci serviceCenterAddress.address = address; 80011fccf17Sopenharmony_ci 80111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetSmscAddr(slotId, GetSerialId(), serviceCenterAddress); 80211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetSmscAddrTest --> SetSmscAddrTest finished ret:" << ret << endl << endl; 80311fccf17Sopenharmony_ci} 80411fccf17Sopenharmony_ci 80511fccf17Sopenharmony_civoid RilInterfaceTest::GetImeiTest(int32_t slotId) 80611fccf17Sopenharmony_ci{ 80711fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiTest -->" << endl; 80811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetImei(slotId, GetSerialId()); 80911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiTest finish ret : " << ret << endl << endl; 81011fccf17Sopenharmony_ci} 81111fccf17Sopenharmony_ci 81211fccf17Sopenharmony_civoid RilInterfaceTest::GetImeiStressTest(int32_t slotId) 81311fccf17Sopenharmony_ci{ 81411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiStressTest -->" << endl; 81511fccf17Sopenharmony_ci for (int32_t i = 0; i < STRESS_TEST_NUM; i++) { 81611fccf17Sopenharmony_ci g_rilInterface->GetImei(slotId, GetSerialId()); 81711fccf17Sopenharmony_ci } 81811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiStressTest --> GetImeiStressTest finished" << endl << endl; 81911fccf17Sopenharmony_ci} 82011fccf17Sopenharmony_ci 82111fccf17Sopenharmony_civoid RilInterfaceTest::GetImeiSvTest(int32_t slotId) 82211fccf17Sopenharmony_ci{ 82311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiSvTest -->" << endl; 82411fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetImeiSv(slotId, GetSerialId()); 82511fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiSvTest finish ret : " << ret << endl << endl; 82611fccf17Sopenharmony_ci} 82711fccf17Sopenharmony_ci 82811fccf17Sopenharmony_civoid RilInterfaceTest::GetImeiSvStressTest(int32_t slotId) 82911fccf17Sopenharmony_ci{ 83011fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiSvStressTest -->" << endl; 83111fccf17Sopenharmony_ci for (int32_t i = 0; i < STRESS_TEST_NUM; i++) { 83211fccf17Sopenharmony_ci g_rilInterface->GetImeiSv(slotId, GetSerialId()); 83311fccf17Sopenharmony_ci } 83411fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetImeiSvStressTest --> GetImeiSvStressTest finished" << endl << endl; 83511fccf17Sopenharmony_ci} 83611fccf17Sopenharmony_ci 83711fccf17Sopenharmony_civoid RilInterfaceTest::GetMeidTest(int32_t slotId) 83811fccf17Sopenharmony_ci{ 83911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetMeidTest -->" << endl; 84011fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetMeid(slotId, GetSerialId()); 84111fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetMeidTestfinish ret : " << ret << endl << endl; 84211fccf17Sopenharmony_ci} 84311fccf17Sopenharmony_ci 84411fccf17Sopenharmony_civoid RilInterfaceTest::GetVoiceRadioTechnologyTest(int32_t slotId) 84511fccf17Sopenharmony_ci{ 84611fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetVoiceRadioTechnologyTest -->" << endl; 84711fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetVoiceRadioTechnology(slotId, GetSerialId()); 84811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetVoiceRadioTechnologyTestfinish ret : " << ret << endl << endl; 84911fccf17Sopenharmony_ci} 85011fccf17Sopenharmony_ci 85111fccf17Sopenharmony_civoid RilInterfaceTest::GetBasebandVersionTest(int32_t slotId) 85211fccf17Sopenharmony_ci{ 85311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetBasebandVersionTest -->" << endl; 85411fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetBasebandVersion(slotId, GetSerialId()); 85511fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetBasebandVersionTestfinish ret : " << ret << endl << endl; 85611fccf17Sopenharmony_ci} 85711fccf17Sopenharmony_ci 85811fccf17Sopenharmony_civoid RilInterfaceTest::ShutDownTest(int32_t slotId) 85911fccf17Sopenharmony_ci{ 86011fccf17Sopenharmony_ci cout << "RilInterfaceTest::ShutDownTest -->" << endl; 86111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->ShutDown(slotId, GetSerialId()); 86211fccf17Sopenharmony_ci cout << "RilInterfaceTest::ShutDownTestfinish ret : " << ret << endl << endl; 86311fccf17Sopenharmony_ci} 86411fccf17Sopenharmony_ci 86511fccf17Sopenharmony_civoid RilInterfaceTest::SetRadioStateTest(int32_t slotId) 86611fccf17Sopenharmony_ci{ 86711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRadioStateTest -->" << endl; 86811fccf17Sopenharmony_ci int32_t fun = InputInt32(0, 0x7fffffff, "fun"); 86911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetRadioState(slotId, GetSerialId(), fun, 0); 87011fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRadioStateTest finish ret : " << ret << endl << endl; 87111fccf17Sopenharmony_ci} 87211fccf17Sopenharmony_ci 87311fccf17Sopenharmony_civoid RilInterfaceTest::SetRadioStateStressTest(int32_t slotId) 87411fccf17Sopenharmony_ci{ 87511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRadioStateStressTest -->" << endl; 87611fccf17Sopenharmony_ci for (int32_t i = 0; i < STRESS_TEST_NUM; i++) { 87711fccf17Sopenharmony_ci g_rilInterface->SetRadioState(slotId, GetSerialId(), 0, 0); 87811fccf17Sopenharmony_ci g_rilInterface->SetRadioState(slotId, GetSerialId(), 1, 0); 87911fccf17Sopenharmony_ci } 88011fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetRadioStateStressTest --> SetRadioStateStressTest finished" << endl << endl; 88111fccf17Sopenharmony_ci} 88211fccf17Sopenharmony_ci 88311fccf17Sopenharmony_civoid RilInterfaceTest::GetRadioStateTest(int32_t slotId) 88411fccf17Sopenharmony_ci{ 88511fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRadioStateTest -->" << endl; 88611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetRadioState(slotId, GetSerialId()); 88711fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetRadioStateTest finish ret : " << ret << endl << endl; 88811fccf17Sopenharmony_ci} 88911fccf17Sopenharmony_ci 89011fccf17Sopenharmony_civoid RilInterfaceTest::ActivatePdpContextTest(int32_t slotId) 89111fccf17Sopenharmony_ci{ 89211fccf17Sopenharmony_ci cout << "RilInterfaceTest::ActivatePdpContextTest -->" << endl; 89311fccf17Sopenharmony_ci int32_t serialId = GetSerialId(); 89411fccf17Sopenharmony_ci DataProfileDataInfo dataProfileInfo; 89511fccf17Sopenharmony_ci dataProfileInfo.profileId = 0; 89611fccf17Sopenharmony_ci dataProfileInfo.password = ""; 89711fccf17Sopenharmony_ci dataProfileInfo.authenticationType = 0; 89811fccf17Sopenharmony_ci dataProfileInfo.userName = ""; 89911fccf17Sopenharmony_ci dataProfileInfo.apn = "cmnet"; 90011fccf17Sopenharmony_ci dataProfileInfo.protocol = "IPV4V6"; 90111fccf17Sopenharmony_ci dataProfileInfo.roamingProtocol = "IPV4V6"; 90211fccf17Sopenharmony_ci 90311fccf17Sopenharmony_ci cout << "please enter the apn:"; 90411fccf17Sopenharmony_ci cin >> dataProfileInfo.apn; 90511fccf17Sopenharmony_ci cout << "please enter the username:"; 90611fccf17Sopenharmony_ci cin >> dataProfileInfo.userName; 90711fccf17Sopenharmony_ci cout << "please enter the password:"; 90811fccf17Sopenharmony_ci cin >> dataProfileInfo.password; 90911fccf17Sopenharmony_ci cout << "please enter the protocol:"; 91011fccf17Sopenharmony_ci cin >> dataProfileInfo.protocol; 91111fccf17Sopenharmony_ci 91211fccf17Sopenharmony_ci DataCallInfo dataCallInfo; 91311fccf17Sopenharmony_ci dataCallInfo.serial = serialId; 91411fccf17Sopenharmony_ci dataCallInfo.radioTechnology = 0; 91511fccf17Sopenharmony_ci dataCallInfo.dataProfileInfo = dataProfileInfo; 91611fccf17Sopenharmony_ci dataCallInfo.roamingAllowed = true; 91711fccf17Sopenharmony_ci dataCallInfo.isRoaming = false; 91811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->ActivatePdpContext(slotId, serialId, dataCallInfo); 91911fccf17Sopenharmony_ci cout << "ActivatePdpContextTest finished ret : " << ret << endl << endl; 92011fccf17Sopenharmony_ci} 92111fccf17Sopenharmony_ci 92211fccf17Sopenharmony_civoid RilInterfaceTest::SetDataProfileInfoTest(int32_t slotId) 92311fccf17Sopenharmony_ci{ 92411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetDataProfileInfoTest -->" << endl; 92511fccf17Sopenharmony_ci int32_t size = 0; 92611fccf17Sopenharmony_ci cout << "please enter the profile size:"; 92711fccf17Sopenharmony_ci cin >> size; 92811fccf17Sopenharmony_ci int32_t serialId = GetSerialId(); 92911fccf17Sopenharmony_ci DataProfilesInfo dataProfilesInfo; 93011fccf17Sopenharmony_ci dataProfilesInfo.serial = serialId; 93111fccf17Sopenharmony_ci dataProfilesInfo.profilesSize = size; 93211fccf17Sopenharmony_ci for (int32_t i = 0; i < size; i++) { 93311fccf17Sopenharmony_ci string apn; 93411fccf17Sopenharmony_ci cout << "please enter the apn:"; 93511fccf17Sopenharmony_ci cin >> apn; 93611fccf17Sopenharmony_ci string username; 93711fccf17Sopenharmony_ci 93811fccf17Sopenharmony_ci cout << "please enter the username:"; 93911fccf17Sopenharmony_ci cin >> username; 94011fccf17Sopenharmony_ci 94111fccf17Sopenharmony_ci string dataInfoPwd; 94211fccf17Sopenharmony_ci cout << "please enter the password:"; 94311fccf17Sopenharmony_ci cin >> dataInfoPwd; 94411fccf17Sopenharmony_ci 94511fccf17Sopenharmony_ci string protocol; 94611fccf17Sopenharmony_ci cout << "please enter the protocol:"; 94711fccf17Sopenharmony_ci cin >> protocol; 94811fccf17Sopenharmony_ci DataProfileDataInfo dataInfo; 94911fccf17Sopenharmony_ci dataInfo.serial = serialId; 95011fccf17Sopenharmony_ci dataInfo.profileId = i; 95111fccf17Sopenharmony_ci dataInfo.apn = apn; 95211fccf17Sopenharmony_ci dataInfo.protocol = protocol; 95311fccf17Sopenharmony_ci dataInfo.roamingProtocol = "IPV4V6"; 95411fccf17Sopenharmony_ci dataInfo.authenticationType = 0; 95511fccf17Sopenharmony_ci dataInfo.userName = username; 95611fccf17Sopenharmony_ci dataInfo.password = dataInfoPwd; 95711fccf17Sopenharmony_ci dataProfilesInfo.profiles.push_back(dataInfo); 95811fccf17Sopenharmony_ci } 95911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetDataProfileInfo(slotId, serialId, dataProfilesInfo); 96011fccf17Sopenharmony_ci cout << "SetDataProfileInfoTest finished ret : " << ret << endl << endl; 96111fccf17Sopenharmony_ci} 96211fccf17Sopenharmony_ci 96311fccf17Sopenharmony_civoid RilInterfaceTest::SetDataPermittedTest(int32_t slotId) 96411fccf17Sopenharmony_ci{ 96511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetDataPermittedTestTest -->" << endl; 96611fccf17Sopenharmony_ci int32_t enabled = 0; 96711fccf17Sopenharmony_ci cout << "please enter the enabled:"; 96811fccf17Sopenharmony_ci cin >> enabled; 96911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetDataPermitted(slotId, GetSerialId(), enabled); 97011fccf17Sopenharmony_ci cout << "SetDataPermittedTest finished ret : " << ret << endl << endl; 97111fccf17Sopenharmony_ci} 97211fccf17Sopenharmony_ci 97311fccf17Sopenharmony_civoid RilInterfaceTest::SendDataPerformanceModeTest(int32_t slotId) 97411fccf17Sopenharmony_ci{ 97511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendDataPerformanceModeTest -->" << endl; 97611fccf17Sopenharmony_ci DataPerformanceInfo dataPerformanceInfo; 97711fccf17Sopenharmony_ci cout << "please enter the performanceEnable:"; 97811fccf17Sopenharmony_ci cin >> dataPerformanceInfo.performanceEnable; 97911fccf17Sopenharmony_ci cout << "please enter the enforce:"; 98011fccf17Sopenharmony_ci cin >> dataPerformanceInfo.enforce; 98111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendDataPerformanceMode(slotId, GetSerialId(), dataPerformanceInfo); 98211fccf17Sopenharmony_ci cout << "SendDataPerformanceModeTest finished ret : " << ret << endl << endl; 98311fccf17Sopenharmony_ci} 98411fccf17Sopenharmony_ci 98511fccf17Sopenharmony_civoid RilInterfaceTest::SendDataSleepModeTest(int32_t slotId) 98611fccf17Sopenharmony_ci{ 98711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendDataSleepModeTest -->" << endl; 98811fccf17Sopenharmony_ci DataSleepInfo dataSleepInfo; 98911fccf17Sopenharmony_ci cout << "please enter the sleepEnable:"; 99011fccf17Sopenharmony_ci cin >> dataSleepInfo.sleepEnable; 99111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendDataSleepMode(slotId, GetSerialId(), dataSleepInfo); 99211fccf17Sopenharmony_ci cout << "SendDataSleepModeTest finished ret : " << ret << endl << endl; 99311fccf17Sopenharmony_ci} 99411fccf17Sopenharmony_ci 99511fccf17Sopenharmony_civoid RilInterfaceTest::DeactivatePdpContextTest(int32_t slotId) 99611fccf17Sopenharmony_ci{ 99711fccf17Sopenharmony_ci cout << "RilInterfaceTest::DeactivatePdpContextTest -->" << endl; 99811fccf17Sopenharmony_ci UniInfo uniInfo; 99911fccf17Sopenharmony_ci cout << "please enter the cid:"; 100011fccf17Sopenharmony_ci cin >> uniInfo.gsmIndex; 100111fccf17Sopenharmony_ci cout << "please enter the reason:"; 100211fccf17Sopenharmony_ci cin >> uniInfo.arg1; 100311fccf17Sopenharmony_ci int32_t ret = g_rilInterface->DeactivatePdpContext(slotId, GetSerialId(), uniInfo); 100411fccf17Sopenharmony_ci cout << "DeactivatePdpContextTest finished ret : " << ret << endl << endl; 100511fccf17Sopenharmony_ci} 100611fccf17Sopenharmony_ci 100711fccf17Sopenharmony_civoid RilInterfaceTest::GetPdpContextListTest(int32_t slotId) 100811fccf17Sopenharmony_ci{ 100911fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetPdpContextListTest -->" << endl; 101011fccf17Sopenharmony_ci int32_t serialId = GetSerialId(); 101111fccf17Sopenharmony_ci UniInfo uniInfo; 101211fccf17Sopenharmony_ci uniInfo.serial = serialId; 101311fccf17Sopenharmony_ci cout << "please enter the cid:"; 101411fccf17Sopenharmony_ci cin >> uniInfo.gsmIndex; 101511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetPdpContextList(slotId, serialId, uniInfo); 101611fccf17Sopenharmony_ci cout << "GetPdpContextListTest finished ret : " << ret << endl << endl; 101711fccf17Sopenharmony_ci} 101811fccf17Sopenharmony_ci 101911fccf17Sopenharmony_civoid RilInterfaceTest::SetInitialApnTest(int32_t slotId) 102011fccf17Sopenharmony_ci{ 102111fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetInitialApnTest -->" << endl; 102211fccf17Sopenharmony_ci int32_t serialId = GetSerialId(); 102311fccf17Sopenharmony_ci DataProfileDataInfo dataProfileInfo; 102411fccf17Sopenharmony_ci dataProfileInfo.profileId = 0; 102511fccf17Sopenharmony_ci dataProfileInfo.password = ""; 102611fccf17Sopenharmony_ci dataProfileInfo.authenticationType = 0; 102711fccf17Sopenharmony_ci dataProfileInfo.userName = ""; 102811fccf17Sopenharmony_ci dataProfileInfo.apn = "cmnet"; 102911fccf17Sopenharmony_ci dataProfileInfo.protocol = "IPV4V6"; 103011fccf17Sopenharmony_ci dataProfileInfo.roamingProtocol = "IPV4V6"; 103111fccf17Sopenharmony_ci dataProfileInfo.serial = serialId; 103211fccf17Sopenharmony_ci 103311fccf17Sopenharmony_ci cout << "please enter the apn:"; 103411fccf17Sopenharmony_ci cin >> dataProfileInfo.apn; 103511fccf17Sopenharmony_ci cout << "please enter the username:"; 103611fccf17Sopenharmony_ci cin >> dataProfileInfo.userName; 103711fccf17Sopenharmony_ci cout << "please enter the password:"; 103811fccf17Sopenharmony_ci cin >> dataProfileInfo.password; 103911fccf17Sopenharmony_ci cout << "please enter the protocol:"; 104011fccf17Sopenharmony_ci cin >> dataProfileInfo.protocol; 104111fccf17Sopenharmony_ci 104211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetInitApnInfo(slotId, serialId, dataProfileInfo); 104311fccf17Sopenharmony_ci cout << "SetInitialApnTest finished ret : " << ret << endl << endl; 104411fccf17Sopenharmony_ci} 104511fccf17Sopenharmony_ci 104611fccf17Sopenharmony_civoid RilInterfaceTest::GetLinkBandwidthInfoTest(int32_t slotId) 104711fccf17Sopenharmony_ci{ 104811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetLinkBandwidthInfoTest -->" << endl; 104911fccf17Sopenharmony_ci int32_t cid; 105011fccf17Sopenharmony_ci cout << "please enter the cid:"; 105111fccf17Sopenharmony_ci cin >> cid; 105211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetLinkBandwidthInfo(slotId, GetSerialId(), cid); 105311fccf17Sopenharmony_ci cout << "GetLinkBandwidthInfoTest finished ret : " << ret << endl << endl; 105411fccf17Sopenharmony_ci} 105511fccf17Sopenharmony_ci 105611fccf17Sopenharmony_civoid RilInterfaceTest::GetLinkCapabilityTest(int32_t slotId) 105711fccf17Sopenharmony_ci{ 105811fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetLinkCapabilityTest -->" << endl; 105911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetLinkCapability(slotId, GetSerialId()); 106011fccf17Sopenharmony_ci cout << "GetLinkCapabilityTest finished ret : " << ret << endl << endl; 106111fccf17Sopenharmony_ci} 106211fccf17Sopenharmony_ci 106311fccf17Sopenharmony_civoid RilInterfaceTest::CleanAllConnectionsTest(int32_t slotId) 106411fccf17Sopenharmony_ci{ 106511fccf17Sopenharmony_ci cout << "RilInterfaceTest::CleanAllConnectionsTest -->" << endl; 106611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->CleanAllConnections(slotId, GetSerialId()); 106711fccf17Sopenharmony_ci cout << "CleanAllConnectionsTest finished ret : " << ret << endl << endl; 106811fccf17Sopenharmony_ci} 106911fccf17Sopenharmony_ci 107011fccf17Sopenharmony_civoid RilInterfaceTest::SetLinkBandwidthReportingRuleTest(int32_t slotId) 107111fccf17Sopenharmony_ci{ 107211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetLinkBandwidthReportingRuleTest -->" << endl; 107311fccf17Sopenharmony_ci int32_t serialId = GetSerialId(); 107411fccf17Sopenharmony_ci uint32_t uplinkKbpsSize = sizeof(MAX_UPLINK_LINK_BANDWIDTH) / sizeof(int32_t); 107511fccf17Sopenharmony_ci uint32_t downlinkKbpsSize = sizeof(MAX_DOWNLINK_LINK_BANDWIDTH) / sizeof(int32_t); 107611fccf17Sopenharmony_ci DataLinkBandwidthReportingRule dLinkBandwidth; 107711fccf17Sopenharmony_ci dLinkBandwidth.serial = serialId; 107811fccf17Sopenharmony_ci dLinkBandwidth.rat = RAT_TYPE_LTE; 107911fccf17Sopenharmony_ci dLinkBandwidth.delayMs = BANDWIDTH_HYSTERESIS_MS; 108011fccf17Sopenharmony_ci dLinkBandwidth.delayUplinkKbps = BANDWIDTH_HYSTERESIS_KBPS; 108111fccf17Sopenharmony_ci dLinkBandwidth.delayDownlinkKbps = BANDWIDTH_HYSTERESIS_KBPS; 108211fccf17Sopenharmony_ci dLinkBandwidth.maximumUplinkKbpsSize = uplinkKbpsSize; 108311fccf17Sopenharmony_ci dLinkBandwidth.maximumDownlinkKbpsSize = downlinkKbpsSize; 108411fccf17Sopenharmony_ci for (uint32_t i = 0; i < uplinkKbpsSize; i++) { 108511fccf17Sopenharmony_ci dLinkBandwidth.maximumUplinkKbps.push_back(MAX_UPLINK_LINK_BANDWIDTH[i]); 108611fccf17Sopenharmony_ci } 108711fccf17Sopenharmony_ci for (uint32_t i = 0; i < downlinkKbpsSize; i++) { 108811fccf17Sopenharmony_ci dLinkBandwidth.maximumDownlinkKbps.push_back(MAX_DOWNLINK_LINK_BANDWIDTH[i]); 108911fccf17Sopenharmony_ci } 109011fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetLinkBandwidthReportingRule(slotId, serialId, dLinkBandwidth); 109111fccf17Sopenharmony_ci cout << "SetLinkBandwidthReportingRuleTest finished ret : " << ret << endl << endl; 109211fccf17Sopenharmony_ci} 109311fccf17Sopenharmony_ci 109411fccf17Sopenharmony_civoid RilInterfaceTest::OnProcessInput(int32_t what) 109511fccf17Sopenharmony_ci{ 109611fccf17Sopenharmony_ci if (g_rilInterface == nullptr) { 109711fccf17Sopenharmony_ci cout << "g_rilInterface is null"; 109811fccf17Sopenharmony_ci return; 109911fccf17Sopenharmony_ci } 110011fccf17Sopenharmony_ci auto itFunc = memberFuncMap_.find(what); 110111fccf17Sopenharmony_ci if (itFunc != memberFuncMap_.end()) { 110211fccf17Sopenharmony_ci auto memberFunc = itFunc->second; 110311fccf17Sopenharmony_ci if (memberFunc != nullptr) { 110411fccf17Sopenharmony_ci cout << "Please input slotId:"; 110511fccf17Sopenharmony_ci int32_t slotId; 110611fccf17Sopenharmony_ci cin >> slotId; 110711fccf17Sopenharmony_ci (this->*memberFunc)(slotId); 110811fccf17Sopenharmony_ci return; 110911fccf17Sopenharmony_ci } 111011fccf17Sopenharmony_ci } 111111fccf17Sopenharmony_ci 111211fccf17Sopenharmony_ci cout << "----> Unsupported Command!" << endl; 111311fccf17Sopenharmony_ci} 111411fccf17Sopenharmony_ci 111511fccf17Sopenharmony_civoid RilInterfaceTest::OnStressInput(int32_t what) 111611fccf17Sopenharmony_ci{ 111711fccf17Sopenharmony_ci if (g_rilInterface == nullptr) { 111811fccf17Sopenharmony_ci cout << "g_rilInterface is null"; 111911fccf17Sopenharmony_ci return; 112011fccf17Sopenharmony_ci } 112111fccf17Sopenharmony_ci auto itFunc = stressMemberFuncMap_.find(what); 112211fccf17Sopenharmony_ci if (itFunc != stressMemberFuncMap_.end()) { 112311fccf17Sopenharmony_ci auto memberFunc = itFunc->second; 112411fccf17Sopenharmony_ci if (memberFunc != nullptr) { 112511fccf17Sopenharmony_ci cout << "Please input slotId:"; 112611fccf17Sopenharmony_ci int32_t slotId; 112711fccf17Sopenharmony_ci cin >> slotId; 112811fccf17Sopenharmony_ci (this->*memberFunc)(slotId); 112911fccf17Sopenharmony_ci return; 113011fccf17Sopenharmony_ci } 113111fccf17Sopenharmony_ci } 113211fccf17Sopenharmony_ci cout << "----> Unsupported Command!" << endl; 113311fccf17Sopenharmony_ci} 113411fccf17Sopenharmony_ci 113511fccf17Sopenharmony_civoid RilInterfaceTest::SimOpenLogicalChannelTest(int32_t slotId) 113611fccf17Sopenharmony_ci{ 113711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimOpenLogicalChannelTest -->" << endl; 113811fccf17Sopenharmony_ci std::string appId; 113911fccf17Sopenharmony_ci int32_t p2; 114011fccf17Sopenharmony_ci cout << "input appId:"; 114111fccf17Sopenharmony_ci cin >> appId; 114211fccf17Sopenharmony_ci cout << "input p2:"; 114311fccf17Sopenharmony_ci cin >> p2; 114411fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimOpenLogicalChannel(slotId, GetSerialId(), appId, p2); 114511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimOpenLogicalChannelTest finish ret : " << ret << endl << endl; 114611fccf17Sopenharmony_ci} 114711fccf17Sopenharmony_ci 114811fccf17Sopenharmony_civoid RilInterfaceTest::SimCloseLogicalChannelTest(int32_t slotId) 114911fccf17Sopenharmony_ci{ 115011fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimCloseLogicalChannelTest -->" << endl; 115111fccf17Sopenharmony_ci int32_t channelId; 115211fccf17Sopenharmony_ci cout << "input channelId:"; 115311fccf17Sopenharmony_ci cin >> channelId; 115411fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimCloseLogicalChannel(slotId, GetSerialId(), channelId); 115511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimCloseLogicalChannelTest finish ret : " << ret << endl << endl; 115611fccf17Sopenharmony_ci} 115711fccf17Sopenharmony_ci 115811fccf17Sopenharmony_civoid RilInterfaceTest::InputTransmitApduChannelParam(ApduSimIORequestInfo &reqInfo) 115911fccf17Sopenharmony_ci{ 116011fccf17Sopenharmony_ci cout << "input channelId:"; 116111fccf17Sopenharmony_ci cin >> reqInfo.channelId; 116211fccf17Sopenharmony_ci cout << "input type:"; 116311fccf17Sopenharmony_ci cin >> reqInfo.type; 116411fccf17Sopenharmony_ci cout << "input instruction:"; 116511fccf17Sopenharmony_ci cin >> reqInfo.instruction; 116611fccf17Sopenharmony_ci cout << "input p1:"; 116711fccf17Sopenharmony_ci cin >> reqInfo.p1; 116811fccf17Sopenharmony_ci cout << "input p2:"; 116911fccf17Sopenharmony_ci cin >> reqInfo.p2; 117011fccf17Sopenharmony_ci cout << "input p3:"; 117111fccf17Sopenharmony_ci cin >> reqInfo.p3; 117211fccf17Sopenharmony_ci} 117311fccf17Sopenharmony_ci 117411fccf17Sopenharmony_civoid RilInterfaceTest::SimTransmitApduLogicalChannelTest(int32_t slotId) 117511fccf17Sopenharmony_ci{ 117611fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimTransmitApduLogicalChannelTest -->" << endl; 117711fccf17Sopenharmony_ci ApduSimIORequestInfo reqInfo = ApduSimIORequestInfo(); 117811fccf17Sopenharmony_ci InputTransmitApduChannelParam(reqInfo); 117911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimTransmitApduLogicalChannel(slotId, GetSerialId(), reqInfo); 118011fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimTransmitApduLogicalChannelTest finish ret : " << ret << endl << endl; 118111fccf17Sopenharmony_ci} 118211fccf17Sopenharmony_ci 118311fccf17Sopenharmony_civoid RilInterfaceTest::SimTransmitApduBasicChannelTest(int32_t slotId) 118411fccf17Sopenharmony_ci{ 118511fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimTransmitApduBasicChannelTest -->" << endl; 118611fccf17Sopenharmony_ci ApduSimIORequestInfo reqInfo = ApduSimIORequestInfo(); 118711fccf17Sopenharmony_ci InputTransmitApduChannelParam(reqInfo); 118811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimTransmitApduBasicChannel(slotId, GetSerialId(), reqInfo); 118911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimTransmitApduBasicChannelTest finish ret : " << ret << endl << endl; 119011fccf17Sopenharmony_ci} 119111fccf17Sopenharmony_ci 119211fccf17Sopenharmony_civoid RilInterfaceTest::SimAuthenticationTest(int32_t slotId) 119311fccf17Sopenharmony_ci{ 119411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimAuthenticationTest -->" << endl; 119511fccf17Sopenharmony_ci SimAuthenticationRequestInfo reqInfo = SimAuthenticationRequestInfo(); 119611fccf17Sopenharmony_ci cout << "input authType:" << std::endl; 119711fccf17Sopenharmony_ci cout << "SIM_AUTH_EAP_SIM_TYPE is 128" << std::endl; 119811fccf17Sopenharmony_ci cout << "SIM_AUTH_EAP_AKA_TYPE is 129" << std::endl; 119911fccf17Sopenharmony_ci cin >> reqInfo.serial; 120011fccf17Sopenharmony_ci cout << "input aid:" << std::endl; 120111fccf17Sopenharmony_ci cout << "USIM_AID" << std::endl; 120211fccf17Sopenharmony_ci cout << "CDMA_FAKE_AID" << std::endl; 120311fccf17Sopenharmony_ci cout << "GSM_FAKE_AID" << std::endl; 120411fccf17Sopenharmony_ci cin >> reqInfo.aid; 120511fccf17Sopenharmony_ci cout << "input authData:" << std::endl; 120611fccf17Sopenharmony_ci cin >> reqInfo.authData; 120711fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimAuthentication(slotId, GetSerialId(), reqInfo); 120811fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimAuthenticationTest finish ret : " << ret << endl << endl; 120911fccf17Sopenharmony_ci} 121011fccf17Sopenharmony_ci 121111fccf17Sopenharmony_civoid RilInterfaceTest::SendSimMatchedOperatorInfoTest(int32_t slotId) 121211fccf17Sopenharmony_ci{ 121311fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendSimMatchedOperatorInfoTest -->" << endl; 121411fccf17Sopenharmony_ci NcfgOperatorInfo reqInfo = NcfgOperatorInfo(); 121511fccf17Sopenharmony_ci cout << "input operName:" << std::endl; 121611fccf17Sopenharmony_ci cin >> reqInfo.operName; 121711fccf17Sopenharmony_ci cout << "input operKey:" << std::endl; 121811fccf17Sopenharmony_ci cin >> reqInfo.operKey; 121911fccf17Sopenharmony_ci cout << "input state:" << std::endl; 122011fccf17Sopenharmony_ci cin >> reqInfo.state; 122111fccf17Sopenharmony_ci cout << "input reserve:" << std::endl; 122211fccf17Sopenharmony_ci cin >> reqInfo.reserve; 122311fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SendSimMatchedOperatorInfo(slotId, GetSerialId(), reqInfo); 122411fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendSimMatchedOperatorInfoTest finish ret : " << ret << endl << endl; 122511fccf17Sopenharmony_ci} 122611fccf17Sopenharmony_ci 122711fccf17Sopenharmony_civoid RilInterfaceTest::SetActiveSimTest(int32_t slotId) 122811fccf17Sopenharmony_ci{ 122911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetActiveSimTest -->" << endl; 123011fccf17Sopenharmony_ci int32_t index; 123111fccf17Sopenharmony_ci cout << "please enter the index:"; 123211fccf17Sopenharmony_ci cin >> index; 123311fccf17Sopenharmony_ci int32_t enable; 123411fccf17Sopenharmony_ci cout << "please enter the enable:"; 123511fccf17Sopenharmony_ci cin >> enable; 123611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetActiveSim(slotId, GetSerialId(), index, enable); 123711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetActiveSimTest finish ret : " << ret << endl << endl; 123811fccf17Sopenharmony_ci} 123911fccf17Sopenharmony_ci 124011fccf17Sopenharmony_civoid RilInterfaceTest::UnlockSimLockTest(int32_t slotId) 124111fccf17Sopenharmony_ci{ 124211fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnlockSimLockTest -->" << endl; 124311fccf17Sopenharmony_ci int lockType; 124411fccf17Sopenharmony_ci cout << "input lockType:"; 124511fccf17Sopenharmony_ci cin >> lockType; 124611fccf17Sopenharmony_ci string password = ""; 124711fccf17Sopenharmony_ci cout << "input password:"; 124811fccf17Sopenharmony_ci cin >> password; 124911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->UnlockSimLock(slotId, GetSerialId(), lockType, password); 125011fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnlockSimLockTest finish ret : " << ret << endl << endl; 125111fccf17Sopenharmony_ci} 125211fccf17Sopenharmony_ci 125311fccf17Sopenharmony_civoid RilInterfaceTest::UnLockPINTest(int32_t slotId) 125411fccf17Sopenharmony_ci{ 125511fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPINTest -->" << endl; 125611fccf17Sopenharmony_ci std::string pin; 125711fccf17Sopenharmony_ci cout << "please enter the pin:"; 125811fccf17Sopenharmony_ci cin >> pin; 125911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->UnlockPin(slotId, GetSerialId(), pin); 126011fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPINTest finish ret : " << ret << endl << endl; 126111fccf17Sopenharmony_ci} 126211fccf17Sopenharmony_ci 126311fccf17Sopenharmony_civoid RilInterfaceTest::UnLockPIN2Test(int32_t slotId) 126411fccf17Sopenharmony_ci{ 126511fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPIN2Test -->" << endl; 126611fccf17Sopenharmony_ci std::string pin2; 126711fccf17Sopenharmony_ci cout << "please enter the pin2:"; 126811fccf17Sopenharmony_ci cin >> pin2; 126911fccf17Sopenharmony_ci int32_t ret = g_rilInterface->UnlockPin2(slotId, GetSerialId(), pin2); 127011fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPIN2Test finish ret : " << ret << endl << endl; 127111fccf17Sopenharmony_ci} 127211fccf17Sopenharmony_ci 127311fccf17Sopenharmony_civoid RilInterfaceTest::UnLockPUKTest(int32_t slotId) 127411fccf17Sopenharmony_ci{ 127511fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPUKTest -->" << endl; 127611fccf17Sopenharmony_ci std::string puk; 127711fccf17Sopenharmony_ci cout << "please enter the puk:"; 127811fccf17Sopenharmony_ci cin >> puk; 127911fccf17Sopenharmony_ci std::string pin; 128011fccf17Sopenharmony_ci cout << "please enter the pin:"; 128111fccf17Sopenharmony_ci cin >> pin; 128211fccf17Sopenharmony_ci int32_t ret = g_rilInterface->UnlockPuk(slotId, GetSerialId(), puk, pin); 128311fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPUKTest finish ret : " << ret << endl << endl; 128411fccf17Sopenharmony_ci} 128511fccf17Sopenharmony_ci 128611fccf17Sopenharmony_civoid RilInterfaceTest::UnLockPUK2Test(int32_t slotId) 128711fccf17Sopenharmony_ci{ 128811fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPUK2Test -->" << endl; 128911fccf17Sopenharmony_ci std::string puk2; 129011fccf17Sopenharmony_ci cout << "please enter the puk2:"; 129111fccf17Sopenharmony_ci cin >> puk2; 129211fccf17Sopenharmony_ci std::string pin2; 129311fccf17Sopenharmony_ci cout << "please enter the pin2:"; 129411fccf17Sopenharmony_ci cin >> pin2; 129511fccf17Sopenharmony_ci int32_t ret = g_rilInterface->UnlockPuk2(slotId, GetSerialId(), puk2, pin2); 129611fccf17Sopenharmony_ci cout << "RilInterfaceTest::UnLockPUK2Test finish ret : " << ret << endl << endl; 129711fccf17Sopenharmony_ci} 129811fccf17Sopenharmony_ci 129911fccf17Sopenharmony_civoid RilInterfaceTest::ChangeSimPasswordTest(int32_t slotId) 130011fccf17Sopenharmony_ci{ 130111fccf17Sopenharmony_ci cout << "RilInterfaceTest::ChangeSimPasswordTest -->" << endl; 130211fccf17Sopenharmony_ci std::string fac; 130311fccf17Sopenharmony_ci cout << "please enter the fac, SC for pin1, FD for pin2:"; 130411fccf17Sopenharmony_ci cin >> fac; 130511fccf17Sopenharmony_ci std::string oldPassword; 130611fccf17Sopenharmony_ci cout << "please enter the oldPassword:"; 130711fccf17Sopenharmony_ci cin >> oldPassword; 130811fccf17Sopenharmony_ci std::string newPassword; 130911fccf17Sopenharmony_ci cout << "please enter the newPassword:"; 131011fccf17Sopenharmony_ci cin >> newPassword; 131111fccf17Sopenharmony_ci SimPasswordInfo simPassword; 131211fccf17Sopenharmony_ci simPassword.fac = fac; 131311fccf17Sopenharmony_ci simPassword.oldPassword = oldPassword; 131411fccf17Sopenharmony_ci simPassword.newPassword = newPassword; 131511fccf17Sopenharmony_ci simPassword.passwordLength = newPassword.length(); 131611fccf17Sopenharmony_ci int32_t ret = g_rilInterface->ChangeSimPassword(slotId, GetSerialId(), simPassword); 131711fccf17Sopenharmony_ci cout << "RilInterfaceTest::ChangeSimPasswordTest finish ret : " << ret << endl << endl; 131811fccf17Sopenharmony_ci} 131911fccf17Sopenharmony_ci 132011fccf17Sopenharmony_civoid RilInterfaceTest::SetSimLockTest(int32_t slotId) 132111fccf17Sopenharmony_ci{ 132211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetSimLockTest -->" << endl; 132311fccf17Sopenharmony_ci std::string fac; 132411fccf17Sopenharmony_ci cout << "please enter the fac, SC for pin1, FD for pin2:"; 132511fccf17Sopenharmony_ci cin >> fac; 132611fccf17Sopenharmony_ci int32_t mode; 132711fccf17Sopenharmony_ci cout << "please enter the mode:"; 132811fccf17Sopenharmony_ci cin >> mode; 132911fccf17Sopenharmony_ci std::string password; 133011fccf17Sopenharmony_ci cout << "please enter the password:"; 133111fccf17Sopenharmony_ci cin >> password; 133211fccf17Sopenharmony_ci SimLockInfo simLockInfo; 133311fccf17Sopenharmony_ci simLockInfo.fac = fac; 133411fccf17Sopenharmony_ci simLockInfo.mode = mode; 133511fccf17Sopenharmony_ci simLockInfo.classx = 0; 133611fccf17Sopenharmony_ci simLockInfo.passwd = password; 133711fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SetSimLock(slotId, GetSerialId(), simLockInfo); 133811fccf17Sopenharmony_ci cout << "RilInterfaceTest::SetSimLockTest finish ret : " << ret << endl << endl; 133911fccf17Sopenharmony_ci} 134011fccf17Sopenharmony_ci 134111fccf17Sopenharmony_civoid RilInterfaceTest::GetSimLockStatusTest(int32_t slotId) 134211fccf17Sopenharmony_ci{ 134311fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetSimLockStatusTest -->" << endl; 134411fccf17Sopenharmony_ci std::string fac; 134511fccf17Sopenharmony_ci cout << "please enter the fac, SC for pin1, FD for pin2:"; 134611fccf17Sopenharmony_ci cin >> fac; 134711fccf17Sopenharmony_ci SimLockInfo simLockInfo; 134811fccf17Sopenharmony_ci simLockInfo.fac = fac; 134911fccf17Sopenharmony_ci simLockInfo.mode = SIM_LOCK_MODE_QUERY; 135011fccf17Sopenharmony_ci simLockInfo.classx = 0; 135111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->GetSimLockStatus(slotId, GetSerialId(), simLockInfo); 135211fccf17Sopenharmony_ci cout << "RilInterfaceTest::GetSimLockStatusTest finish ret : " << ret << endl << endl; 135311fccf17Sopenharmony_ci} 135411fccf17Sopenharmony_ci 135511fccf17Sopenharmony_civoid RilInterfaceTest::SendTerminalResponseCmdTest(int32_t slotId) 135611fccf17Sopenharmony_ci{ 135711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendTerminalResponseCmdTest -->" << endl; 135811fccf17Sopenharmony_ci std::string cmd; 135911fccf17Sopenharmony_ci cout << "please enter terminal response command:"; 136011fccf17Sopenharmony_ci cin >> cmd; 136111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimStkSendTerminalResponse(slotId, GetSerialId(), cmd); 136211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendTerminalResponseCmdTest finish ret : " << ret << endl << endl; 136311fccf17Sopenharmony_ci} 136411fccf17Sopenharmony_ci 136511fccf17Sopenharmony_civoid RilInterfaceTest::SendEnvelopeCmdTest(int32_t slotId) 136611fccf17Sopenharmony_ci{ 136711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendEnvelopeCmdTest -->" << endl; 136811fccf17Sopenharmony_ci std::string cmd; 136911fccf17Sopenharmony_ci cout << "please enter envelope command:"; 137011fccf17Sopenharmony_ci cin >> cmd; 137111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimStkSendEnvelope(slotId, GetSerialId(), cmd); 137211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendEnvelopeCmdTest finish ret : " << ret << endl << endl; 137311fccf17Sopenharmony_ci} 137411fccf17Sopenharmony_ci 137511fccf17Sopenharmony_civoid RilInterfaceTest::SendCallSetupRequestResultTest(int32_t slotId) 137611fccf17Sopenharmony_ci{ 137711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendCallSetupRequestResultTest -->" << endl; 137811fccf17Sopenharmony_ci int32_t accept; 137911fccf17Sopenharmony_ci cout << "please enter call setup request result:"; 138011fccf17Sopenharmony_ci cin >> accept; 138111fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimStkSendCallSetupRequestResult(slotId, GetSerialId(), accept); 138211fccf17Sopenharmony_ci cout << "RilInterfaceTest::SendCallSetupRequestResultTest finish ret : " << ret << endl << endl; 138311fccf17Sopenharmony_ci} 138411fccf17Sopenharmony_ci 138511fccf17Sopenharmony_civoid RilInterfaceTest::SimStkIsReadyTest(int32_t slotId) 138611fccf17Sopenharmony_ci{ 138711fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimStkIsReadyTest -->" << endl; 138811fccf17Sopenharmony_ci int32_t ret = g_rilInterface->SimStkIsReady(slotId, GetSerialId()); 138911fccf17Sopenharmony_ci cout << "RilInterfaceTest::SimStkIsReadyTest finish ret : " << ret << endl << endl; 139011fccf17Sopenharmony_ci} 139111fccf17Sopenharmony_ci 139211fccf17Sopenharmony_civoid RilInterfaceTest::OnInitStressInterface() 139311fccf17Sopenharmony_ci{ 139411fccf17Sopenharmony_ci stressMemberFuncMap_[HREQ_CALL_DIAL] = &RilInterfaceTest::RilCmDialStressTest; 139511fccf17Sopenharmony_ci stressMemberFuncMap_[HREQ_MODEM_GET_IMEI] = &RilInterfaceTest::GetImeiStressTest; 139611fccf17Sopenharmony_ci stressMemberFuncMap_[HREQ_MODEM_GET_IMEISV] = &RilInterfaceTest::GetImeiSvStressTest; 139711fccf17Sopenharmony_ci stressMemberFuncMap_[HREQ_MODEM_SET_RADIO_STATUS] = &RilInterfaceTest::SetRadioStateStressTest; 139811fccf17Sopenharmony_ci} 139911fccf17Sopenharmony_ci 140011fccf17Sopenharmony_civoid RilInterfaceTest::OnInitCallProcessInterface() 140111fccf17Sopenharmony_ci{ 140211fccf17Sopenharmony_ci // // call 140311fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_GET_CALL_LIST] = &RilInterfaceTest::GetCallListTest; 140411fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_DIAL] = &RilInterfaceTest::RilCmDialTest; 140511fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_HANGUP] = &RilInterfaceTest::HangupTest; 140611fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_REJECT] = &RilInterfaceTest::RejectTest; 140711fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_ANSWER] = &RilInterfaceTest::AnswerCallTest; 140811fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_HOLD_CALL] = &RilInterfaceTest::HoldCallTest; 140911fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_UNHOLD_CALL] = &RilInterfaceTest::UnHoldCallTest; 141011fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SWITCH_CALL] = &RilInterfaceTest::SwitchCallTest; 141111fccf17Sopenharmony_ci 141211fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_COMBINE_CONFERENCE] = &RilInterfaceTest::RilCmJoinCallTest; 141311fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SEPARATE_CONFERENCE] = &RilInterfaceTest::RilCmSplitCallTest; 141411fccf17Sopenharmony_ci 141511fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_CALL_SUPPLEMENT] = &RilInterfaceTest::CallSupplementTest; 141611fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SEND_DTMF] = &RilInterfaceTest::SendDtmfTest; 141711fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_START_DTMF] = &RilInterfaceTest::StartDtmfTest; 141811fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_STOP_DTMF] = &RilInterfaceTest::StopDtmfTest; 141911fccf17Sopenharmony_ci 142011fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SET_USSD] = &RilInterfaceTest::SetUssdCusdTest; 142111fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_GET_USSD] = &RilInterfaceTest::GetUssdCusdTest; 142211fccf17Sopenharmony_ci 142311fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SET_MUTE] = &RilInterfaceTest::SetMuteTest; 142411fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_GET_MUTE] = &RilInterfaceTest::GetMuteTest; 142511fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_GET_EMERGENCY_LIST] = &RilInterfaceTest::GetEmergencyListTest; 142611fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SET_EMERGENCY_LIST] = &RilInterfaceTest::SetEmergencyCallListTest; 142711fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_GET_FAIL_REASON] = &RilInterfaceTest::GetFailReasonTest; 142811fccf17Sopenharmony_ci memberFuncMap_[HREQ_CALL_SET_BARRING_PASSWORD] = &RilInterfaceTest::SetBarringPasswordTest; 142911fccf17Sopenharmony_ci} 143011fccf17Sopenharmony_ci 143111fccf17Sopenharmony_civoid RilInterfaceTest::OnInitSmsProcessInterface() 143211fccf17Sopenharmony_ci{ 143311fccf17Sopenharmony_ci // sms 143411fccf17Sopenharmony_ci memberFuncMap_[HREQ_SMS_SEND_GSM_SMS] = &RilInterfaceTest::SendRilCmSmsTest; 143511fccf17Sopenharmony_ci memberFuncMap_[HREQ_SMS_SEND_SMS_MORE_MODE] = &RilInterfaceTest::SendRilCmSmsMoreModeTest; 143611fccf17Sopenharmony_ci memberFuncMap_[HREQ_SMS_SEND_SMS_ACK] = &RilInterfaceTest::SendSmsAckTest; 143711fccf17Sopenharmony_ci memberFuncMap_[HREQ_SMS_SET_SMSC_ADDR] = &RilInterfaceTest::SetSmscAddrTest; 143811fccf17Sopenharmony_ci memberFuncMap_[HREQ_SMS_GET_SMSC_ADDR] = &RilInterfaceTest::GetSmscAddrTest; 143911fccf17Sopenharmony_ci} 144011fccf17Sopenharmony_ci 144111fccf17Sopenharmony_civoid RilInterfaceTest::OnInitSimProcessInterface() 144211fccf17Sopenharmony_ci{ 144311fccf17Sopenharmony_ci // sim 144411fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_GET_SIM_STATUS] = &RilInterfaceTest::GetRilCmIccCardStatusTest; 144511fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_GET_IMSI] = &RilInterfaceTest::GetRilCmImsiForAppTest; 144611fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_GET_SIM_IO] = &RilInterfaceTest::IccRilSimIoForAppTest; 144711fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_OPEN_LOGICAL_CHANNEL] = &RilInterfaceTest::SimOpenLogicalChannelTest; 144811fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_CLOSE_LOGICAL_CHANNEL] = &RilInterfaceTest::SimCloseLogicalChannelTest; 144911fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL] = &RilInterfaceTest::SimTransmitApduLogicalChannelTest; 145011fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL] = &RilInterfaceTest::SimTransmitApduBasicChannelTest; 145111fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_AUTHENTICATION] = &RilInterfaceTest::SimAuthenticationTest; 145211fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_SET_ACTIVE_SIM] = &RilInterfaceTest::SetActiveSimTest; 145311fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_UNLOCK_SIM_LOCK] = &RilInterfaceTest::UnlockSimLockTest; 145411fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_UNLOCK_PIN] = &RilInterfaceTest::UnLockPINTest; 145511fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_UNLOCK_PIN2] = &RilInterfaceTest::UnLockPIN2Test; 145611fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_UNLOCK_PUK] = &RilInterfaceTest::UnLockPUKTest; 145711fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_UNLOCK_PUK2] = &RilInterfaceTest::UnLockPUK2Test; 145811fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_CHANGE_SIM_PASSWORD] = &RilInterfaceTest::ChangeSimPasswordTest; 145911fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_SET_SIM_LOCK] = &RilInterfaceTest::SetSimLockTest; 146011fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_GET_SIM_LOCK_STATUS] = &RilInterfaceTest::GetSimLockStatusTest; 146111fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_STK_SEND_TERMINAL_RESPONSE] = &RilInterfaceTest::SendTerminalResponseCmdTest; 146211fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_STK_SEND_ENVELOPE] = &RilInterfaceTest::SendEnvelopeCmdTest; 146311fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_STK_SEND_CALL_SETUP_REQUEST_RESULT] = &RilInterfaceTest::SendCallSetupRequestResultTest; 146411fccf17Sopenharmony_ci memberFuncMap_[HREQ_SIM_STK_IS_READY] = &RilInterfaceTest::SimStkIsReadyTest; 146511fccf17Sopenharmony_ci} 146611fccf17Sopenharmony_ci 146711fccf17Sopenharmony_civoid RilInterfaceTest::OnInitDataProcessInterface() 146811fccf17Sopenharmony_ci{ 146911fccf17Sopenharmony_ci // data 147011fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SET_INIT_APN_INFO] = &RilInterfaceTest::SetInitialApnTest; 147111fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_DEACTIVATE_PDP_CONTEXT] = &RilInterfaceTest::DeactivatePdpContextTest; 147211fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_ACTIVATE_PDP_CONTEXT] = &RilInterfaceTest::ActivatePdpContextTest; 147311fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_GET_PDP_CONTEXT_LIST] = &RilInterfaceTest::GetPdpContextListTest; 147411fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_GET_LINK_BANDWIDTH_INFO] = &RilInterfaceTest::GetLinkBandwidthInfoTest; 147511fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SET_LINK_BANDWIDTH_REPORTING_RULE] = &RilInterfaceTest::SetLinkBandwidthReportingRuleTest; 147611fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SET_DATA_PROFILE_INFO] = &RilInterfaceTest::SetDataProfileInfoTest; 147711fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SEND_DATA_PERFORMANCE_MODE] = &RilInterfaceTest::SendDataPerformanceModeTest; 147811fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SEND_DATA_SLEEP_MODE] = &RilInterfaceTest::SendDataSleepModeTest; 147911fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_SET_DATA_PERMITTED] = &RilInterfaceTest::SetDataPermittedTest; 148011fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_GET_LINK_CAPABILITY] = &RilInterfaceTest::GetLinkCapabilityTest; 148111fccf17Sopenharmony_ci memberFuncMap_[HREQ_DATA_CLEAN_ALL_CONNECTIONS] = &RilInterfaceTest::CleanAllConnectionsTest; 148211fccf17Sopenharmony_ci} 148311fccf17Sopenharmony_ci 148411fccf17Sopenharmony_civoid RilInterfaceTest::OnInitNetworkProcessInterface() 148511fccf17Sopenharmony_ci{ 148611fccf17Sopenharmony_ci // networksearch 148711fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_SIGNAL_STRENGTH] = &RilInterfaceTest::GetRilCmSignalIntensityTest; 148811fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_CS_REG_STATUS] = &RilInterfaceTest::GetRilCmCsRegStatusTest; 148911fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_PS_REG_STATUS] = &RilInterfaceTest::GetRilCmPsRegStatusTest; 149011fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_OPERATOR_INFO] = &RilInterfaceTest::GetRilCmOperatorTest; 149111fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION] = &RilInterfaceTest::GetRilNetworkSearchInfoTest; 149211fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_NETWORK_SELECTION_MODE] = &RilInterfaceTest::GetRilNetworkSelectionModeTest; 149311fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_NETWORK_SELECTION_MODE] = &RilInterfaceTest::SetRilNetworkSelectionModeTest; 149411fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST] = &RilInterfaceTest::GetRilCmCellInfoListTest; 149511fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_CURRENT_CELL_INFO] = &RilInterfaceTest::GetRilCurrentCellInfoTest; 149611fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_PREFERRED_NETWORK] = &RilInterfaceTest::SetRilPreferredNetworkTest; 149711fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_PREFERRED_NETWORK] = &RilInterfaceTest::GetRilPreferredNetwrokTest; 149811fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG] = &RilInterfaceTest::GetPhysicalChannelConfigTest; 149911fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_LOCATE_UPDATES] = &RilInterfaceTest::SetRilLocationUpdateTest; 150011fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_NOTIFICATION_FILTER] = &RilInterfaceTest::SetRilNotificationFilterTest; 150111fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_DEVICE_STATE] = &RilInterfaceTest::SetRilDeviceStateTest; 150211fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_SET_NR_OPTION_MODE] = &RilInterfaceTest::SetNrOptionModeTest; 150311fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_NR_OPTION_MODE] = &RilInterfaceTest::GetNrOptionModeTest; 150411fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_RRC_CONNECTION_STATE] = &RilInterfaceTest::GetRrcConnectionStateTest; 150511fccf17Sopenharmony_ci memberFuncMap_[HREQ_NETWORK_GET_NR_SSBID_INFO] = &RilInterfaceTest::GetNrSsbIdTest; 150611fccf17Sopenharmony_ci} 150711fccf17Sopenharmony_ci 150811fccf17Sopenharmony_civoid RilInterfaceTest::OnInitModemProcessInterface() 150911fccf17Sopenharmony_ci{ 151011fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_SHUT_DOWN] = &RilInterfaceTest::ShutDownTest; 151111fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_SET_RADIO_STATUS] = &RilInterfaceTest::SetRadioStateTest; 151211fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_RADIO_STATUS] = &RilInterfaceTest::GetRadioStateTest; 151311fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_IMEI] = &RilInterfaceTest::GetImeiTest; 151411fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_IMEISV] = &RilInterfaceTest::GetImeiSvTest; 151511fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_MEID] = &RilInterfaceTest::GetMeidTest; 151611fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_VOICE_RADIO] = &RilInterfaceTest::GetVoiceRadioTechnologyTest; 151711fccf17Sopenharmony_ci memberFuncMap_[HREQ_MODEM_GET_BASEBAND_VERSION] = &RilInterfaceTest::GetBasebandVersionTest; 151811fccf17Sopenharmony_ci} 151911fccf17Sopenharmony_ci 152011fccf17Sopenharmony_civoid RilInterfaceTest::OnInitProcessInterface() 152111fccf17Sopenharmony_ci{ 152211fccf17Sopenharmony_ci OnInitCallProcessInterface(); 152311fccf17Sopenharmony_ci OnInitSmsProcessInterface(); 152411fccf17Sopenharmony_ci OnInitSimProcessInterface(); 152511fccf17Sopenharmony_ci OnInitDataProcessInterface(); 152611fccf17Sopenharmony_ci OnInitNetworkProcessInterface(); 152711fccf17Sopenharmony_ci OnInitModemProcessInterface(); 152811fccf17Sopenharmony_ci} 152911fccf17Sopenharmony_ci 153011fccf17Sopenharmony_civoid RilInterfaceTest::OnInitInterface() 153111fccf17Sopenharmony_ci{ 153211fccf17Sopenharmony_ci OnInitStressInterface(); 153311fccf17Sopenharmony_ci OnInitProcessInterface(); 153411fccf17Sopenharmony_ci} 153511fccf17Sopenharmony_ci} // namespace Telephony 153611fccf17Sopenharmony_ci} // namespace OHOS 153711fccf17Sopenharmony_ci 153811fccf17Sopenharmony_ciusing namespace OHOS; 153911fccf17Sopenharmony_ciusing namespace OHOS::Telephony; 154011fccf17Sopenharmony_ci 154111fccf17Sopenharmony_cistatic int32_t PrintMenu() 154211fccf17Sopenharmony_ci{ 154311fccf17Sopenharmony_ci cout << endl << "---->Test Module:" << endl; 154411fccf17Sopenharmony_ci cout << "----> 0. EXIT --------------------------" << endl; 154511fccf17Sopenharmony_ci cout << "----> 1. MODEM -------------------------" << endl; 154611fccf17Sopenharmony_ci cout << "----> 2. CALL --------------------------" << endl; 154711fccf17Sopenharmony_ci cout << "----> 3. NETWORK -----------------------" << endl; 154811fccf17Sopenharmony_ci cout << "----> 4. SIM ---------------------------" << endl; 154911fccf17Sopenharmony_ci cout << "----> 5. DATA --------------------------" << endl; 155011fccf17Sopenharmony_ci cout << "----> 6. SMS ---------------------------" << endl; 155111fccf17Sopenharmony_ci cout << "----> 7. STRESS ------------------------" << endl; 155211fccf17Sopenharmony_ci int32_t choice = InputInt32(0, static_cast<int32_t>(TestMenu::STRESS), "Test Module Index"); 155311fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 155411fccf17Sopenharmony_ci return choice; 155511fccf17Sopenharmony_ci} 155611fccf17Sopenharmony_ci 155711fccf17Sopenharmony_cistatic int32_t PrintStressMenu() 155811fccf17Sopenharmony_ci{ 155911fccf17Sopenharmony_ci cout << "---->[MODULE]STRESS:" << endl; 156011fccf17Sopenharmony_ci cout << "----> [" << 0 << "] ---->Back to the previous menu." << endl; 156111fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_DIAL << "] ---->[ HREQ_CALL_DIAL ]" << endl; 156211fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_SET_RADIO_STATUS << "] ---->[ HREQ_MODEM_SET_RADIO_STATUS ]" << endl; 156311fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_IMEI << "] ---->[ HREQ_MODEM_GET_IMEI ]" << endl; 156411fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_IMEISV << "] ---->[ HREQ_MODEM_GET_IMEISV ]" << endl; 156511fccf17Sopenharmony_ci 156611fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_CALL_BASE, HREQ_MODEM_EXIT - 1, "Command"); 156711fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 156811fccf17Sopenharmony_ci choice = (choice == HREQ_CALL_BASE) ? DEFAULT_CHOICE : choice; 156911fccf17Sopenharmony_ci return choice; 157011fccf17Sopenharmony_ci} 157111fccf17Sopenharmony_ci 157211fccf17Sopenharmony_cistatic int32_t PrintCallMenu() 157311fccf17Sopenharmony_ci{ 157411fccf17Sopenharmony_ci cout << "---->[MODULE]CALL:" << endl; 157511fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_BASE << "] ---->Back to the previous menu." << endl; 157611fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_GET_CALL_LIST << "] ---->[ HREQ_CALL_GET_CALL_LIST ]" << endl; 157711fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_DIAL << "] ---->[ HREQ_CALL_DIAL ]" << endl; 157811fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_HANGUP << "] ---->[ HREQ_CALL_HANGUP ]" << endl; 157911fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_REJECT << "] ---->[ HREQ_CALL_REJECT ]" << endl; 158011fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_ANSWER << "] ---->[ HREQ_CALL_ANSWER ]" << endl; 158111fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_HOLD_CALL << "] ---->[ HREQ_CALL_HOLD_CALL ]" << endl; 158211fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_UNHOLD_CALL << "] ---->[ HREQ_CALL_UNHOLD_CALL ]" << endl; 158311fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SWITCH_CALL << "] ---->[ HREQ_CALL_SWITCH_CALL ]" << endl; 158411fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_COMBINE_CONFERENCE << "] ---->[ HREQ_CALL_COMBINE_CONFERENCE ]" << endl; 158511fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SEPARATE_CONFERENCE << "] ---->[ HREQ_CALL_SEPARATE_CONFERENCE ]" << endl; 158611fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_CALL_SUPPLEMENT << "] ---->[ HREQ_CALL_CALL_SUPPLEMENT ]" << endl; 158711fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SEND_DTMF << "] ---->[ HREQ_CALL_SEND_DTMF ]" << endl; 158811fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_START_DTMF << "] ---->[ HREQ_CALL_START_DTMF ]" << endl; 158911fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_STOP_DTMF << "] ---->[ HREQ_CALL_STOP_DTMF ]" << endl; 159011fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SET_USSD << "] ---->[ HREQ_CALL_SET_USSD ]" << endl; 159111fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_GET_USSD << "] ---->[ HREQ_CALL_GET_USSD ]" << endl; 159211fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SET_MUTE << "] ---->[ HREQ_CALL_SET_MUTE ]" << endl; 159311fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_GET_MUTE << "] ---->[ HREQ_CALL_GET_MUTE ]" << endl; 159411fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_GET_EMERGENCY_LIST << "] ---->[ HREQ_CALL_GET_EMERGENCY_LIST ]" << endl; 159511fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SET_EMERGENCY_LIST << "] ---->[ HREQ_CALL_SET_EMERGENCY_LIST ]" << endl; 159611fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_GET_FAIL_REASON << "] ---->[ HREQ_CALL_GET_FAIL_REASON ]" << endl; 159711fccf17Sopenharmony_ci cout << "----> [" << HREQ_CALL_SET_BARRING_PASSWORD << "] ---->[ HREQ_CALL_SET_BARRING_PASSWORD ]" << endl; 159811fccf17Sopenharmony_ci 159911fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_CALL_BASE, HREQ_SMS_BASE - MENU_OFFSET, "Command"); 160011fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 160111fccf17Sopenharmony_ci choice = (choice == HREQ_CALL_BASE) ? DEFAULT_CHOICE : choice; 160211fccf17Sopenharmony_ci return choice; 160311fccf17Sopenharmony_ci} 160411fccf17Sopenharmony_ci 160511fccf17Sopenharmony_cistatic int32_t PrintSmsMenu() 160611fccf17Sopenharmony_ci{ 160711fccf17Sopenharmony_ci cout << "---->[MODULE]SMS:" << endl; 160811fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_BASE << "] ---->Back to the previous menu." << endl; 160911fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_SEND_GSM_SMS << "] ---->[ HREQ_SMS_SEND_GSM_SMS ]" << endl; 161011fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_SEND_SMS_MORE_MODE << "] ---->[ HREQ_SMS_SEND_SMS_MORE_MODE ]" << endl; 161111fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_SEND_SMS_ACK << "] ---->[ HREQ_SMS_SEND_SMS_ACK ]" << endl; 161211fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_SET_SMSC_ADDR << "] ---->[ HREQ_SMS_SET_SMSC_ADDR ]" << endl; 161311fccf17Sopenharmony_ci cout << "----> [" << HREQ_SMS_GET_SMSC_ADDR << "] ---->[ HREQ_SMS_GET_SMSC_ADDR ]" << endl; 161411fccf17Sopenharmony_ci 161511fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_SMS_BASE, HREQ_SIM_BASE - MENU_OFFSET, "Command"); 161611fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 161711fccf17Sopenharmony_ci choice = (choice == HREQ_SMS_BASE) ? DEFAULT_CHOICE : choice; 161811fccf17Sopenharmony_ci return choice; 161911fccf17Sopenharmony_ci} 162011fccf17Sopenharmony_ci 162111fccf17Sopenharmony_cistatic int32_t PrintSimMenu() 162211fccf17Sopenharmony_ci{ 162311fccf17Sopenharmony_ci cout << "---->[MODULE]SIM:" << endl; 162411fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_BASE << "] ---->Back to the previous menu." << endl; 162511fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_GET_SIM_STATUS << "] ---->[ HREQ_SIM_GET_SIM_STATUS ]" << endl; 162611fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_GET_IMSI << "] ---->[ HREQ_SIM_GET_IMSI ]" << endl; 162711fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_GET_SIM_IO << "] ---->[ HREQ_SIM_GET_SIM_IO ]" << endl; 162811fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_SET_ACTIVE_SIM << "] ---->[ HREQ_SIM_SET_ACTIVE_SIM ]" << endl; 162911fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_OPEN_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_OPEN_LOGICAL_CHANNEL ]" << endl; 163011fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_CLOSE_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_CLOSE_LOGICAL_CHANNEL ]" << endl; 163111fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL << "] ---->[ HREQ_SIM_TRANSMIT_APDU_LOGICAL_CHANNEL ]" 163211fccf17Sopenharmony_ci << endl; 163311fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL << "] ---->[ HREQ_SIM_TRANSMIT_APDU_BASIC_CHANNEL ]" 163411fccf17Sopenharmony_ci << endl; 163511fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_AUTHENTICATION << "] ---->[ HREQ_SIM_AUTHENTICATION ]" << endl; 163611fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_UNLOCK_SIM_LOCK << "] ---->[ HREQ_SIM_UNLOCK_SIM_LOCK ]" << endl; 163711fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_UNLOCK_PIN << "] ---->[ HREQ_SIM_UNLOCK_PIN ]" << endl; 163811fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_UNLOCK_PIN2 << "] ---->[ HREQ_SIM_UNLOCK_PIN2 ]" << endl; 163911fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_UNLOCK_PUK << "] ---->[ HREQ_SIM_UNLOCK_PUK ]" << endl; 164011fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_UNLOCK_PUK2 << "] ---->[ HREQ_SIM_UNLOCK_PUK2 ]" << endl; 164111fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_CHANGE_SIM_PASSWORD << "] ---->[ HREQ_SIM_CHANGE_SIM_PASSWORD ]" << endl; 164211fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_SET_SIM_LOCK << "] ---->[ HREQ_SIM_SET_SIM_LOCK ]" << endl; 164311fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_GET_SIM_LOCK_STATUS << "] ---->[ HREQ_SIM_GET_SIM_LOCK_STATUS ]" << endl; 164411fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_STK_SEND_TERMINAL_RESPONSE << "] ---->[ HREQ_SIM_STK_SEND_TERMINAL_RESPONSE ]" 164511fccf17Sopenharmony_ci << endl; 164611fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_STK_SEND_ENVELOPE << "] ---->[ HREQ_SIM_STK_SEND_ENVELOPE ]" << endl; 164711fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_STK_SEND_CALL_SETUP_REQUEST_RESULT 164811fccf17Sopenharmony_ci << "] ---->[ HREQ_SIM_STK_SEND_CALL_SETUP_REQUEST_RESULT ]" << endl; 164911fccf17Sopenharmony_ci cout << "----> [" << HREQ_SIM_STK_IS_READY << "] ---->[ HREQ_SIM_STK_IS_READY ]" << endl; 165011fccf17Sopenharmony_ci 165111fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_SIM_BASE, HREQ_DATA_BASE - MENU_OFFSET, "Command"); 165211fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 165311fccf17Sopenharmony_ci choice = (choice == HREQ_SIM_BASE) ? DEFAULT_CHOICE : choice; 165411fccf17Sopenharmony_ci return choice; 165511fccf17Sopenharmony_ci} 165611fccf17Sopenharmony_ci 165711fccf17Sopenharmony_cistatic int32_t PrintDataMenu() 165811fccf17Sopenharmony_ci{ 165911fccf17Sopenharmony_ci cout << "---->[MODULE]DATA:" << endl; 166011fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_BASE << "] ---->Back to the previous menu." << endl; 166111fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SET_INIT_APN_INFO << "] ---->[ HREQ_DATA_SET_INIT_APN_INFO ]" << endl; 166211fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_DEACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_DEACTIVATE_PDP_CONTEXT ]" << endl; 166311fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_ACTIVATE_PDP_CONTEXT << "] ---->[ HREQ_DATA_ACTIVATE_PDP_CONTEXT ]" << endl; 166411fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_GET_PDP_CONTEXT_LIST << "] ---->[ HREQ_DATA_GET_PDP_CONTEXT_LIST ]" << endl; 166511fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_GET_LINK_BANDWIDTH_INFO << "] ---->[ HREQ_DATA_GET_LINK_BANDWIDTH_INFO ]" << endl; 166611fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SET_LINK_BANDWIDTH_REPORTING_RULE 166711fccf17Sopenharmony_ci << "] ---->[ HREQ_DATA_SET_LINK_BANDWIDTH_REPORTING_RULE ]" << endl; 166811fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SET_DATA_PROFILE_INFO << "] ---->[ HREQ_DATA_SET_DATA_PROFILE_INFO ]" << endl; 166911fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SEND_DATA_PERFORMANCE_MODE << "] ---->[ HREQ_DATA_SEND_DATA_PERFORMANCE_MODE ]" 167011fccf17Sopenharmony_ci << endl; 167111fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SEND_DATA_SLEEP_MODE << "] ---->[ HREQ_DATA_SEND_DATA_SLEEP_MODE ]" << endl; 167211fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_SET_DATA_PERMITTED << "] ---->[ HREQ_DATA_SET_DATA_PERMITTED ]" << endl; 167311fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_GET_LINK_CAPABILITY << "] ---->[ HREQ_DATA_GET_LINK_CAPABILITY ]" << endl; 167411fccf17Sopenharmony_ci cout << "----> [" << HREQ_DATA_CLEAN_ALL_CONNECTIONS << "] ---->[ HREQ_DATA_CLEAN_ALL_CONNECTIONS ]" << endl; 167511fccf17Sopenharmony_ci 167611fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_DATA_BASE, HREQ_NETWORK_BASE - MENU_OFFSET, "Command"); 167711fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 167811fccf17Sopenharmony_ci choice = (choice == HREQ_DATA_BASE) ? DEFAULT_CHOICE : choice; 167911fccf17Sopenharmony_ci return choice; 168011fccf17Sopenharmony_ci} 168111fccf17Sopenharmony_ci 168211fccf17Sopenharmony_cistatic int32_t PrintNetworkMenu() 168311fccf17Sopenharmony_ci{ 168411fccf17Sopenharmony_ci cout << "---->[MODULE]NETWORK:" << endl; 168511fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_BASE << "] ---->Back to the previous menu." << endl; 168611fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_SIGNAL_STRENGTH << "] ---->[ HREQ_NETWORK_GET_SIGNAL_STRENGTH ]" << endl; 168711fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_CS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_CS_REG_STATUS ]" << endl; 168811fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_PS_REG_STATUS << "] ---->[ HREQ_NETWORK_GET_PS_REG_STATUS ]" << endl; 168911fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_OPERATOR_INFO << "] ---->[ HREQ_NETWORK_GET_OPERATOR_INFO ]" << endl; 169011fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION 169111fccf17Sopenharmony_ci << "] ---->[ HREQ_NETWORK_GET_NETWORK_SEARCH_INFORMATION ]" << endl; 169211fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_NETWORK_SELECTION_MODE << "] ---->[ HREQ_NETWORK_GET_NETWORK_SELECTION_MODE ]" 169311fccf17Sopenharmony_ci << endl; 169411fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_NETWORK_SELECTION_MODE << "] ---->[ HREQ_NETWORK_SET_NETWORK_SELECTION_MODE ]" 169511fccf17Sopenharmony_ci << endl; 169611fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST 169711fccf17Sopenharmony_ci << "] ---->[ HREQ_NETWORK_GET_NEIGHBORING_CELLINFO_LIST ]" << endl; 169811fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_CURRENT_CELL_INFO << "] ---->[ HREQ_NETWORK_GET_CURRENT_CELL_INFO ]" << endl; 169911fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_PREFERRED_NETWORK << "] ---->[ HREQ_NETWORK_SET_PREFERRED_NETWORK ]" << endl; 170011fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_PREFERRED_NETWORK << "] ---->[ HREQ_NETWORK_GET_PREFERRED_NETWORK ]" << endl; 170111fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG 170211fccf17Sopenharmony_ci << "] ---->[ HREQ_NETWORK_GET_PHYSICAL_CHANNEL_CONFIG ]" << endl; 170311fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_LOCATE_UPDATES << "] ---->[ HREQ_NETWORK_SET_LOCATE_UPDATES ]" << endl; 170411fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_NOTIFICATION_FILTER << "] ---->[ HREQ_NETWORK_SET_NOTIFICATION_FILTER ]" 170511fccf17Sopenharmony_ci << endl; 170611fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_DEVICE_STATE << "] ---->[ HREQ_NETWORK_SET_DEVICE_STATE ]" << endl; 170711fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_SET_NR_OPTION_MODE << "] ---->[ HREQ_NETWORK_SET_NR_OPTION_MODE ]" << endl; 170811fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_NR_OPTION_MODE << "] ---->[ HREQ_NETWORK_GET_NR_OPTION_MODE ]" << endl; 170911fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_RRC_CONNECTION_STATE << "] ---->[ HREQ_NETWORK_GET_RRC_CONNECTION_STATE ]" 171011fccf17Sopenharmony_ci << endl; 171111fccf17Sopenharmony_ci cout << "----> [" << HREQ_NETWORK_GET_NR_SSBID_INFO << "] ---->[ HREQ_NETWORK_GET_NR_SSBID_INFO ]" << endl; 171211fccf17Sopenharmony_ci 171311fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_NETWORK_BASE, HREQ_COMMON_BASE - MENU_OFFSET, "Command"); 171411fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 171511fccf17Sopenharmony_ci choice = (choice == HREQ_NETWORK_BASE) ? DEFAULT_CHOICE : choice; 171611fccf17Sopenharmony_ci return choice; 171711fccf17Sopenharmony_ci} 171811fccf17Sopenharmony_ci 171911fccf17Sopenharmony_cistatic int32_t PrintModemMenu() 172011fccf17Sopenharmony_ci{ 172111fccf17Sopenharmony_ci cout << "---->[MODULE]MODEM:" << endl; 172211fccf17Sopenharmony_ci cout << "----> [" << HREQ_COMMON_BASE << "] ---->Back to the previous menu." << endl; 172311fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_SHUT_DOWN << "] ---->[ HREQ_MODEM_SHUT_DOWN ]" << endl; 172411fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_SET_RADIO_STATUS << "] ---->[ HREQ_MODEM_SET_RADIO_STATUS ]" << endl; 172511fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_RADIO_STATUS << "] ---->[ HREQ_MODEM_GET_RADIO_STATUS ]" << endl; 172611fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_IMEI << "] ---->[ HREQ_MODEM_GET_IMEI ]" << endl; 172711fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_IMEISV << "] ---->[ HREQ_MODEM_GET_IMEISV ]" << endl; 172811fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_MEID << "] ---->[ HREQ_MODEM_GET_MEID ]" << endl; 172911fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_VOICE_RADIO << "] ---->[ HREQ_MODEM_GET_VOICE_RADIO ]" << endl; 173011fccf17Sopenharmony_ci cout << "----> [" << HREQ_MODEM_GET_BASEBAND_VERSION << "] ---->[ HREQ_MODEM_GET_BASEBAND_VERSION ]" << endl; 173111fccf17Sopenharmony_ci 173211fccf17Sopenharmony_ci int32_t choice = InputInt32(HREQ_COMMON_BASE, HREQ_MODEM_EXIT - MENU_OFFSET, "Command"); 173311fccf17Sopenharmony_ci cout << "---->You choose: " << choice << endl; 173411fccf17Sopenharmony_ci choice = (choice == HREQ_COMMON_BASE) ? DEFAULT_CHOICE : choice; 173511fccf17Sopenharmony_ci return choice; 173611fccf17Sopenharmony_ci} 173711fccf17Sopenharmony_ci 173811fccf17Sopenharmony_cistatic int32_t SwitchMenu(TestMenu module, bool *loopFlag) 173911fccf17Sopenharmony_ci{ 174011fccf17Sopenharmony_ci int32_t mWhat = static_cast<int32_t>(TestMenu::NONE); 174111fccf17Sopenharmony_ci switch (module) { 174211fccf17Sopenharmony_ci case TestMenu::EXIT: 174311fccf17Sopenharmony_ci if (loopFlag != nullptr) { 174411fccf17Sopenharmony_ci *loopFlag = false; 174511fccf17Sopenharmony_ci } 174611fccf17Sopenharmony_ci break; 174711fccf17Sopenharmony_ci case TestMenu::MODEM: 174811fccf17Sopenharmony_ci mWhat = PrintModemMenu(); 174911fccf17Sopenharmony_ci break; 175011fccf17Sopenharmony_ci case TestMenu::CALL: 175111fccf17Sopenharmony_ci mWhat = PrintCallMenu(); 175211fccf17Sopenharmony_ci break; 175311fccf17Sopenharmony_ci case TestMenu::NETWORK: 175411fccf17Sopenharmony_ci mWhat = PrintNetworkMenu(); 175511fccf17Sopenharmony_ci break; 175611fccf17Sopenharmony_ci case TestMenu::SIM: 175711fccf17Sopenharmony_ci mWhat = PrintSimMenu(); 175811fccf17Sopenharmony_ci break; 175911fccf17Sopenharmony_ci case TestMenu::DATA: 176011fccf17Sopenharmony_ci mWhat = PrintDataMenu(); 176111fccf17Sopenharmony_ci break; 176211fccf17Sopenharmony_ci case TestMenu::SMS: 176311fccf17Sopenharmony_ci mWhat = PrintSmsMenu(); 176411fccf17Sopenharmony_ci break; 176511fccf17Sopenharmony_ci case TestMenu::STRESS: 176611fccf17Sopenharmony_ci mWhat = PrintStressMenu(); 176711fccf17Sopenharmony_ci break; 176811fccf17Sopenharmony_ci default: 176911fccf17Sopenharmony_ci break; 177011fccf17Sopenharmony_ci } 177111fccf17Sopenharmony_ci return mWhat; 177211fccf17Sopenharmony_ci} 177311fccf17Sopenharmony_ci 177411fccf17Sopenharmony_ciint32_t main() 177511fccf17Sopenharmony_ci{ 177611fccf17Sopenharmony_ci cout << "---->Ril Adapter Test Enter" << endl; 177711fccf17Sopenharmony_ci g_rilInterface = OHOS::HDI::Ril::V1_3::IRil::Get(); 177811fccf17Sopenharmony_ci if (g_rilInterface == nullptr) { 177911fccf17Sopenharmony_ci cout << "g_rilInterface is null" << endl; 178011fccf17Sopenharmony_ci return 0; 178111fccf17Sopenharmony_ci } 178211fccf17Sopenharmony_ci RilCallbackTest callback_; 178311fccf17Sopenharmony_ci g_rilInterface->SetCallback(&callback_); 178411fccf17Sopenharmony_ci RilInterfaceTest rilInterfaceTest; 178511fccf17Sopenharmony_ci rilInterfaceTest.OnInitInterface(); 178611fccf17Sopenharmony_ci bool loopFlag = true; 178711fccf17Sopenharmony_ci while (loopFlag) { 178811fccf17Sopenharmony_ci int32_t mWhat = static_cast<int32_t>(TestMenu::NONE); 178911fccf17Sopenharmony_ci int32_t module = static_cast<int32_t>(TestMenu::NONE); 179011fccf17Sopenharmony_ci module = PrintMenu(); 179111fccf17Sopenharmony_ci mWhat = SwitchMenu(static_cast<TestMenu>(module), &loopFlag); 179211fccf17Sopenharmony_ci if (mWhat <= 0) { 179311fccf17Sopenharmony_ci continue; 179411fccf17Sopenharmony_ci } 179511fccf17Sopenharmony_ci if (module == static_cast<int32_t>(TestMenu::STRESS)) { 179611fccf17Sopenharmony_ci rilInterfaceTest.OnStressInput(mWhat); 179711fccf17Sopenharmony_ci } else { 179811fccf17Sopenharmony_ci rilInterfaceTest.OnProcessInput(mWhat); 179911fccf17Sopenharmony_ci } 180011fccf17Sopenharmony_ci usleep(WAIT_TIME); 180111fccf17Sopenharmony_ci } 180211fccf17Sopenharmony_ci cout << "---->Ril Adapter Test end" << endl; 180311fccf17Sopenharmony_ci return 0; 180411fccf17Sopenharmony_ci} 1805