{
GDBusProxy *proxy;
- DBG("+");
-
if (system_conn == NULL) {
system_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
if (system_conn == NULL)
manager_gproxy = proxy;
- DBG("-");
return proxy;
}
{
char *object_path = NULL;
char *interface_str = NULL;
+ GVariantIter *interface_iter;
char device_address[BT_HAL_ADDRESS_STRING_SIZE] = { 0 };
/* Parse the signature: oa{sa{sv}}} */
- while (g_variant_iter_loop(iter, "{&oa{sa{sv}}}", &object_path, &interface_str)) {
+ while (g_variant_iter_loop(iter, "{&oa{sa{sv}}}", &object_path, &interface_iter)) {
if (object_path == NULL)
- return NULL;
+ continue;
- if (g_strcmp0(interface_str, BT_HAL_PLAYER_CONTROL_INTERFACE) == 0) {
- _bt_hal_convert_device_path_to_address(object_path, device_address);
- if (g_strcmp0(address, device_address) == 0)
- return g_strdup(object_path);
+ while(g_variant_iter_loop(interface_iter, "{&sa{sv}}", &interface_str, NULL)) {
+ if (g_strcmp0(interface_str, BT_HAL_PLAYER_CONTROL_INTERFACE) == 0) {
+ _bt_hal_convert_device_path_to_address(object_path, device_address);
+ if (g_strcmp0(address, device_address) == 0) {
+ DBG("Object Path: %s", object_path);
+ g_variant_iter_free(interface_iter);
+ return g_strdup(object_path);
+ }
+ }
}
}
return NULL;
{
char *object_path = NULL;
char *interface_str = NULL;
+ GVariantIter *interface_iter;
char device_address[BT_HAL_ADDRESS_STRING_SIZE] = { 0 };
/* Parse the signature: oa{sa{sv}}} */
- while (g_variant_iter_loop(iter, "{&oa{sa{sv}}}", &object_path, &interface_str)) {
+ while (g_variant_iter_loop(iter, "{&oa{sa{sv}}}", &object_path, &interface_iter)) {
if (object_path == NULL)
- return NULL;
+ continue;
- if (g_strcmp0(interface_str, BT_HAL_MEDIATRANSPORT_INTERFACE) == 0) {
- _bt_hal_convert_device_path_to_address(object_path, device_address);
- if (g_strcmp0(address, device_address) == 0)
- return g_strdup(object_path);
+ while(g_variant_iter_loop(interface_iter, "{&sa{sv}}", &interface_str, NULL)) {
+ if (g_strcmp0(interface_str, BT_HAL_MEDIATRANSPORT_INTERFACE) == 0) {
+ _bt_hal_convert_device_path_to_address(object_path, device_address);
+ if (g_strcmp0(address, device_address) == 0) {
+ DBG("Object Path: %s", object_path);
+ g_variant_iter_free(interface_iter);
+ return g_strdup(object_path);
+ }
+ }
}
}
return NULL;
char *control_path;
char connected_address[BT_HAL_ADDRESS_STRING_SIZE];
- DBG("+");
-
if (avrcp_control_path != NULL)
return avrcp_control_path;
_bt_hal_convert_addr_type_to_string(connected_address, bd_addr->address);
- DBG("device address = %s", connected_address);
-
control_path = __bt_hal_get_control_device_object_path(connected_address);
if (control_path == NULL)
return NULL;
char *transport_path;
char connected_address[BT_HAL_ADDRESS_STRING_SIZE];
- DBG("+");
-
if (avrcp_transport_path != NULL)
return avrcp_transport_path;
_bt_hal_convert_addr_type_to_string(connected_address, bd_addr->address);
- DBG("device address = %s", connected_address);
-
transport_path = __bt_hal_get_transport_device_object_path(connected_address);
if (transport_path == NULL)
return NULL;
GDBusProxy *_bt_hal_get_manager_proxy(void)
{
- DBG("+");
if (manager_gproxy) {
const gchar *path = g_dbus_proxy_get_object_path(manager_gproxy);
if (path == NULL) {
}
return manager_gproxy;
}
- DBG("-");
return __bt_hal_init_manager_proxy();
}
char *control_path = NULL;
GDBusConnection *conn = NULL;
- DBG("+");
control_path = _bt_hal_get_control_device_path(bd_addr);
if (control_path == NULL)
return NULL;
return NULL;
}
- DBG("-");
return proxy;
}
char *transport_path = NULL;
GDBusConnection *conn = NULL;
- DBG("+");
transport_path = _bt_hal_get_transport_device_path(bd_addr);
if (transport_path == NULL)
return NULL;
return NULL;
}
- DBG("-");
return proxy;
}
GVariantIter *iter = NULL;
char *adapter_path = NULL;
- DBG("+");
conn = _bt_hal_get_system_gconn();
if (conn == NULL)
return NULL;
adapter_path = __bt_hal_extract_adapter_path(iter);
g_variant_iter_free(iter);
g_variant_unref(result);
- DBG("-");
+
return adapter_path;
}
gboolean _bt_hal_utf8_validate(char *name)
{
- DBG("+");
gunichar2 *u16;
glong items_written = 0;
if (items_written != g_utf8_strlen(name, -1))
return FALSE;
- DBG("-");
return TRUE;
}
GVariant *result = NULL;
GError *error = NULL;
- DBG("+");
conn = _bt_hal_get_system_gconn();
if (conn == NULL)
return NULL;
GVariant *ret = NULL;
int result = BT_STATUS_FAIL;
- DBG("+");
-
if (remote_uuid == NULL) {
ERR("remote_uuid == NULL, return");
return BT_STATUS_FAIL;
if (uuid_value)
g_free(uuid_value);
- DBG("-");
return result;
}
gchar *uuid_str;
gboolean ret = FALSE;
- DBG("+");
-
proxy = _bt_hal_get_adapter_properties_proxy();
if (!proxy) {
DBG("_bt_hal_dbus_get_local_name: Adapter Properties proxy get failed!!!");
return FALSE;
}
- while (g_variant_iter_loop(iter, "s", &uuid_str)) {
+ while (g_variant_iter_loop(iter, "&s", &uuid_str)) {
DBG("UUID string [%s]\n", uuid_str);
if (!strncasecmp(uuid, uuid_str, strlen(uuid))) {
ret = TRUE;
g_variant_iter_free(iter);
g_variant_unref(result);
g_variant_unref(temp);
- DBG("-");
+
return ret;
}