summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/device.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c
index ef3a5faa..a1d1575e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1023,10 +1023,25 @@ static void init_browse(struct browse_req *req)
for (i = 0; driver->uuids[i]; i++) {
char *uuid;
-
+ int j;
+
+ /* Eliminate duplicates of UUIDs in uuid_list[]... */
+ if (strlen(driver->uuids[i]) == 36 &&
+ !strncmp(driver->uuids[i], "0000", 4) &&
+ !strcasecmp(driver->uuids[i] + 8,
+ "-0000-1000-8000-00805F9B34FB")) {
+ uint16_t uuid16 = strtol(driver->uuids[i],
+ NULL, 16);
+ for (j = 0; uuid_list[j]; j++) {
+ if (uuid16 == uuid_list[j])
+ continue;
+ }
+
+ }
+ /* ... and of UUIDs another driver already asked for */
if (g_slist_find_custom(req->uuids, driver->uuids[i],
(GCompareFunc) strcasecmp))
- return;
+ continue;
uuid = g_strdup(driver->uuids[i]);
req->uuids = g_slist_append(req->uuids, uuid);