1 /******************************************************************
3 * Copyright 2015 Intel Corporation All Rights Reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 ******************************************************************/
19 #ifndef CA_BLE_LINUX_CENTRAL_H
20 #define CA_BLE_LINUX_CENTRAL_H
28 * Initialize and start a Linux BLE "central".
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.
34 * @param[in] context Context containing BlueZ adapter information.
36 * @return @c CA_STATUS_OK on success.
38 CAResult_t CACentralStart(CALEContext * context);
41 * Stop the Linux BLE "central".
43 * Shutdown all Linux BLE "central" operations, including stopping
44 * discovery, and disconnecting from all BLE peripherals.
46 * @param[in] context Context containing BlueZ adapter information.
48 * @return @c CA_STATUS_OK on success.
50 CAResult_t CACentralStop(CALEContext * context);
53 * Start discovery of OIC Transport Profile capable LE peripherals.
55 * @param[in] context Context containing BlueZ adapter information.
57 * @return @c CA_STATUS_OK on success.
59 CAResult_t CACentralStartDiscovery(CALEContext * context);
62 * Stop discovery of OIC Transport Profile capable LE peripherals.
64 * @param[in] context Context containing BlueZ adapter information.
66 * @return @c CA_STATUS_OK on success.
68 CAResult_t CACentralStopDiscovery(CALEContext * context);
71 * Connect to the LE peripheral pointed by @a device.
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.
77 * @return @c true on success, @c false otherwise.
79 bool CACentralConnect(GDBusProxy * device);
82 * Connect to all discovered LE peripherals.
84 * @param[in] context Context containing BlueZ adapter information.
86 * @return @c true on success, @c false otherwise.
88 bool CACentralConnectToAll(CALEContext * context);
91 #endif /* CA_BLE_LINUX_CENTRAL_H */