• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #ifndef CRAS_BT_ADAPTER_H_
7 #define CRAS_BT_ADAPTER_H_
8 
9 #include <dbus/dbus.h>
10 
11 struct cras_bt_adapter;
12 
13 /* Creates an bt_adapter instance representing the bluetooth controller
14  * on the system.
15  * Args:
16  *    conn - The dbus connection.
17  *    object_path - Object path of the bluetooth controller.
18  */
19 struct cras_bt_adapter *cras_bt_adapter_create(DBusConnection *conn,
20 					       const char *object_path);
21 void cras_bt_adapter_destroy(struct cras_bt_adapter *adapter);
22 void cras_bt_adapter_reset();
23 
24 struct cras_bt_adapter *cras_bt_adapter_get(const char *object_path);
25 size_t cras_bt_adapter_get_list(struct cras_bt_adapter ***adapter_list_out);
26 
27 const char *cras_bt_adapter_object_path(const struct cras_bt_adapter *adapter);
28 const char *cras_bt_adapter_address(const struct cras_bt_adapter *adapter);
29 const char *cras_bt_adapter_name(const struct cras_bt_adapter *adapter);
30 
31 int cras_bt_adapter_powered(const struct cras_bt_adapter *adapter);
32 
33 /*
34  * Returns true if adapter supports wide band speech feature.
35  */
36 int cras_bt_adapter_wbs_supported(struct cras_bt_adapter *adapter);
37 
38 void cras_bt_adapter_update_properties(struct cras_bt_adapter *adapter,
39 				       DBusMessageIter *properties_array_iter,
40 				       DBusMessageIter *invalidated_array_iter);
41 
42 int cras_bt_adapter_on_usb(struct cras_bt_adapter *adapter);
43 
44 /*
45  * Queries adapter supported capabilies from bluetooth daemon. This shall
46  * be called only after adapter powers on.
47  */
48 int cras_bt_adapter_get_supported_capabilities(struct cras_bt_adapter *adapter);
49 
50 #endif /* CRAS_BT_ADAPTER_H_ */
51