1 /* 2 * Copyright (C) 2021 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 BLUETOOTH_CALL_TEST_H 17 #define BLUETOOTH_CALL_TEST_H 18 19 #include <map> 20 21 namespace OHOS { 22 namespace Telephony { 23 enum class BluetoothCallFuncCode { 24 TEST_DIAL = 0, 25 TEST_ANSWER, 26 TEST_REJECT, 27 TEST_HANGUP, 28 TEST_GET_CALL_STATE, 29 TEST_HOLD, 30 TEST_UNHOLD, 31 TEST_SWITCH, 32 TEST_COMBINE_CONFERENCE, 33 TEST_SEPARATE_CONFERENCE, 34 TEST_START_DTMF, 35 TEST_STOP_DTMF, 36 TEST_IS_RINGING, 37 TEST_HAS_CALL, 38 TEST_IS_NEW_CALL_ALLOWED, 39 TEST_IS_IN_EMERGENCY_CALL, 40 TEST_SET_MUTED, 41 TEST_MUTE_RINGER, 42 TEST_SET_AUDIO_DEVICE, 43 TEST_GET_CURRENT_CALL_LIST, 44 }; 45 46 class BluetoothCallTest { 47 public: 48 BluetoothCallTest() = default; 49 ~BluetoothCallTest() = default; 50 int32_t Init(); 51 void RunBluetoothCallTest(); 52 53 private: 54 void PrintfUsage(); 55 void InitFunMap(); 56 using BluetoothCallFunc = void (BluetoothCallTest::*)(); 57 58 void DialCall(); 59 void AnswerCall(); 60 void RejectCall(); 61 void HangUpCall(); 62 void GetCallState(); 63 void HoldCall(); 64 void UnHoldCall(); 65 void SwitchCall(); 66 void CombineConference(); 67 void SeparateConference(); 68 void StartDtmf(); 69 void StopDtmf(); 70 void IsRinging(); 71 void HasCall(); 72 void IsNewCallAllowed(); 73 void IsInEmergencyCall(); 74 void SetMute(); 75 void MuteRinger(); 76 void SetAudioDevice(); 77 void GetCurrentCallList(); 78 79 std::map<uint32_t, BluetoothCallFunc> memberFuncMap_; 80 }; 81 } // namespace Telephony 82 } // namespace OHOS 83 #endif // CALL_MANAGER_CALLBACK_TEST_H 84