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_HF_SERVER_H 17 #define OHOS_BLUETOOTH_STANDARD_HFP_HF_SERVER_H 18 19 #include <string> 20 #include <vector> 21 22 #include "bluetooth_types.h" 23 #include "bluetooth_hfp_hf_stub.h" 24 25 namespace OHOS { 26 namespace Bluetooth { 27 class BluetoothHfpHfServer : public BluetoothHfpHfStub{ 28 public: 29 explicit BluetoothHfpHfServer(); 30 ~BluetoothHfpHfServer() override; 31 32 bool ConnectSco(const BluetoothRawAddress &device) override; 33 bool DisconnectSco(const BluetoothRawAddress &device) override; 34 int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) override; 35 int GetDeviceState(const BluetoothRawAddress &device) override; 36 int GetScoState(const BluetoothRawAddress &device) override; 37 bool SendDTMFTone(const BluetoothRawAddress &device, uint8_t code) override; 38 int Connect(const BluetoothRawAddress &device) override; 39 int Disconnect(const BluetoothRawAddress &device) override; 40 bool OpenVoiceRecognition(const BluetoothRawAddress &device) override; 41 bool CloseVoiceRecognition(const BluetoothRawAddress &device) override; 42 int GetCurrentCallList(const BluetoothRawAddress &device, std::vector<BluetoothHfpHfCall> &calls) override; 43 bool AcceptIncomingCall(const BluetoothRawAddress &device, int flag) override; 44 bool HoldActiveCall(const BluetoothRawAddress &device) override; 45 bool RejectIncomingCall(const BluetoothRawAddress &device) override; 46 bool SendKeyPressed(const BluetoothRawAddress &device) override; 47 bool HandleIncomingCall(const BluetoothRawAddress &device, int flag) override; 48 bool HandleMultiCall(const BluetoothRawAddress &device, int flag, int index) override; 49 bool DialLastNumber(const BluetoothRawAddress &device) override; 50 bool DialMemory(const BluetoothRawAddress &device, int index) override; 51 bool SendVoiceTag(const BluetoothRawAddress &device, int index) override; 52 bool FinishActiveCall(const BluetoothRawAddress &device, const BluetoothHfpHfCall &call) override; 53 int StartDial(const BluetoothRawAddress &device, const std::string &number, BluetoothHfpHfCall &call) override; 54 void RegisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) override; 55 void DeregisterObserver(const sptr<IBluetoothHfpHfObserver> &observer) override; 56 57 private: 58 BLUETOOTH_DECLARE_IMPL(); 59 BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothHfpHfServer); 60 }; 61 62 } // namespace Bluetooth 63 } // namespace OHOS 64 65 #endif // OHOS_BLUETOOTH_STANDARD_HFP_HF_SERVER_H