[PATCH 6/8] attrib-server: Add bluetooth adapter in attrib_db_del

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/attrib-server.c |   10 +++++-----
 src/attrib-server.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 2ee4804..3a469c6 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -1371,19 +1371,19 @@ int attrib_db_update(struct btd_adapter *adapter, uint16_t handle,
 	return 0;
 }
 
-int attrib_db_del(uint16_t handle)
+int attrib_db_del(struct btd_adapter *adapter, uint16_t handle)
 {
 	struct gatt_adapter *gadapter;
 	struct attribute *a;
 	GSList *l;
 	guint h = handle;
 
-	DBG("Deprecated function!");
-
-	gadapter = get_default_gatt_adapter();
-	if (gadapter == NULL)
+	l = g_slist_find_custom(adapters, adapter, adapter_cmp);
+	if (l == NULL)
 		return -ENOENT;
 
+	gadapter = l->data;
+
 	DBG("handle=0x%04x", handle);
 
 	l = g_slist_find_custom(gadapter->database, GUINT_TO_POINTER(h),
diff --git a/src/attrib-server.h b/src/attrib-server.h
index fb7f285..becb3a8 100644
--- a/src/attrib-server.h
+++ b/src/attrib-server.h
@@ -29,7 +29,7 @@ struct attribute *attrib_db_add(struct btd_adapter *adapter, uint16_t handle,
 int attrib_db_update(struct btd_adapter *adapter, uint16_t handle,
 					bt_uuid_t *uuid, const uint8_t *value,
 					int len, struct attribute **attr);
-int attrib_db_del(uint16_t handle);
+int attrib_db_del(struct btd_adapter *adapter, uint16_t handle);
 int attrib_gap_set(struct btd_adapter *adapter, uint16_t uuid,
 						const uint8_t *value, int len);
 uint32_t attrib_create_sdp(uint16_t handle, const char *name);
-- 
1.7.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux