/* Adapter Methods */
EAPI void e_bluez_adapter_device_found_free(E_Bluez_Device_Found *device) EINA_ARG_NONNULL(1);
+ EAPI const char *e_bluez_adapter_device_found_get_alias(E_Bluez_Device_Found *device) EINA_ARG_NONNULL(1);
EAPI bool e_bluez_adapter_agent_register(E_Bluez_Element *element, const char *object_path, const char *capability, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI bool e_bluez_adapter_agent_unregister(E_Bluez_Element *element, const char *object_path, E_DBus_Method_Return_Cb cb, const void *data) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
EAPI bool e_bluez_adapter_address_get(E_Bluez_Element *element, const char **address) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
e_bluez_element_array_free(device->array, NULL);
}
+const char *
+e_bluez_adapter_device_found_get_alias(E_Bluez_Device_Found *device)
+{
+ E_Bluez_Element_Dict_Entry *entry;
+ const char *alias = eina_stringshare_add("Alias");
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(device, NULL);
+
+ entry = e_bluez_element_array_dict_find_stringshared(device->array,
+ alias);
+
+ if (entry->type == DBUS_TYPE_STRING)
+ return entry->value.str;
+
+ return NULL;
+}
+
/**
* Register new agent for handling user requests.
*
typedef struct _E_Bluez_Element_Call_Data E_Bluez_Element_Call_Data;
typedef struct _E_Bluez_Element_Property E_Bluez_Element_Property;
typedef struct _E_Bluez_Element_Listener E_Bluez_Element_Listener;
-typedef struct _E_Bluez_Element_Dict_Entry E_Bluez_Element_Dict_Entry;
struct _E_Bluez_Element_Pending
{
} value;
};
-struct _E_Bluez_Element_Dict_Entry
-{
- const char *name;
- int type;
- union {
- bool boolean;
- const char *str;
- short i16;
- unsigned short u16;
- unsigned int u32;
- unsigned char byte;
- const char *path;
- } value;
-};
-
struct _E_Bluez_Element_Listener
{
EINA_INLIST;
return entry;
}
-static E_Bluez_Element_Dict_Entry *
-_e_bluez_element_array_dict_find_stringshared(const E_Bluez_Array *array, const char *key)
+E_Bluez_Element_Dict_Entry *
+e_bluez_element_array_dict_find_stringshared(const E_Bluez_Array *array, const char *key)
{
E_Bluez_Element_Dict_Entry *entry;
Eina_Array_Iterator iterator;
element->path, element, dict_name, t, t);
return 0;
}
- entry = _e_bluez_element_array_dict_find_stringshared(array, key);
+ entry = e_bluez_element_array_dict_find_stringshared(array, key);
if (!entry)
{
WRN("element %s (%p) has no dict property with name \"%s\" with "
extern int _e_dbus_bluez_log_dom;
+typedef struct _E_Bluez_Element_Dict_Entry E_Bluez_Element_Dict_Entry;
+
+struct _E_Bluez_Element_Dict_Entry
+{
+ const char *name;
+ int type;
+ union {
+ bool boolean;
+ const char *str;
+ short i16;
+ unsigned short u16;
+ unsigned int u32;
+ unsigned char byte;
+ const char *path;
+ } value;
+};
+
#ifndef EINA_LOG_DEFAULT_COLOR
#define EINA_LOG_DEFAULT_COLOR EINA_COLOR_CYAN
#endif
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_Array *e_bluez_element_iter_get_array(DBusMessageIter *itr, const char *key);
void e_bluez_element_event_add(int event_type, E_Bluez_Element *element);
+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__);
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);