Beispiel #1
0
void bt_hog_detach(struct bt_hog *hog)
{
	GSList *l;

	if (!hog->attrib)
		return;

	for (l = hog->instances; l; l = l->next) {
		struct bt_hog *instance = l->data;

		bt_hog_detach(instance);
	}

	for (l = hog->reports; l; l = l->next) {
		struct report *r = l->data;

		if (r->notifyid > 0) {
			g_attrib_unregister(hog->attrib, r->notifyid);
			r->notifyid = 0;
		}
	}

	if (hog->scpp)
		bt_scpp_detach(hog->scpp);

	if (hog->dis)
		bt_dis_detach(hog->dis);

	if (hog->bas)
		bt_bas_detach(hog->bas);

	g_attrib_unref(hog->attrib);
	hog->attrib = NULL;
}
Beispiel #2
0
static void bas_free(struct bt_bas *bas)
{
	bt_bas_detach(bas);

	g_free(bas->primary);
	queue_destroy(bas->gatt_op, (void *) destroy_gatt_req);
	free(bas);
}