Imported Upstream version 1.7.8
[platform/upstream/edbus.git] / src / lib / bluez / e_bluez_manager.c
1 #include "e_bluez_private.h"
2
3 /**
4  * Get the element manager.
5  *
6  * @return element pointer if found, NULL otherwise.
7  */
8 E_Bluez_Element *
9 e_bluez_manager_get(void)
10 {
11    return e_bluez_element_get(manager_path);
12 }
13
14 /**
15  *
16  * Call method DefaultAdapter() on Manager.
17  * TODO: Soon this method will be replaced by ANY adapter inside BlueZ, so we
18  * won't need t to call it anymore.
19  *
20  * @param cb function to call when server replies or some error happens.
21  *
22  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
23  */
24 Eina_Bool
25 e_bluez_manager_default_adapter(E_DBus_Method_Return_Cb cb, void *data)
26 {
27    E_Bluez_Element *element = e_bluez_element_get(manager_path);
28    const char name[] = "DefaultAdapter";
29
30    EINA_SAFETY_ON_NULL_RETURN_VAL(element, EINA_FALSE);
31    return e_bluez_element_call_full
32              (element, name, NULL, &element->_pending.properties_get, cb, data);
33 }
34