#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 |
Defines | |
#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 |
Define Documentation
#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__) |
Referenced by e_bluez_element_iter_get_array(), e_bluez_manager_sync_elements(), e_connman_element_property_dict_get_stringshared(), e_connman_manager_sync_elements(), e_dbus_connection_close(), e_dbus_interface_method_add(), e_dbus_interface_ref(), e_dbus_interface_signal_add(), e_dbus_interface_unref(), e_dbus_object_free(), e_dbus_object_interface_attach(), e_dbus_object_interface_detach(), e_dbus_signal_handler_add(), and e_ofono_manager_sync_elements().
#define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN |
Referenced by e_bluez_system_init(), e_connman_system_init(), and e_ofono_system_init().
#define ERR | ( | ... | ) | EINA_LOG_DOM_ERR(_e_dbus_bluez_log_dom, __VA_ARGS__) |
Referenced by e_bluez_element_array_free(), e_bluez_element_bytes_array_get_stringshared(), e_bluez_element_iter_get_array(), e_bluez_element_list_properties(), e_bluez_element_listener_add(), e_bluez_element_message_send(), e_bluez_element_objects_array_get_stringshared(), e_bluez_element_property_dict_get_stringshared(), e_bluez_element_property_dict_set_full(), e_bluez_element_property_get_stringshared(), e_bluez_element_property_set_full(), e_bluez_element_register(), e_bluez_element_strings_array_get_stringshared(), e_bluez_element_unref(), e_bluez_elements_for_each(), e_bluez_system_shutdown(), e_connman_element_bytes_array_get_stringshared(), e_connman_element_list_properties(), e_connman_element_listener_add(), e_connman_element_message_send(), e_connman_element_objects_array_get_stringshared(), e_connman_element_property_array_set_full(), e_connman_element_property_dict_get_stringshared(), e_connman_element_property_dict_set_full(), e_connman_element_property_dict_strings_array_get_stringshared(), e_connman_element_property_get_stringshared(), e_connman_element_property_set_full(), e_connman_element_register(), e_connman_element_strings_array_get_stringshared(), e_connman_element_unref(), e_connman_elements_for_each(), e_connman_service_ipv4_configure_manual(), e_connman_system_shutdown(), e_dbus_bus_get(), e_dbus_init(), e_dbus_introspect(), e_dbus_object_interface_attach(), e_dbus_properties_get(), e_dbus_properties_get_all(), e_dbus_properties_set(), e_dbus_request_name(), e_dbus_signal_handler_add(), e_dbus_start_service_by_name(), e_hal_device_volume_eject(), e_hal_device_volume_mount(), e_hal_device_volume_unmount(), e_hal_init(), e_notify_marshal_dict_byte(), e_notify_marshal_dict_int(), e_notify_marshal_dict_string(), e_notify_marshal_dict_variant(), e_notify_marshal_hint_image(), e_notify_marshal_notify(), e_notify_marshal_string_array(), e_notify_marshal_string_list_as_array(), e_ofono_element_bytes_array_get_stringshared(), e_ofono_element_list_properties(), e_ofono_element_listener_add(), e_ofono_element_message_send(), e_ofono_element_objects_array_get_stringshared(), e_ofono_element_property_dict_get_stringshared(), e_ofono_element_property_dict_set_full(), e_ofono_element_property_get_stringshared(), e_ofono_element_register(), e_ofono_element_strings_array_get_stringshared(), e_ofono_element_unref(), e_ofono_elements_for_each(), e_ofono_system_shutdown(), e_udisks_volume_eject(), e_udisks_volume_mount(), e_udisks_volume_unmount(), and e_ukit_init().
#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__) |
Referenced by e_bluez_adapter_get(), e_bluez_device_get(), e_bluez_element_property_dict_get_stringshared(), e_bluez_element_property_get_stringshared(), e_bluez_element_property_type_get_stringshared(), e_connman_element_property_dict_get_stringshared(), e_connman_element_property_get_stringshared(), e_connman_element_property_type_get_stringshared(), e_connman_profile_get(), e_connman_service_get(), e_connman_technology_get(), e_ofono_element_property_dict_get_stringshared(), e_ofono_element_property_get_stringshared(), and e_ofono_element_property_type_get_stringshared().
Typedef Documentation
typedef struct _E_Bluez_Element_Dict_Entry E_Bluez_Element_Dict_Entry |
Function Documentation
void* alloca | ( | size_t | ) |
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().
void e_bluez_element_array_free | ( | E_Bluez_Array * | array, |
E_Bluez_Array *new | __UNUSED__ | ||
) |
References _E_Bluez_Array::array, ERR, and _E_Bluez_Array::type.
Referenced by e_bluez_devicefound_free().
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 | ||
) |
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().
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().
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 | ||
) |
References e_bluez_element_ref().
Referenced by e_bluez_element_register().
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.
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_bluez_system_bus_name_get(), e_dbus_message_send(), _E_Bluez_Element_Call_Data::element, ERR, _E_Bluez_Element::interface, _E_Bluez_Element_Call_Data::p_list, _E_Bluez_Element::path, _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* 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.
References e_bluez_conn, e_bluez_element_event_add(), E_BLUEZ_EVENT_ELEMENT_ADD, e_bluez_system_bus_name_get(), e_dbus_signal_handler_add(), e_bluez_elements_get_all_str_data::elements, ERR, _E_Bluez_Element::interface, _E_Bluez_Element::path, and _E_Bluez_Element::signal_handler.
Referenced by e_bluez_manager_sync_elements().
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.
References e_bluez_elements_get_all_str_data::elements, and _E_Bluez_Element::path.
void e_bluez_elements_init | ( | void | ) |
Creates elements hash.
This has no init counter since its already guarded by other code.
References e_bluez_elements_get_all_str_data::elements.
Referenced by e_bluez_manager_clear_elements(), and e_bluez_system_init().
void e_bluez_elements_shutdown | ( | void | ) |
References e_bluez_elements_get_all_str_data::elements.
Referenced by e_bluez_manager_clear_elements(), and e_bluez_system_shutdown().
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().
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_message_send(), e_bluez_element_property_dict_set_full(), e_bluez_element_property_set_full(), and e_bluez_element_register().
Variable Documentation
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
Referenced by e_bluez_adapter_start_discovery(), e_bluez_element_message_send(), and e_bluez_element_register().
const char* e_bluez_iface_adapter |
Referenced by e_bluez_element_is_adapter(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_iface_device |
Referenced by e_bluez_element_is_device(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_iface_manager |
Referenced by e_bluez_manager_sync_elements(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_address |
Referenced by e_bluez_adapter_address_get(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_alias |
const char* e_bluez_prop_class |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_connected |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_devices |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_discoverable |
const char* e_bluez_prop_discoverabletimeout |
const char* e_bluez_prop_discovering |
Referenced by e_bluez_adapter_discovering_get(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_icon |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_name |
const char* e_bluez_prop_pairable |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_pairabletimeout |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_paired |
Referenced by e_bluez_device_paired_get(), e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_powered |
const char* e_bluez_prop_trusted |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().
const char* e_bluez_prop_uuids |
Referenced by e_bluez_system_init(), and e_bluez_system_shutdown().