linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] attrib-server: allow SDP records for secondary GATT services
@ 2012-05-28 20:45 Arik Nemtsov
  2012-05-30  7:50 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Arik Nemtsov @ 2012-05-28 20:45 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Arik Nemtsov

It seems this is the correct way to discover such services that work
over BR/EDR (according to section 4.4 in the GATT specification).
---
 src/attrib-server.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index dd1bba4..6636192 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -257,8 +257,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;
@@ -274,7 +274,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;
@@ -301,7 +302,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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] attrib-server: allow SDP records for secondary GATT services
  2012-05-28 20:45 [PATCH] attrib-server: allow SDP records for secondary GATT services Arik Nemtsov
@ 2012-05-30  7:50 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-05-30  7:50 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-bluetooth

Hi Arik,

On Mon, May 28, 2012, Arik Nemtsov wrote:
> It seems this is the correct way to discover such services that work
> over BR/EDR (according to section 4.4 in the GATT specification).
> ---
>  src/attrib-server.c |    9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-30  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 20:45 [PATCH] attrib-server: allow SDP records for secondary GATT services Arik Nemtsov
2012-05-30  7:50 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).