{
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;
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;
event_cb(HAL_EV_REMOTE_DEVICE_PROPS, (void*) buf, size);
g_variant_unref(result);
+ g_variant_iter_free(property_iter);
}
int __bt_hal_dbus_enquire_remote_device_services(char *address)
while (g_variant_iter_loop(char_value_iter, "y", &char_value))
g_byte_array_append(manufacturer_data, &char_value, 1);
+ g_variant_iter_free(char_value_iter);
+
if (manufacturer_data) {
if (manufacturer_data->len > 0) {
size += __bt_insert_hal_properties(
done:
g_variant_unref(result);
+ g_variant_iter_free(property_iter);
return FALSE;
}
ev->num_props++;
} else if (!g_strcmp0(key, "Modalias")) {
char *modalias = NULL;
- g_variant_get(value, "s", &modalias);
+ g_variant_get(value, "&s", &modalias);
DBG("##Adapter ModAlias [%s]", modalias);
} else if (!g_strcmp0(key, "SupportedLEFeatures")) {
DBG("##LE Supported features");
DBG("Property not handled");
}
}
-
- g_free((char *)property);
- g_variant_unref(value);
}
static void __bt_hal_handle_avrcp_transport_events(GVariant *msg, const char *member,
DBG("Property not handled");
}
}
-
- g_free((char *)property);
- g_variant_unref(value);
}
/* A2DP Src Role(Remote:Sink) Events */
char_permission |= _hal_get_permission_flag(permission);
}
__hal_convert_permission_flag_to_str(char_permission);
+ g_variant_iter_free(char_perm_iter);
} else if (!g_strcmp0(key, "Descriptors")) {
g_variant_get(value, "ao", &char_desc_iter);
while (g_variant_iter_loop(char_desc_iter, "&o", &char_desc_handle)) {
g_ptr_array_add(gp_desc_array, (gpointer)char_desc_handle);
}
+ g_variant_iter_free(char_desc_iter);
}
}
if (!g_strcmp0(key, "UUID")) {
desc_uuid_str = g_variant_get_string(value, &len);
_hal_gattc_update_desc_property(gattc_desc, desc_uuid_str);
+
+ g_free((gchar *)key);
+ g_variant_unref(value);
break;
}
}
DBG("char_handle: %s", char_handle);
g_ptr_array_add(gp_char_array, (gpointer)char_handle);
}
+ g_variant_iter_free(char_iter);
}
}
}