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 #ifndef OHOS_BLUETOOTH_STANDARD_HFP_HF_INTERFACE_H 16 #define OHOS_BLUETOOTH_STANDARD_HFP_HF_INTERFACE_H 17 18 #include <string> 19 #include <vector> 20 #include "bluetooth_service_ipc_interface_code.h" 21 #include "i_bluetooth_hfp_hf_observer.h" 22 23 namespace OHOS { 24 namespace Bluetooth { 25 class IBluetoothHfpHf : public OHOS::IRemoteBroker { 26 public: 27 28 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothHfpHf"); 29 30 virtual bool ConnectSco(const BluetoothRawAddress &device) = 0; 31 virtual bool DisconnectSco(const BluetoothRawAddress &device) = 0; 32 virtual int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) = 0; 33 virtual int GetDeviceState(const BluetoothRawAddress &device) = 0; 34 virtual int GetScoState(const BluetoothRawAddress &device) = 0; 35 virtual bool SendDTMFTone(const BluetoothRawAddress &device, uint8_t code) = 0; 36 virtual int Connect(const BluetoothRawAddress &device) = 0; 37 virtual int Disconnect(const BluetoothRawAddress &device) = 0; 38 virtual bool OpenVoiceRecognition(const BluetoothRawAddress &device) = 0; 39 virtual bool CloseVoiceRecognition(const BluetoothRawAddress &device) = 0; 40 virtual int GetCurrentCallList(const BluetoothRawAddress &device, std::vector<BluetoothHfpHfCall> &calls) = 0; 41 virtual bool AcceptIncomingCall(const BluetoothRawAddress &device, int flag) = 0; 42 virtual bool HoldActiveCall(const BluetoothRawAddress &device) = 0; 43 virtual bool RejectIncomingCall(const BluetoothRawAddress &device) = 0; 44 virtual bool SendKeyPressed(const BluetoothRawAddress &device) = 0; 45 virtual bool HandleIncomingCall(const BluetoothRawAddress &device, int flag) = 0; 46 virtual bool HandleMultiCall(const BluetoothRawAddress &device, int flag, int index) = 0; 47 virtual bool DialLastNumber(const BluetoothRawAddress &device) = 0; 48 virtual bool DialMemory(const BluetoothRawAddress &device, int index) = 0; 49 virtual bool SendVoiceTag(const BluetoothRawAddress &device, int index) = 0; 50 virtual bool FinishActiveCall(const BluetoothRawAddress &device, const BluetoothHfpHfCall &call) = 0; 51 virtual int StartDial(const BluetoothRawAddress &device, const std::string &number, BluetoothHfpHfCall &call) = 0; 52 virtual void RegisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) = 0; 53 virtual void DeregisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) = 0; 54 }; 55 56 } // namespace Bluetooth 57 } // namespace OHOS 58 59 #endif // OHOS_BLUETOOTH_STANDARD_HFP_HF_INTERFACE_H