Providing build option to disable BLE server
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / linux / central.h
1 /******************************************************************
2  *
3  * Copyright 2015 Intel Corporation All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  ******************************************************************/
18
19 #ifndef CA_BLE_LINUX_CENTRAL_H
20 #define CA_BLE_LINUX_CENTRAL_H
21
22 #include "context.h"
23
24 #include "cacommon.h"
25
26
27 /**
28  * Initialize and start a Linux BLE "central".
29  *
30  * Initialize all Linux BLE "central" state (i.e. a global
31  * @c CACentralContext instance), as well as start
32  * discovery of OIC GATT transport service capable peripherals.
33  *
34  * @param[in] context Context containing BlueZ adapter information.
35  *
36  * @return @c CA_STATUS_OK on success.
37  */
38 CAResult_t CACentralStart(CALEContext * context);
39
40 /**
41  * Stop the Linux BLE "central".
42  *
43  * Shutdown all Linux BLE "central" operations, including stopping
44  * discovery, and disconnecting from all BLE peripherals.
45  *
46  * @param[in] context Context containing BlueZ adapter information.
47  *
48  * @return @c CA_STATUS_OK on success.
49  */
50 CAResult_t CACentralStop(CALEContext * context);
51
52 /**
53  * Start discovery of OIC Transport Profile capable LE peripherals.
54  *
55  * @param[in] context Context containing BlueZ adapter information.
56  *
57  * @return @c CA_STATUS_OK on success.
58  */
59 CAResult_t CACentralStartDiscovery(CALEContext * context);
60
61 /**
62  * Stop discovery of OIC Transport Profile capable LE peripherals.
63  *
64  * @param[in] context Context containing BlueZ adapter information.
65  *
66  * @return @c CA_STATUS_OK on success.
67  */
68 CAResult_t CACentralStopDiscovery(CALEContext * context);
69
70 /**
71  * Connect to the LE peripheral pointed by @a device.
72  *
73  * @param[in] device Proxy to the BlueZ @c org.bluez.Device1 object
74  *                   through which the connection to the LE peripheral
75  *                   will be established.
76  *
77  * @return @c true on success, @c false otherwise.
78  */
79 bool CACentralConnect(GDBusProxy * device);
80
81 /**
82  * Connect to all discovered LE peripherals.
83  *
84  * @param[in] context Context containing BlueZ adapter information.
85  *
86  * @return @c true on success, @c false otherwise.
87  */
88 bool CACentralConnectToAll(CALEContext * context);
89
90
91 #endif  /* CA_BLE_LINUX_CENTRAL_H */