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

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