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