Diff between d65ee066a1187cd868843111253c0462092f19a0 and eefdb359dc0e377186b01b17baad434e45c3d8aa

Changed Files

File Additions Deletions Status
src/attrib-server.c +5 -4 modified

Full Patch

diff --git a/src/attrib-server.c b/src/attrib-server.c
index a6262d0..d2a2520 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -258,8 +258,8 @@ static int attribute_cmp(gconstpointer a1, gconstpointer a2)
 	return attrib1->handle - attrib2->handle;
 }
 
-static struct attribute *find_primary_range(struct gatt_server *server,
-						uint16_t start, uint16_t *end)
+static struct attribute *find_svc_range(struct gatt_server *server,
+					uint16_t start, uint16_t *end)
 {
 	struct attribute *attrib;
 	guint h = start;
@@ -275,7 +275,8 @@ static struct attribute *find_primary_range(struct gatt_server *server,
 
 	attrib = l->data;
 
-	if (bt_uuid_cmp(&attrib->uuid, &prim_uuid) != 0)
+	if (bt_uuid_cmp(&attrib->uuid, &prim_uuid) != 0 &&
+			bt_uuid_cmp(&attrib->uuid, &snd_uuid) != 0)
 		return NULL;
 
 	*end = start;
@@ -302,7 +303,7 @@ static uint32_t attrib_create_sdp_new(struct gatt_server *server,
 	uuid_t svc, gap_uuid;
 	bdaddr_t addr;
 
-	a = find_primary_range(server, handle, &end);
+	a = find_svc_range(server, handle, &end);
 
 	if (a == NULL)
 		return 0;