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 "i_bluetooth_hfp_ag_observer.h" 22 23 namespace OHOS { 24 namespace Bluetooth { 25 class IBluetoothHfpAg : public OHOS::IRemoteBroker { 26 public: 27 28 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothHfpAg"); 29 30 virtual int32_t GetConnectDevices(std::vector<BluetoothRawAddress> &devices) = 0; 31 virtual int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) = 0; 32 virtual int32_t GetDeviceState(const BluetoothRawAddress &device, int32_t &state) = 0; 33 virtual int32_t Connect(const BluetoothRawAddress &device) = 0; 34 virtual int32_t Disconnect(const BluetoothRawAddress &device) = 0; 35 virtual int GetScoState(const BluetoothRawAddress &device) = 0; 36 virtual bool ConnectSco() = 0; 37 virtual bool DisconnectSco() = 0; 38 virtual void PhoneStateChanged(int numActive, int numHeld, int callState, const std::string &number, int type, 39 const std::string &name) = 0; 40 virtual void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number, 41 int type) = 0; 42 virtual bool OpenVoiceRecognition(const BluetoothRawAddress &device) = 0; 43 virtual bool CloseVoiceRecognition(const BluetoothRawAddress &device) = 0; 44 virtual bool SetActiveDevice(const BluetoothRawAddress &device) = 0; 45 virtual std::string GetActiveDevice() = 0; 46 virtual bool IntoMock(const BluetoothRawAddress &device, int state) = 0; 47 virtual bool SendNoCarrier(const BluetoothRawAddress &device) = 0; 48 virtual void RegisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) = 0; 49 virtual void DeregisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) = 0; 50 virtual int SetConnectStrategy(const BluetoothRawAddress &device, int strategy) = 0; 51 virtual int GetConnectStrategy(const BluetoothRawAddress &device, int &strategy) = 0; 52 }; 53 54 } // namespace Bluetooth 55 } // namespace OHOS 56 57 #endif // OHOS_BLUETOOTH_STANDARD_HFP_AG_INTERFACE_H