linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] android/gatt: Fix server send response status value
@ 2014-12-11 17:16 Jakub Tyszkowski
  2014-12-11 17:16 ` [PATCH 2/2] android/pts: Update gatt server status Jakub Tyszkowski
  2014-12-11 17:55 ` [PATCH 1/2] android/gatt: Fix server send response status value Szymon Janc
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Tyszkowski @ 2014-12-11 17:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Cast status to uint8_t, due to (byte) cast in java layer.
---
 android/gatt.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 84fba64..64163f8 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -5551,7 +5551,8 @@ static void handle_server_send_response(const void *buf, uint16_t len)
 		 * gatt_db_attribute_write().
 		 */
 		req = queue_peek_head(conn->device->pending_requests);
-		req->error = err_to_att(cmd->status);
+		/* Cast status to uint8_t, due to (byte) cast in java layer. */
+		req->error = err_to_att((uint8_t)cmd->status);
 		req->state = REQUEST_DONE;
 
 		/*
@@ -5560,15 +5561,16 @@ static void handle_server_send_response(const void *buf, uint16_t len)
 		 */
 	}
 
+	/* Cast status to uint8_t, due to (byte) cast in java layer. */
 	if (transaction->opcode < ATT_OP_WRITE_REQ)
 		gatt_db_attribute_read_result(transaction->attrib,
-						transaction->serial_id,
-						err_to_att(cmd->status),
-						cmd->data, cmd->len);
+					transaction->serial_id,
+					err_to_att((uint8_t)cmd->status),
+					cmd->data, cmd->len);
 	else
 		gatt_db_attribute_write_result(transaction->attrib,
-						transaction->serial_id,
-						err_to_att(cmd->status));
+					transaction->serial_id,
+					err_to_att((uint8_t)cmd->status));
 
 	send_dev_complete_response(conn->device, transaction->opcode);
 
-- 
1.9.1


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

* [PATCH 2/2] android/pts: Update gatt server status
  2014-12-11 17:16 [PATCH 1/2] android/gatt: Fix server send response status value Jakub Tyszkowski
@ 2014-12-11 17:16 ` Jakub Tyszkowski
  2014-12-11 17:55 ` [PATCH 1/2] android/gatt: Fix server send response status value Szymon Janc
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Tyszkowski @ 2014-12-11 17:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

---
 android/pts-gatt.txt | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/android/pts-gatt.txt b/android/pts-gatt.txt
index d1cf981..c418282 100644
--- a/android/pts-gatt.txt
+++ b/android/pts-gatt.txt
@@ -936,7 +936,7 @@ TC_GAW_SR_BI_24_C	PASS	haltest:
 				gatts add_descriptor: <permmisions> 17
 				gatts start_service
 				gatts send_response: <status> 12
-TC_GAW_SR_BV_09_C	FAIL	haltest:
+TC_GAW_SR_BV_09_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
@@ -947,20 +947,20 @@ TC_GAW_SR_BV_09_C	FAIL	haltest:
 						repeat with correct offset
 				gatts send_response:
 						repeat with correct value
-TC_GAW_SR_BI_25_C	FAIL	haltest:
+TC_GAW_SR_BI_25_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts add_descriptor: <permmisions> 17
 				gatts start_service
 				gatts send_response: <status> 1
-TC_GAW_SR_BI_26_C	FAIL	haltest:
+TC_GAW_SR_BI_26_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts add_descriptor: <permmisions> 1
 				gatts start_service
-TC_GAW_SR_BI_27_C	FAIL	haltest:
+TC_GAW_SR_BI_27_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
@@ -970,35 +970,35 @@ TC_GAW_SR_BI_27_C	FAIL	haltest:
 						<data> value greater than MTU
 						repeat with correct offset
 				gatts send_response: <status> 7
-TC_GAW_SR_BI_29_C	FAIL	haltest:
+TC_GAW_SR_BI_29_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts add_descriptor: <permmisions> 17
 				gatts start_service
 				gatts send_response: <status> 8
-TC_GAW_SR_BI_30_C	FAIL	haltest:
+TC_GAW_SR_BI_30_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts add_descriptor: <permmisions> 17
 				gatts start_service
 				gatts send_response: <status> 5
-TC_GAW_SR_BI_31_C	FAIL	haltest:
+TC_GAW_SR_BI_31_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts add_descriptor: <permmisions> 17
 				gatts start_service
 				gatts send_response: <status> 12
-TC_GAW_SR_BI_32_C	FAIL	haltest:
+TC_GAW_SR_BI_32_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
 				gatts start_service
 				gatts send_response
 				gatts send_response: <status> 13
-TC_GAW_SR_BI_33_C	FAIL	haltest:
+TC_GAW_SR_BI_33_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
@@ -1007,7 +1007,7 @@ TC_GAW_SR_BI_33_C	FAIL	haltest:
 						<data> value greater than MTU
 						repeat with correct offset
 				gatts send_response: <status> 13
-TC_GAW_SR_BI_34_C	FAIL	haltest:
+TC_GAW_SR_BI_34_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
@@ -1015,7 +1015,7 @@ TC_GAW_SR_BI_34_C	FAIL	haltest:
 				gatts start_service
 				gatts send_response
 				gatts send_response: <status> 13
-TC_GAW_SR_BI_35_C	FAIL	haltest:
+TC_GAW_SR_BI_35_C	PASS	haltest:
 				gatts add_service
 				gatts add_characteristic:
 						<properties> 10 <permissions> 17
-- 
1.9.1


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

* Re: [PATCH 1/2] android/gatt: Fix server send response status value
  2014-12-11 17:16 [PATCH 1/2] android/gatt: Fix server send response status value Jakub Tyszkowski
  2014-12-11 17:16 ` [PATCH 2/2] android/pts: Update gatt server status Jakub Tyszkowski
@ 2014-12-11 17:55 ` Szymon Janc
  1 sibling, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2014-12-11 17:55 UTC (permalink / raw)
  To: Jakub Tyszkowski; +Cc: linux-bluetooth

Hi Jakub,

On Thursday 11 of December 2014 18:16:52 Jakub Tyszkowski wrote:
> Cast status to uint8_t, due to (byte) cast in java layer.
> ---
>  android/gatt.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index 84fba64..64163f8 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -5551,7 +5551,8 @@ static void handle_server_send_response(const void
> *buf, uint16_t len) * gatt_db_attribute_write().
>  		 */
>  		req = queue_peek_head(conn->device->pending_requests);
> -		req->error = err_to_att(cmd->status);
> +		/* Cast status to uint8_t, due to (byte) cast in java layer. */
> +		req->error = err_to_att((uint8_t)cmd->status);
>  		req->state = REQUEST_DONE;
> 
>  		/*
> @@ -5560,15 +5561,16 @@ static void handle_server_send_response(const void
> *buf, uint16_t len) */
>  	}
> 
> +	/* Cast status to uint8_t, due to (byte) cast in java layer. */
>  	if (transaction->opcode < ATT_OP_WRITE_REQ)
>  		gatt_db_attribute_read_result(transaction->attrib,
> -						transaction->serial_id,
> -						err_to_att(cmd->status),
> -						cmd->data, cmd->len);
> +					transaction->serial_id,
> +					err_to_att((uint8_t)cmd->status),
> +					cmd->data, cmd->len);
>  	else
>  		gatt_db_attribute_write_result(transaction->attrib,
> -						transaction->serial_id,
> -						err_to_att(cmd->status));
> +					transaction->serial_id,
> +					err_to_att((uint8_t)cmd->status));
> 
>  	send_dev_complete_response(conn->device, transaction->opcode);

Applied (after fixing some code style issues), thanks.

-- 
BR
Szymon Janc

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

end of thread, other threads:[~2014-12-11 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 17:16 [PATCH 1/2] android/gatt: Fix server send response status value Jakub Tyszkowski
2014-12-11 17:16 ` [PATCH 2/2] android/pts: Update gatt server status Jakub Tyszkowski
2014-12-11 17:55 ` [PATCH 1/2] android/gatt: Fix server send response status value 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).