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 /**
17  * @addtogroup Bluetooth
18  * @{
19  *
20  * @brief Defines a bluetooth system that provides basic bluetooth connection and profile functions,
21  *        including A2DP, AVRCP, BLE, GATT, HFP, MAP, PBAP, and SPP, etc.
22  *
23  * @since 6
24  *
25  */
26 
27 /**
28  * @file bluetooth_gatt_manager.h
29  *
30  * @brief gatt manager interface.
31  *
32  * @since 6
33  *
34  */
35 
36 #ifndef BLUETOOTH_GATT_MANAGER_H
37 #define BLUETOOTH_GATT_MANAGER_H
38 
39 #include "bluetooth_def.h"
40 #include "bluetooth_types.h"
41 #include "bluetooth_remote_device.h"
42 
43 namespace OHOS {
44 namespace Bluetooth {
45 /**
46  * @brief Class for Gatt Manager.
47  *
48  * @since 6
49  *
50  */
51 class BLUETOOTH_API GattManager {
52 public:
53     static constexpr uint8_t GATT_CONNECTION_STATE_NUM = 4;
54     /**
55      * @brief The function to get devices by state.
56      *
57      * @param states State of devices.
58      * @return list of devices.
59      * @since 6
60      *
61      */
62     std::vector<BluetoothRemoteDevice> GetDevicesByStates(const std::array<int, GATT_CONNECTION_STATE_NUM> &states);
63 
64     /**
65      * @brief The function to get devices by state.
66      *
67      * @return list of devices.
68      * @since 6
69      *
70      */
71     std::vector<BluetoothRemoteDevice> GetConnectedDevices();
72 
73     /**
74      * @brief A constructor used to create a GattManager instance.
75      *
76      * @since 6
77      *
78      */
79     GattManager();
80     /**
81      * @brief A destructor of GattManager.
82      *
83      * @since 6
84      *
85      */
86     ~GattManager();
87 
88 private:
89     BLUETOOTH_DECLARE_IMPL();
90 };
91 } // namespace Bluetooth
92 } // namespace OHOS
93 #endif  // BLUETOOTH_GATT_MANAGER_H
94