while (g_variant_iter_loop(property_iter, "{sv}", &key, &value)) {
if (!g_strcmp0(key, "UUID")) {
- desc_uuid_str = g_variant_dup_string(value, &len);
+ desc_uuid_str = g_variant_get_string(value, &len);
DBG("desc UUID [%s]", desc_uuid_str);
+ _hal_gattc_update_desc_property(gattc_desc, desc_uuid_str);
+ break;
}
}
- _hal_gattc_update_desc_property(gattc_desc, desc_uuid_str);
-
g_variant_iter_free(property_iter);
g_variant_unref(result);
g_object_unref(properties_proxy);
int __bt_hal_add_service_to_dbus(char *app_path, int slot, btgatt_srvc_id_t *srvc_id)
{
+ gboolean ret;
/* For GATT service specific */
GDBusNodeInfo *node_info;
guint object_id;
g_variant_builder_add(builder, "{sa{sv}}",
GATT_SERV_INTERFACE, inner_builder);
- g_dbus_connection_emit_signal(g_conn, NULL, "/",
+ ret = g_dbus_connection_emit_signal(g_conn, NULL, "/",
"org.freedesktop.Dbus.ObjectManager",
"InterfacesAdded",
g_variant_new("(oa{sa{sv}})",
path, builder),
&error);
+ if (!ret) {
+ if (error) {
+ /* dbus gives error cause */
+ ERR("d-bus api failure: errcode[%x], message[%s]",
+ error->code, error->message);
+ g_clear_error(&error);
+ }
+ }
/* Send Service handle to application */
user_data = g_malloc0(sizeof(hal_gatt_service_added));
bt_uuid_t *uuid, int properties,
int permissions)
{
+ gboolean ret;
GError *error = NULL;
guint object_id;
GDBusNodeInfo *node_info;
GATT_CHAR_INTERFACE,
inner_builder);
- g_dbus_connection_emit_signal(g_conn, NULL, "/",
+ ret = g_dbus_connection_emit_signal(g_conn, NULL, "/",
"org.freedesktop.Dbus.ObjectManager",
"InterfacesAdded",
g_variant_new("(oa{sa{sv}})",
path, builder),
&error);
+ if (!ret) {
+ if (error) {
+ /* dbus gives error cause */
+ ERR("d-bus api failure: errcode[%x], message[%s]",
+ error->code, error->message);
+ g_clear_error(&error);
+ }
+ }
//*char_path = g_strdup(path);