• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(int numActive, int numHeld, int callState, const std::string &number, int type,
41         const std::string &name) override;
42     void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number,
43         int type) override;
44     bool OpenVoiceRecognition(const BluetoothRawAddress &device) override;
45     bool CloseVoiceRecognition(const BluetoothRawAddress &device) override;
46     bool SetActiveDevice(const BluetoothRawAddress &device) override;
47     std::string GetActiveDevice() override;
48     bool IntoMock(const BluetoothRawAddress &device, int state) override;
49     bool SendNoCarrier(const BluetoothRawAddress &device) override;
50     void RegisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
51     void DeregisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
52     int SetConnectStrategy(const BluetoothRawAddress &device, int strategy) override;
53     int GetConnectStrategy(const BluetoothRawAddress &device, int &strategy) override;
54 
55 private:
56     BLUETOOTH_DECLARE_IMPL();
57     BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothHfpAgServer);
58 };
59 
60 }  // namespace Bluetooth
61 }  // namespace OHOS
62 
63 #endif // OHOS_BLUETOOTH_STANDARD_HFP_AG_SERVER_H