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_AG_INTERFACE_H 16 #define OHOS_BLUETOOTH_STANDARD_HFP_AG_INTERFACE_H 17 18 #include <string> 19 #include <vector> 20 #include "bluetooth_service_ipc_interface_code.h" 21 #include "bluetooth_phone_state.h" 22 #include "i_bluetooth_hfp_ag_observer.h" 23 24 namespace OHOS { 25 namespace Bluetooth { 26 class IBluetoothHfpAg : public OHOS::IRemoteBroker { 27 public: 28 29 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothHfpAg"); 30 31 virtual int32_t GetConnectDevices(std::vector<BluetoothRawAddress> &devices) = 0; 32 virtual int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) = 0; 33 virtual int32_t GetDeviceState(const BluetoothRawAddress &device, int32_t &state) = 0; 34 virtual int32_t Connect(const BluetoothRawAddress &device) = 0; 35 virtual int32_t Disconnect(const BluetoothRawAddress &device) = 0; 36 virtual int GetScoState(const BluetoothRawAddress &device) = 0; 37 virtual int32_t ConnectSco(uint8_t callType) = 0; 38 virtual int32_t DisconnectSco(uint8_t callType) = 0; 39 virtual bool ConnectSco() = 0; 40 virtual bool DisconnectSco() = 0; 41 virtual void PhoneStateChanged(BluetoothPhoneState &phoneState) = 0; 42 virtual void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number, 43 int type) = 0; 44 virtual bool OpenVoiceRecognition(const BluetoothRawAddress &device) = 0; 45 virtual bool CloseVoiceRecognition(const BluetoothRawAddress &device) = 0; 46 virtual bool SetActiveDevice(const BluetoothRawAddress &device) = 0; 47 virtual std::string GetActiveDevice() = 0; 48 virtual bool IntoMock(const BluetoothRawAddress &device, int state) = 0; 49 virtual bool SendNoCarrier(const BluetoothRawAddress &device) = 0; 50 virtual void RegisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) = 0; 51 virtual void DeregisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) = 0; 52 virtual int SetConnectStrategy(const BluetoothRawAddress &device, int strategy) = 0; 53 virtual int GetConnectStrategy(const BluetoothRawAddress &device, int &strategy) = 0; 54 virtual int IsInbandRingingEnabled(bool &isEnabled) = 0; 55 virtual void CallDetailsChanged(int callId, int callState) = 0; 56 virtual int IsVgsSupported(const BluetoothRawAddress &device, bool &isSupported) = 0; 57 virtual void EnableBtCallLog(bool state) = 0; 58 virtual void GetVirtualDeviceList(std::vector<std::string> &devices) = 0; 59 virtual void UpdateVirtualDevice(int32_t action, const std::string &address) = 0; 60 }; 61 62 } // namespace Bluetooth 63 } // namespace OHOS 64 65 #endif // OHOS_BLUETOOTH_STANDARD_HFP_AG_INTERFACE_H