Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] android/gatt: Initialize includes queue
@ 2014-11-05 13:01 Marcin Kraglak
  2014-11-05 13:01 ` [PATCH 2/3] android/gatt: Search included services in Secondary Services Marcin Kraglak
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Marcin Kraglak @ 2014-11-05 13:01 UTC (permalink / raw)
  To: linux-bluetooth

Initialize included queue even if service is Secondary Service.
---
 android/gatt.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index b3dd6d3..87a7a12 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -318,8 +318,7 @@ static void destroy_service(void *data)
 	 * So we need to free service memory only once but we need to destroy
 	 * two queues
 	 */
-	if (srvc->primary)
-		queue_destroy(srvc->included, NULL);
+	queue_destroy(srvc->included, NULL);
 
 	free(srvc);
 }
@@ -1092,12 +1091,10 @@ static struct service *create_service(uint8_t id, bool primary, char *uuid,
 
 	/* Put primary service to our local list */
 	s->primary = primary;
-	if (s->primary) {
+	if (s->primary)
 		memcpy(&s->prim, data, sizeof(s->prim));
-	} else {
+	else
 		memcpy(&s->incl, data, sizeof(s->incl));
-		return s;
-	}
 
 	/* For primary service allocate queue for included services */
 	s->included = queue_new();
-- 
1.9.3


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

* [PATCH 2/3] android/gatt: Search included services in Secondary Services
  2014-11-05 13:01 [PATCH 1/3] android/gatt: Initialize includes queue Marcin Kraglak
@ 2014-11-05 13:01 ` Marcin Kraglak
  2014-11-05 13:01 ` [PATCH 3/3] android/pts: Update GATT PTS test results Marcin Kraglak
  2014-11-06 11:19 ` [PATCH 1/3] android/gatt: Initialize includes queue Szymon Janc
  2 siblings, 0 replies; 5+ messages in thread
From: Marcin Kraglak @ 2014-11-05 13:01 UTC (permalink / raw)
  To: linux-bluetooth

Check type of service and perform include service discovery with valid
range.
---
 android/gatt.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 87a7a12..1edc8b0 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2412,6 +2412,7 @@ static bool search_included_services(struct app_connection *connection,
 							struct service *service)
 {
 	struct get_included_data *data;
+	uint16_t start, end;
 
 	data = new0(struct get_included_data, 1);
 	if (!data) {
@@ -2422,9 +2423,17 @@ static bool search_included_services(struct app_connection *connection,
 	data->prim = service;
 	data->conn = connection;
 
-	gatt_find_included(connection->device->attrib,
-				service->prim.range.start,
-				service->prim.range.end, get_included_cb, data);
+	if (service->primary) {
+		start = service->prim.range.start;
+		end = service->prim.range.end;
+	} else {
+		start = service->incl.range.start;
+		end = service->incl.range.end;
+	}
+
+	gatt_find_included(connection->device->attrib, start, end,
+							get_included_cb, data);
+
 	return true;
 }
 
-- 
1.9.3


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

* [PATCH 3/3] android/pts: Update GATT PTS test results
  2014-11-05 13:01 [PATCH 1/3] android/gatt: Initialize includes queue Marcin Kraglak
  2014-11-05 13:01 ` [PATCH 2/3] android/gatt: Search included services in Secondary Services Marcin Kraglak
@ 2014-11-05 13:01 ` Marcin Kraglak
  2014-11-06 15:19   ` Szymon Janc
  2014-11-06 11:19 ` [PATCH 1/3] android/gatt: Initialize includes queue Szymon Janc
  2 siblings, 1 reply; 5+ messages in thread
From: Marcin Kraglak @ 2014-11-05 13:01 UTC (permalink / raw)
  To: linux-bluetooth

---
 android/pts-gatt.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/android/pts-gatt.txt b/android/pts-gatt.txt
index 9e85bcb..ea6a014 100644
--- a/android/pts-gatt.txt
+++ b/android/pts-gatt.txt
@@ -48,7 +48,13 @@ TC_GAD_CL_BV_02_C	PASS	haltest:
 				gattc disconnect
 				gattc connect
 				gattc refresh
-TC_GAD_CL_BV_03_C	FAIL	JIRA #BA-188
+TC_GAD_CL_BV_03_C	PASS	haltest:
+                                gattc register_client
+                                gattc scan
+                                gattc connect
+                                gattc search_service
+				gattc get_included_service
+				gattc_disconnect
 TC_GAD_CL_BV_04_C	PASS	haltest:
 				when requested: gattc get_characteristic
 TC_GAD_CL_BV_05_C	PASS	haltest:
-- 
1.9.3


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

* Re: [PATCH 1/3] android/gatt: Initialize includes queue
  2014-11-05 13:01 [PATCH 1/3] android/gatt: Initialize includes queue Marcin Kraglak
  2014-11-05 13:01 ` [PATCH 2/3] android/gatt: Search included services in Secondary Services Marcin Kraglak
  2014-11-05 13:01 ` [PATCH 3/3] android/pts: Update GATT PTS test results Marcin Kraglak
@ 2014-11-06 11:19 ` Szymon Janc
  2 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-11-06 11:19 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth

Hi Marcin,

On Wednesday 05 of November 2014 14:01:49 Marcin Kraglak wrote:
> Initialize included queue even if service is Secondary Service.
> ---
>  android/gatt.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index b3dd6d3..87a7a12 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -318,8 +318,7 @@ static void destroy_service(void *data)
>  	 * So we need to free service memory only once but we need to destroy
>  	 * two queues
>  	 */
> -	if (srvc->primary)
> -		queue_destroy(srvc->included, NULL);
> +	queue_destroy(srvc->included, NULL);
>  
>  	free(srvc);
>  }
> @@ -1092,12 +1091,10 @@ static struct service *create_service(uint8_t id, bool primary, char *uuid,
>  
>  	/* Put primary service to our local list */
>  	s->primary = primary;
> -	if (s->primary) {
> +	if (s->primary)
>  		memcpy(&s->prim, data, sizeof(s->prim));
> -	} else {
> +	else
>  		memcpy(&s->incl, data, sizeof(s->incl));
> -		return s;
> -	}
>  
>  	/* For primary service allocate queue for included services */
>  	s->included = queue_new();

Please update (remove?) this comment to avoid confusion.
And maybe move this queue_new() up where service is created.

> 

-- 
Best regards, 
Szymon Janc

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

* Re: [PATCH 3/3] android/pts: Update GATT PTS test results
  2014-11-05 13:01 ` [PATCH 3/3] android/pts: Update GATT PTS test results Marcin Kraglak
@ 2014-11-06 15:19   ` Szymon Janc
  0 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-11-06 15:19 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth

Hi Marcin,

On Wednesday 05 of November 2014 14:01:51 Marcin Kraglak wrote:
> ---
>  android/pts-gatt.txt | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/android/pts-gatt.txt b/android/pts-gatt.txt
> index 9e85bcb..ea6a014 100644
> --- a/android/pts-gatt.txt
> +++ b/android/pts-gatt.txt
> @@ -48,7 +48,13 @@ TC_GAD_CL_BV_02_C	PASS	haltest:
>  				gattc disconnect
>  				gattc connect
>  				gattc refresh
> -TC_GAD_CL_BV_03_C	FAIL	JIRA #BA-188
> +TC_GAD_CL_BV_03_C	PASS	haltest:
> +                                gattc register_client
> +                                gattc scan
> +                                gattc connect
> +                                gattc search_service
> +				gattc get_included_service
> +				gattc_disconnect
>  TC_GAD_CL_BV_04_C	PASS	haltest:
>  				when requested: gattc get_characteristic
>  TC_GAD_CL_BV_05_C	PASS	haltest:
> 

This patch is now applied, thanks.

-- 
Best regards, 
Szymon Janc

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

end of thread, other threads:[~2014-11-06 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 13:01 [PATCH 1/3] android/gatt: Initialize includes queue Marcin Kraglak
2014-11-05 13:01 ` [PATCH 2/3] android/gatt: Search included services in Secondary Services Marcin Kraglak
2014-11-05 13:01 ` [PATCH 3/3] android/pts: Update GATT PTS test results Marcin Kraglak
2014-11-06 15:19   ` Szymon Janc
2014-11-06 11:19 ` [PATCH 1/3] android/gatt: Initialize includes queue Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox