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 d19158c..a4e7d4c 100644 --- a/attrib/client.c +++ b/attrib/client.c @@ -901,6 +901,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) @@ -909,8 +910,6 @@ static void char_discovered_cb(GSList *characteristics, guint8 status, gatt_get_address(gatt, &sba, &dba); store_characteristics(&sba, &dba, prim->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