[PATCH v2 BlueZ 4/8] attrib: Register only new characteristics found

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

 



From: Claudio Takahasi <claudio.takahasi@xxxxxxxxxxxxx>

This avoids duplicating registration for previously found
characteristics.
---
 attrib/client.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/attrib/client.c b/attrib/client.c
index 651eade..ce78ed6 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -902,6 +902,7 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
 		previous_end = &chr->end;
 
 		gatt->chars = g_slist_append(gatt->chars, chr);
+		register_characteristic(chr, gatt->path);
 	}
 
 	if (previous_end)
@@ -910,8 +911,6 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
 	gatt_get_address(gatt, &sba, &dba);
 	store_characteristics(&sba, &dba, prim->range.start, gatt->chars);
 
-	g_slist_foreach(gatt->chars, register_characteristic, gatt->path);
-
 	g_slist_foreach(gatt->chars, update_all_chars, gatt);
 
 	reply = create_discover_char_reply(gatt->query->msg, gatt->chars);
-- 
1.7.5.4

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