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 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html