#include <stddef.h>
#include <stdio.h>
#include <Eina.h>
#include <eina_safety_checks.h>
#include "E_Bluez.h"


Go to the source code of this file.
Data Structures | |
struct | _E_Bluez_Element_Dict_Entry |
Macros | |
#define | _dbus_iter_type_check(t, e) __dbus_iter_type_check(t, e, # e) |
#define | DBG(...) EINA_LOG_DOM_DBG(_e_dbus_bluez_log_dom, __VA_ARGS__) |
#define | EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN |
#define | ERR(...) EINA_LOG_DOM_ERR(_e_dbus_bluez_log_dom, __VA_ARGS__) |
#define | INF(...) EINA_LOG_DOM_INFO(_e_dbus_bluez_log_dom, __VA_ARGS__) |
#define | WRN(...) EINA_LOG_DOM_WARN(_e_dbus_bluez_log_dom, __VA_ARGS__) |
Typedefs | |
typedef struct _E_Bluez_Element_Dict_Entry | E_Bluez_Element_Dict_Entry |
Functions | |
void * | alloca (size_t) |
E_Bluez_Element_Dict_Entry * | e_bluez_element_array_dict_find_stringshared (const E_Bluez_Array *array, const char *key) |
void | e_bluez_element_array_free (E_Bluez_Array *array, E_Bluez_Array *new __UNUSED__) |
Eina_Bool | e_bluez_element_call_full (E_Bluez_Element *element, const char *method_name, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) |
Eina_Bool | e_bluez_element_call_with_path (E_Bluez_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) |
Eina_Bool | e_bluez_element_call_with_path_and_string (E_Bluez_Element *element, const char *method_name, const char *path, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) |
Eina_Bool | e_bluez_element_call_with_string (E_Bluez_Element *element, const char *method_name, const char *string, E_DBus_Method_Return_Cb cb, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) |
void | e_bluez_element_event_add (int event_type, E_Bluez_Element *element) |
E_Bluez_Array * | e_bluez_element_iter_get_array (DBusMessageIter *itr, const char *key) |
Eina_Bool | e_bluez_element_message_send (E_Bluez_Element *element, const char *method_name, E_DBus_Method_Return_Cb cb, DBusMessage *msg, Eina_Inlist **pending, E_DBus_Method_Return_Cb user_cb, const void *user_data) |
E_Bluez_Element * | e_bluez_element_register (const char *path, const char *interface) |
void | e_bluez_element_unregister (E_Bluez_Element *element) |
void | e_bluez_elements_init (void) |
void | e_bluez_elements_shutdown (void) |
void | e_bluez_manager_clear_elements (void) |
const char * | e_bluez_system_bus_name_get (void) |
Variables | |
int | _e_dbus_bluez_log_dom |
E_DBus_Connection * | e_bluez_conn |
const char * | e_bluez_iface_adapter |
const char * | e_bluez_iface_device |
const char * | e_bluez_iface_manager |
const char * | e_bluez_prop_address |
const char * | e_bluez_prop_alias |
const char * | e_bluez_prop_class |
const char * | e_bluez_prop_connected |
const char * | e_bluez_prop_devices |
const char * | e_bluez_prop_discoverable |
const char * | e_bluez_prop_discoverabletimeout |
const char * | e_bluez_prop_discovering |
const char * | e_bluez_prop_icon |
const char * | e_bluez_prop_name |
const char * | e_bluez_prop_pairable |
const char * | e_bluez_prop_pairabletimeout |
const char * | e_bluez_prop_paired |
const char * | e_bluez_prop_powered |
const char * | e_bluez_prop_trusted |
const char * | e_bluez_prop_uuids |
Macro Definition Documentation
◆ _dbus_iter_type_check
#define _dbus_iter_type_check | ( | t, | |
e | |||
) | __dbus_iter_type_check(t, e, # e) |
◆ DBG
#define DBG | ( | ... | ) | EINA_LOG_DOM_DBG(_e_dbus_bluez_log_dom, __VA_ARGS__) |
◆ EINA_LOG_DEFAULT_COLOR
#define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN |
◆ ERR
#define ERR | ( | ... | ) | EINA_LOG_DOM_ERR(_e_dbus_bluez_log_dom, __VA_ARGS__) |
◆ INF
#define INF | ( | ... | ) | EINA_LOG_DOM_INFO(_e_dbus_bluez_log_dom, __VA_ARGS__) |
◆ WRN
#define WRN | ( | ... | ) | EINA_LOG_DOM_WARN(_e_dbus_bluez_log_dom, __VA_ARGS__) |
Typedef Documentation
◆ E_Bluez_Element_Dict_Entry
typedef struct _E_Bluez_Element_Dict_Entry E_Bluez_Element_Dict_Entry |
Function Documentation
◆ alloca()
void * alloca | ( | size_t | ) |
◆ e_bluez_element_array_dict_find_stringshared()
E_Bluez_Element_Dict_Entry * e_bluez_element_array_dict_find_stringshared | ( | const E_Bluez_Array * | array, |
const char * | key | ||
) |
References _E_Bluez_Array::array, and _E_Bluez_Element_Dict_Entry::name.
Referenced by e_bluez_devicefound_alias_get(), and e_bluez_element_property_dict_get_stringshared().
◆ e_bluez_element_array_free()
void e_bluez_element_array_free | ( | E_Bluez_Array * | array, |
E_Bluez_Array *new | __UNUSED__ | ||
) |
References _E_Bluez_Array::array, and _E_Bluez_Array::type.
Referenced by e_bluez_devicefound_free().
◆ e_bluez_element_call_full()
Eina_Bool e_bluez_element_call_full | ( | E_Bluez_Element * | element, |
const char * | method_name, | ||
E_DBus_Method_Return_Cb | cb, | ||
Eina_Inlist ** | pending, | ||
E_DBus_Method_Return_Cb | user_cb, | ||
const void * | user_data | ||
) |
◆ e_bluez_element_call_with_path()
Eina_Bool e_bluez_element_call_with_path | ( | E_Bluez_Element * | element, |
const char * | method_name, | ||
const char * | string, | ||
E_DBus_Method_Return_Cb | cb, | ||
Eina_Inlist ** | pending, | ||
E_DBus_Method_Return_Cb | user_cb, | ||
const void * | user_data | ||
) |
References e_bluez_element_message_send(), e_bluez_system_bus_name_get(), _E_Bluez_Element::interface, and _E_Bluez_Element::path.
Referenced by e_bluez_adapter_agent_unregister().
◆ e_bluez_element_call_with_path_and_string()
Eina_Bool e_bluez_element_call_with_path_and_string | ( | E_Bluez_Element * | element, |
const char * | method_name, | ||
const char * | path, | ||
const char * | string, | ||
E_DBus_Method_Return_Cb | cb, | ||
Eina_Inlist ** | pending, | ||
E_DBus_Method_Return_Cb | user_cb, | ||
const void * | user_data | ||
) |
References e_bluez_element_message_send(), e_bluez_system_bus_name_get(), _E_Bluez_Element::interface, and _E_Bluez_Element::path.
Referenced by e_bluez_adapter_agent_register().
◆ e_bluez_element_call_with_string()
Eina_Bool e_bluez_element_call_with_string | ( | E_Bluez_Element * | element, |
const char * | method_name, | ||
const char * | string, | ||
E_DBus_Method_Return_Cb | cb, | ||
Eina_Inlist ** | pending, | ||
E_DBus_Method_Return_Cb | user_cb, | ||
const void * | user_data | ||
) |
◆ e_bluez_element_event_add()
void e_bluez_element_event_add | ( | int | event_type, |
E_Bluez_Element * | element | ||
) |
References e_bluez_element_ref().
◆ e_bluez_element_iter_get_array()
E_Bluez_Array * e_bluez_element_iter_get_array | ( | DBusMessageIter * | itr, |
const char * | key | ||
) |
References _E_Bluez_Array::array, DBG, ERR, and _E_Bluez_Array::type.
◆ e_bluez_element_message_send()
Eina_Bool e_bluez_element_message_send | ( | E_Bluez_Element * | element, |
const char * | method_name, | ||
E_DBus_Method_Return_Cb | cb, | ||
DBusMessage * | msg, | ||
Eina_Inlist ** | pending, | ||
E_DBus_Method_Return_Cb | user_cb, | ||
const void * | user_data | ||
) |
Send message with callbacks set to work with bluez elements.
If this call fails (returns EINA_FALSE
), pending callbacks will not be called, not even with error messages.
- Returns
EINA_TRUE
on success,EINA_FALSE
on failure.
References _E_Bluez_Element_Call_Data::cb, _E_Bluez_Element_Pending::data, e_bluez_conn, e_dbus_message_send(), _E_Bluez_Element_Call_Data::element, ERR, _E_Bluez_Element_Call_Data::p_list, _E_Bluez_Element_Pending::pending, _E_Bluez_Element_Call_Data::pending, _E_Bluez_Element_Pending::user_cb, and _E_Bluez_Element_Pending::user_data.
Referenced by e_bluez_adapter_create_paired_device(), e_bluez_element_call_full(), e_bluez_element_call_with_path(), e_bluez_element_call_with_path_and_string(), e_bluez_element_call_with_string(), e_bluez_element_property_dict_set_full(), and e_bluez_element_property_set_full().
◆ e_bluez_element_register()
E_Bluez_Element * e_bluez_element_register | ( | const char * | path, |
const char * | interface | ||
) |
Register the given path, possible creating and element and return it.
This will check if path is already registered, in that case the exiting element is returned. If it was not registered yet, a new element is created, registered and returned.
This call will not add extra references to the object.
- Parameters
-
path the path to register the element
- Returns
- the registered object, no references are added.
◆ e_bluez_element_unregister()
void e_bluez_element_unregister | ( | E_Bluez_Element * | element | ) |
Forget about the given element.
This will remove the element from the pool of known objects, then add an E_BLUEZ_EVENT_ELEMENT_DEL and after that will unreference it, possible freeing it.
- Parameters
-
element element to forget about. Its reference will be removed.
◆ e_bluez_elements_init()
void e_bluez_elements_init | ( | void | ) |
Creates elements hash.
This has no init counter since its already guarded by other code.
Referenced by e_bluez_manager_clear_elements().
◆ e_bluez_elements_shutdown()
void e_bluez_elements_shutdown | ( | void | ) |
Referenced by e_bluez_manager_clear_elements().
◆ e_bluez_manager_clear_elements()
void e_bluez_manager_clear_elements | ( | void | ) |
Remove all known elements.
This will remove all known elements but will NOT add any E_BLUEZ_EVENT_ELEMENT_DEL to main loop.
This is just useful to make sure next e_bluez_manager_sync_elements() will not leave any stale elements. This is unlikely to happen, as E_Bluez is supposed to catch all required events to avoid stale elements.
References e_bluez_elements_init(), and e_bluez_elements_shutdown().
◆ e_bluez_system_bus_name_get()
const char * e_bluez_system_bus_name_get | ( | void | ) |
Referenced by e_bluez_adapter_create_paired_device(), e_bluez_adapter_start_discovery(), e_bluez_element_call_full(), e_bluez_element_call_with_path(), e_bluez_element_call_with_path_and_string(), e_bluez_element_call_with_string(), e_bluez_element_property_dict_set_full(), and e_bluez_element_property_set_full().
Variable Documentation
◆ _e_dbus_bluez_log_dom
|
extern |
◆ e_bluez_conn
|
extern |
Referenced by e_bluez_adapter_start_discovery(), and e_bluez_element_message_send().
◆ e_bluez_iface_adapter
|
extern |
◆ e_bluez_iface_device
|
extern |
◆ e_bluez_iface_manager
|
extern |
◆ e_bluez_prop_address
|
extern |
Referenced by e_bluez_adapter_address_get().
◆ e_bluez_prop_alias
|
extern |
Referenced by e_bluez_device_alias_get(), and e_bluez_devicefound_alias_get().
◆ e_bluez_prop_class
|
extern |
◆ e_bluez_prop_connected
|
extern |
◆ e_bluez_prop_devices
|
extern |
◆ e_bluez_prop_discoverable
|
extern |
Referenced by e_bluez_adapter_discoverable_get(), and e_bluez_adapter_discoverable_set().
◆ e_bluez_prop_discoverabletimeout
|
extern |
Referenced by e_bluez_adapter_discoverable_timeout_get(), and e_bluez_adapter_discoverable_timeout_set().
◆ e_bluez_prop_discovering
|
extern |
Referenced by e_bluez_adapter_discovering_get().
◆ e_bluez_prop_icon
|
extern |
◆ e_bluez_prop_name
|
extern |
Referenced by e_bluez_adapter_name_get(), e_bluez_adapter_name_set(), and e_bluez_device_name_get().
◆ e_bluez_prop_pairable
|
extern |
◆ e_bluez_prop_pairabletimeout
|
extern |
◆ e_bluez_prop_paired
|
extern |
Referenced by e_bluez_device_paired_get().
◆ e_bluez_prop_powered
|
extern |
Referenced by e_bluez_adapter_powered_get(), and e_bluez_adapter_powered_set().
◆ e_bluez_prop_trusted
|
extern |
◆ e_bluez_prop_uuids
|
extern |