queue_remove(chrc->notify_clients, client);
queue_remove(chrc->service->client->all_notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. length: %d", queue_length(chrc->notify_clients));
+ DBG("Removed client from all_notify_clients. length: %d", queue_length(chrc->service->client->all_notify_clients));
+#endif
update_notifying(chrc);
if (att_ecode) {
queue_remove(chrc->notify_clients, client);
queue_remove(chrc->service->client->all_notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. length: %d", queue_length(chrc->notify_clients));
+ DBG("Removed client from all_notify_clients. length: %d", queue_length(chrc->service->client->all_notify_clients));
+#endif
notify_client_free(client);
create_notify_reply(op, false, att_ecode);
if (att_ecode) {
queue_remove(chrc->notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. length: %d", queue_length(chrc->notify_clients));
+#endif
notify_client_free(client);
return;
}
{
struct notify_client *client = data;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("notify_io destroyed. length: %d", queue_length(client->chrc->notify_clients));
+ if (queue_remove(client->chrc->notify_clients, client)) {
+ DBG("Removed client from notify_clients. length: %d", queue_length(client->chrc->notify_clients));
+ notify_client_unref(client);
+ } else {
+ DBG("Failed to remove client");
+ }
+#else
if (queue_remove(client->chrc->notify_clients, client))
notify_client_unref(client);
+#endif
}
static DBusMessage *characteristic_acquire_notify(DBusConnection *conn,
}
queue_push_tail(chrc->notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Registered noti with id: %d", client->notify_id);
+ DBG("Added client to notify_clients. length: %d", queue_length(chrc->notify_clients));
+#endif
#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
chrc->notify_io = new0(struct sock_io, 1);
queue_push_tail(chrc->notify_clients, client);
queue_push_tail(chrc->service->client->all_notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Added client to notify_clients. length: %d", queue_length(chrc->notify_clients));
+ DBG("Added client to all_notify_clients. length: %d", queue_length(chrc->service->client->all_notify_clients));
+#endif
/*
* If the device is currently not connected, return success. We will
chrc->value_handle,
register_notify_cb, notify_cb,
op, async_dbus_op_free);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (client->notify_id) {
+ DBG("Registered noti with id: %d", client->notify_id);
+ return NULL;
+ }
+#else
if (client->notify_id)
return NULL;
+#endif
async_dbus_op_free(op);
fail:
queue_remove(chrc->notify_clients, client);
queue_remove(chrc->service->client->all_notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. length: %d", queue_length(chrc->notify_clients));
+ DBG("Removed client from all_notify_clients. length: %d", queue_length(chrc->service->client->all_notify_clients));
+#endif
/* Directly free the client */
notify_client_free(client);
return btd_error_failed(msg, "No notify session started");
queue_remove(chrc->service->client->all_notify_clients, client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. length: %d", queue_length(chrc->notify_clients));
+ DBG("Removed client from all_notify_clients. length: %d", queue_length(chrc->service->client->all_notify_clients));
+ DBG("Unregister noti with id: %d", client->notify_id);
+#endif
bt_gatt_client_unregister_notify(gatt, client->notify_id);
update_notifying(chrc);
}
queue_destroy(chrc->notify_clients, remove_client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Destroyed notify_clients. length: %d", queue_length(chrc->notify_clients));
+#endif
att = bt_gatt_client_get_att(gatt);
if (att)
chrc, NULL);
DBG("Exported GATT characteristic: %s", chrc->path);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ char uuid_str[MAX_LEN_UUID_STR + 1];
+ bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str));
+ DBG("- uuid: %s", uuid_str);
+#endif
return chrc;
}
queue_remove(notify_client->chrc->notify_clients, notify_client);
queue_remove(client->all_notify_clients, notify_client);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Removed client from notify_clients. lenth: %d", queue_length(notify_client->chrc->notify_clients));
+ DBG("Removed client from all_notify_clients. length: %d", queue_length(client->all_notify_clients));
+#endif
notify_client_free(notify_client);
}
{
struct notify_client *client = data;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("Unregister noti with id: %d", client->notify_id);
+ bt_gatt_client_unregister_notify(client->chrc->service->client->gatt, client->notify_id);
+#endif
client->notify_id = 0;
}