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