linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] android/pts: Update gatt server results
@ 2014-12-10  9:57 Jakub Tyszkowski
  2014-12-10  9:57 ` [PATCH 2/3] android/gatt: Fix execute write request still pending Jakub Tyszkowski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jakub Tyszkowski @ 2014-12-10  9:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Patches fixing this issues were already merged.
---
 android/pts-gatt.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/android/pts-gatt.txt b/android/pts-gatt.txt
index 167a6dc..43e1c8a 100644
--- a/android/pts-gatt.txt
+++ b/android/pts-gatt.txt
@@ -729,12 +729,12 @@ TC_GAW_CL_BI_36_C	PASS	haltest:
 				gattc get_descriptor
 				gattc write_descriptor 2 <long_value>
 				gattc disconnect
-TC_GAW_SR_BV_01_C	FAIL	haltest:
+TC_GAW_SR_BV_01_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 4 <permissions> 17
 				gatts start_service
-TC_GAW_SR_BV_02_C	FAIL	haltest:
+TC_GAW_SR_BV_02_C	PASS	haltest:
 				gatts add service
 				gatts add_characteristics:
 					<properties> 66 <permisions> 145
@@ -743,7 +743,7 @@ TC_GAW_SR_BV_02_C	FAIL	haltest:
 				gatts send_response: (twice)
 				NOTE: gatts_request_write_cb shall be called
 								 (verify it)
-TC_GAW_SR_BI_01_C	FAIL	haltest:
+TC_GAW_SR_BI_01_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 68
-- 
1.9.1


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

* [PATCH 2/3] android/gatt: Fix execute write request still pending
  2014-12-10  9:57 [PATCH 1/3] android/pts: Update gatt server results Jakub Tyszkowski
@ 2014-12-10  9:57 ` Jakub Tyszkowski
  2014-12-10  9:57 ` [PATCH 3/3] android/gatt: Fix offset in prepare write notifications Jakub Tyszkowski
  2014-12-10 12:08 ` [PATCH 1/3] android/pts: Update gatt server results Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Tyszkowski @ 2014-12-10  9:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

For execute write no write callback is called thus we have to change its
state directly in app's response handler.

This fixes not sending execute write responses in TC_GAW_SR_BI_07_C.
---
 android/gatt.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index ac45ffc..f39a66b 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -5530,6 +5530,8 @@ static void handle_server_send_response(const void *buf, uint16_t len)
 	}
 
 	if (transaction->opcode == ATT_OP_EXEC_WRITE_REQ) {
+		struct pending_request *req;
+
 		conn->wait_execute_write = false;
 
 		/* Check for execute response from all server applications */
@@ -5537,6 +5539,14 @@ static void handle_server_send_response(const void *buf, uint16_t len)
 			goto done;
 
 		/*
+		 * This is usually done through db write callback but for
+		 * execute write we dont have the attribute or handle to call
+		 * gatt_db_attribute_write().
+		 */
+		req = queue_peek_head(conn->device->pending_requests);
+		req->state = REQUEST_DONE;
+
+		/*
 		 * FIXME: Handle situation when not all server applications
 		 * respond with a success.
 		 */
-- 
1.9.1


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

* [PATCH 3/3] android/gatt: Fix offset in prepare write notifications
  2014-12-10  9:57 [PATCH 1/3] android/pts: Update gatt server results Jakub Tyszkowski
  2014-12-10  9:57 ` [PATCH 2/3] android/gatt: Fix execute write request still pending Jakub Tyszkowski
@ 2014-12-10  9:57 ` Jakub Tyszkowski
  2014-12-10 12:08 ` [PATCH 1/3] android/pts: Update gatt server results Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Tyszkowski @ 2014-12-10  9:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

This fixes TC_GAW_SR_BI_07_C and probably few other cases.
---
 android/gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index f39a66b..e24feb7 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -6448,7 +6448,7 @@ static uint8_t write_prep_request(const uint8_t *cmd, uint16_t cmd_len,
 	data->value = g_memdup(value, vlen);
 	data->length = vlen;
 
-	if (!gatt_db_attribute_write(attrib, 0, value, vlen, cmd[0],
+	if (!gatt_db_attribute_write(attrib, offset, value, vlen, cmd[0],
 					&dev->bdaddr, attribute_write_cb,
 					data)) {
 		queue_remove(dev->pending_requests, data);
-- 
1.9.1


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

* Re: [PATCH 1/3] android/pts: Update gatt server results
  2014-12-10  9:57 [PATCH 1/3] android/pts: Update gatt server results Jakub Tyszkowski
  2014-12-10  9:57 ` [PATCH 2/3] android/gatt: Fix execute write request still pending Jakub Tyszkowski
  2014-12-10  9:57 ` [PATCH 3/3] android/gatt: Fix offset in prepare write notifications Jakub Tyszkowski
@ 2014-12-10 12:08 ` Szymon Janc
  2 siblings, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2014-12-10 12:08 UTC (permalink / raw)
  To: Jakub Tyszkowski; +Cc: linux-bluetooth

Hi Jakub,

On Wednesday 10 of December 2014 10:57:06 Jakub Tyszkowski wrote:
> Patches fixing this issues were already merged.
> ---
>  android/pts-gatt.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/android/pts-gatt.txt b/android/pts-gatt.txt
> index 167a6dc..43e1c8a 100644
> --- a/android/pts-gatt.txt
> +++ b/android/pts-gatt.txt
> @@ -729,12 +729,12 @@ TC_GAW_CL_BI_36_C	PASS	haltest:
>  				gattc get_descriptor
>  				gattc write_descriptor 2 <long_value>
>  				gattc disconnect
> -TC_GAW_SR_BV_01_C	FAIL	haltest:
> +TC_GAW_SR_BV_01_C	PASS	haltest:
>  				gatts add_service
>  				gatts add_characteristic:
>  						<properties> 4 <permissions> 17
>  				gatts start_service
> -TC_GAW_SR_BV_02_C	FAIL	haltest:
> +TC_GAW_SR_BV_02_C	PASS	haltest:
>  				gatts add service
>  				gatts add_characteristics:
>  					<properties> 66 <permisions> 145
> @@ -743,7 +743,7 @@ TC_GAW_SR_BV_02_C	FAIL	haltest:
>  				gatts send_response: (twice)
>  				NOTE: gatts_request_write_cb shall be called
>  								 (verify it)
> -TC_GAW_SR_BI_01_C	FAIL	haltest:
> +TC_GAW_SR_BI_01_C	PASS	haltest:
>  				gatts add_service
>  				gatts add_characteristic:
>  						<properties> 68

Applied, thanks.

-- 
BR
Szymon Janc

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

end of thread, other threads:[~2014-12-10 12:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10  9:57 [PATCH 1/3] android/pts: Update gatt server results Jakub Tyszkowski
2014-12-10  9:57 ` [PATCH 2/3] android/gatt: Fix execute write request still pending Jakub Tyszkowski
2014-12-10  9:57 ` [PATCH 3/3] android/gatt: Fix offset in prepare write notifications Jakub Tyszkowski
2014-12-10 12:08 ` [PATCH 1/3] android/pts: Update gatt server results Szymon Janc

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).