The Discover() operation (from DBus API) was registering the same
characteristics after running several times. This can be checked using
test-attrib.
for (l = characteristics; l; l = l->next) {
struct att_char *current_chr = l->data;
struct characteristic *chr;
+ guint handle = current_chr->value_handle;
+ GSList *lchr;
+
+ lchr = g_slist_find_custom(prim->chars,
+ GUINT_TO_POINTER(handle), characteristic_handle_cmp);
+ if (lchr)
+ continue;
chr = g_new0(struct characteristic, 1);
chr->prim = prim;