1/*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef OHOS_RIL_INTERFACE_TEST_H
17#define OHOS_RIL_INTERFACE_TEST_H
18
19#include "cmath"
20#include "cstdio"
21#include "hdf_base.h"
22#include "hdf_log.h"
23#include "ril_callback_test.h"
24#include "securec.h"
25#include "stdlib.h"
26#include "unistd.h"
27namespace OHOS {
28namespace Telephony {
29class RilInterfaceTest {
30public:
31    void GetImeiStressTest(int32_t slotId);
32    void GetImeiSvStressTest(int32_t slotId);
33    void RilCmDialStressTest(int32_t slotId);
34    void SetRadioStateStressTest(int32_t slotId);
35    void GetCallListTest(int32_t slotId);
36    void RilCmDialTest(int32_t slotId);
37    void HangupTest(int32_t slotId);
38    void RejectTest(int32_t slotId);
39    void AnswerCallTest(int32_t slotId);
40    void HoldCallTest(int32_t slotId);
41    void UnHoldCallTest(int32_t slotId);
42    void SwitchCallTest(int32_t slotId);
43    void RilCmJoinCallTest(int32_t slotId);
44    void RilCmSplitCallTest(int32_t slotId);
45    void CallSupplementTest(int32_t slotId);
46    void SendDtmfTest(int32_t slotId);
47    void StartDtmfTest(int32_t slotId);
48    void StopDtmfTest(int32_t slotId);
49    void SetUssdCusdTest(int32_t slotId);
50    void GetUssdCusdTest(int32_t slotId);
51    void SetMuteTest(int32_t slotId);
52    void GetMuteTest(int32_t slotId);
53    void GetEmergencyListTest(int32_t slotId);
54    void SetEmergencyCallListTest(int32_t slotId);
55    void GetFailReasonTest(int32_t slotId);
56    void SetBarringPasswordTest(int32_t slotId);
57    void IccRilSimIoForAppTest(int32_t slotId);
58    void GetRilCmImsiForAppTest(int32_t slotId);
59    void GetRilCmSignalIntensityTest(int32_t slotId);
60    void GetRilCmIccCardStatusTest(int32_t slotId);
61    void GetRilCmCsRegStatusTest(int32_t slotId);
62    void GetRilCmPsRegStatusTest(int32_t slotId);
63    void GetRilCmOperatorTest(int32_t slotId);
64    void SendRilCmSmsTest(int32_t slotId);
65    void SendRilCmSmsMoreModeTest(int32_t slotId);
66    void SendSmsAckTest(int32_t slotId);
67    void GetSmscAddrTest(int32_t slotId);
68    void SetSmscAddrTest(int32_t slotId);
69    void SetRadioStateTest(int32_t slotId);
70    void GetRadioStateTest(int32_t slotId);
71    void GetImeiTest(int32_t slotId);
72    void GetImeiSvTest(int32_t slotId);
73    void GetRilCmCellInfoListTest(int32_t slotId);
74    void GetRilCurrentCellInfoTest(int32_t slotId);
75    void GetRilNetworkSearchInfoTest(int32_t slotId);
76    void GetRilNetworkSelectionModeTest(int32_t slotId);
77    void GetRilPreferredNetwrokTest(int32_t slotId);
78    void GetPhysicalChannelConfigTest(int32_t slotId);
79    void GetRilImeiTest(int32_t slotId);
80    void GetRilImeiSvTest(int32_t slotId);
81    void ShutDownTest(int32_t slotId);
82    void GetMeidTest(int32_t slotId);
83    void GetVoiceRadioTechnologyTest(int32_t slotId);
84    void GetBasebandVersionTest(int32_t slotId);
85    void SendDataPerformanceModeTest(int32_t slotId);
86    void SendDataSleepModeTest(int32_t slotId);
87    void SetRilPreferredNetworkTest(int32_t slotId);
88    void SetRilNetworkSelectionModeTest(int32_t slotId);
89    void SetRilLocationUpdateTest(int32_t slotId);
90    void SetRilNotificationFilterTest(int32_t slotId);
91    void SetRilDeviceStateTest(int32_t slotId);
92    void GetNrOptionModeTest(int32_t slotId);
93    void SetNrOptionModeTest(int32_t slotId);
94    void GetRrcConnectionStateTest(int32_t slotId);
95    void GetNrSsbIdTest(int32_t slotId);
96    void ActivatePdpContextTest(int32_t slotId);
97    void DeactivatePdpContextTest(int32_t slotId);
98    void GetPdpContextListTest(int32_t slotId);
99    void SetInitialApnTest(int32_t slotId);
100    void SetDataProfileInfoTest(int32_t slotId);
101    void SetDataPermittedTest(int32_t slotId);
102    void SetLinkBandwidthReportingRuleTest(int32_t slotId);
103    void OnProcessInput(int32_t what);
104    void OnStressInput(int32_t what);
105    void SimOpenLogicalChannelTest(int32_t slotId);
106    void SimCloseLogicalChannelTest(int32_t slotId);
107    void SimTransmitApduLogicalChannelTest(int32_t slotId);
108    void SimAuthenticationTest(int32_t slotId);
109    void SendSimMatchedOperatorInfoTest(int32_t slotId);
110    void SetActiveSimTest(int32_t slotId);
111    void SimTransmitApduBasicChannelTest(int32_t slotId);
112    void UnlockSimLockTest(int32_t slotId);
113    void GetLinkBandwidthInfoTest(int32_t slotId);
114    void GetLinkCapabilityTest(int32_t slotId);
115    void CleanAllConnectionsTest(int32_t slotId);
116    void UnLockPINTest(int32_t slotId);
117    void UnLockPIN2Test(int32_t slotId);
118    void UnLockPUKTest(int32_t slotId);
119    void UnLockPUK2Test(int32_t slotId);
120    void ChangeSimPasswordTest(int32_t slotId);
121    void SetSimLockTest(int32_t slotId);
122    void GetSimLockStatusTest(int32_t slotId);
123    void SendTerminalResponseCmdTest(int32_t slotId);
124    void SendEnvelopeCmdTest(int32_t slotId);
125    void SendCallSetupRequestResultTest(int32_t slotId);
126    void SimStkIsReadyTest(int32_t slotId);
127    void OnInitInterface();
128    void OnInitStressInterface();
129    void OnInitCallProcessInterface();
130    void OnInitSmsProcessInterface();
131    void OnInitSimProcessInterface();
132    void OnInitDataProcessInterface();
133    void OnInitNetworkProcessInterface();
134    void OnInitModemProcessInterface();
135    void OnInitProcessInterface();
136    int32_t GetSerialId();
137    void InputTransmitApduChannelParam(OHOS::HDI::Ril::V1_1::ApduSimIORequestInfo &reqInfo);
138
139private:
140    using RilInterfaceTestTestFun = void (RilInterfaceTest::*)(int32_t slotId);
141    std::map<uint32_t, RilInterfaceTestTestFun> memberFuncMap_;
142    std::map<uint32_t, RilInterfaceTestTestFun> stressMemberFuncMap_;
143};
144
145} // namespace Telephony
146} // namespace OHOS
147#endif // OHOS_RIL_INTERFACE_TEST_H
148