[PATCH 07/11] attrib-server: Attah gatt channels to a adapters

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

 



This patch adds a new field to gatt channel structure to referentiate
the adapter which the channel belongs
---
 src/attrib-server.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index c7a9a67..ad2dfd5 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -54,15 +54,6 @@
 
 static GSList *database = NULL;
 
-struct gatt_channel {
-	bdaddr_t src;
-	bdaddr_t dst;
-	GAttrib *attrib;
-	guint mtu;
-	gboolean le;
-	guint id;
-	gboolean encrypted;
-};
 
 struct group_elem {
 	uint16_t handle;
@@ -81,6 +72,17 @@ struct gatt_adapter {
 	GSList			*database;
 };
 
+struct gatt_channel {
+	bdaddr_t		src;
+	bdaddr_t		dst;
+	GAttrib			*attrib;
+	guint			mtu;
+	gboolean		le;
+	guint			id;
+	gboolean		encrypted;
+	struct gatt_adapter	*gatt_adapter;
+};
+
 static GSList *adapters = NULL;
 
 /* GAP attribute handles */
@@ -1046,6 +1048,8 @@ guint attrib_channel_attach(GAttrib *attrib, gboolean out)
 	if (gatt_adapter == NULL)
 		return 0;
 
+	channel->gatt_adapter = gatt_adapter;
+
 	ba2str(&channel->dst, addr);
 	device = adapter_find_device(gatt_adapter->adapter, addr);
 
-- 
1.7.8

--
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