• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_PROXY_H
16 #define OHOS_BLUETOOTH_STANDARD_HFP_AG_PROXY_H
17 
18 #include "i_bluetooth_hfp_ag.h"
19 #include "iremote_proxy.h"
20 
21 namespace OHOS {
22 namespace Bluetooth {
23 class BluetoothHfpAgProxy : public IRemoteProxy<IBluetoothHfpAg> {
24 public:
BluetoothHfpAgProxy(const sptr<IRemoteObject> & impl)25     explicit BluetoothHfpAgProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<IBluetoothHfpAg>(impl) {};
~BluetoothHfpAgProxy()26     ~BluetoothHfpAgProxy() {};
27 
28     int32_t GetConnectDevices(std::vector<BluetoothRawAddress> &devices) override;
29     int GetDevicesByStates(const std::vector<int> &states, std::vector<BluetoothRawAddress> &devices) override;
30     int32_t GetDeviceState(const BluetoothRawAddress &device, int32_t &state) override;
31     int32_t Connect(const BluetoothRawAddress &device) override;
32     int32_t Disconnect(const BluetoothRawAddress &device) override;
33     int GetScoState(const BluetoothRawAddress &device) override;
34     bool ConnectSco() override;
35     bool DisconnectSco() override;
36     void PhoneStateChanged(int numActive, int numHeld, int callState, const std::string &number, int type,
37         const std::string &name) override;
38     void ClccResponse(int index, int direction, int status, int mode, bool mpty, const std::string &number,
39         int type) override;
40     bool OpenVoiceRecognition(const BluetoothRawAddress &device) override;
41     bool CloseVoiceRecognition(const BluetoothRawAddress &device) override;
42     bool SetActiveDevice(const BluetoothRawAddress &device) override;
43     bool IntoMock(const BluetoothRawAddress &device, int state) override;
44     bool SendNoCarrier(const BluetoothRawAddress &device) override;
45     std::string GetActiveDevice() override;
46     void RegisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
47     void DeregisterObserver(const sptr<IBluetoothHfpAgObserver> &observer) override;
48     int SetConnectStrategy(const BluetoothRawAddress &device, int strategy) override;
49     int GetConnectStrategy(const BluetoothRawAddress &device, int &strategy) override;
50 
51 private:
52     static inline BrokerDelegator<BluetoothHfpAgProxy> delegator_;
53 };
54 
55 }  // namespace Bluetooth
56 }  // namespace OHOS
57 
58 #endif  // OHOS_BLUETOOTH_STANDARD_HFP_AG_PROXY_H