* [PATCH] android/gatt: Fix doing database reads on write
@ 2014-05-29 5:59 Jakub Tyszkowski
2014-05-29 7:32 ` Szymon Janc
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Tyszkowski @ 2014-05-29 5:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jakub Tyszkowski
Wrong function was called resulting in read responses being send along
with write response. As it is now 'process_dev_pending_requests' is
processing only read requests.
---
android/gatt.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/android/gatt.c b/android/gatt.c
index 89aca16..fd35442 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -5043,7 +5043,7 @@ static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len,
return ATT_ECODE_INSUFF_RESOURCES;
data->handle = handle;
- data->state = REQUEST_INIT;
+ data->state = REQUEST_PENDING;
if (!queue_push_tail(dev->pending_requests, data)) {
free(data);
@@ -5057,7 +5057,8 @@ static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len,
return ATT_ECODE_UNLIKELY;
}
- process_dev_pending_requests(dev, cmd[0]);
+ if (!queue_find(dev->pending_requests, match_pending_dev_request, NULL))
+ send_dev_pending_response(dev, cmd[0]);
return 0;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] android/gatt: Fix doing database reads on write
2014-05-29 5:59 [PATCH] android/gatt: Fix doing database reads on write Jakub Tyszkowski
@ 2014-05-29 7:32 ` Szymon Janc
0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2014-05-29 7:32 UTC (permalink / raw)
To: Jakub Tyszkowski; +Cc: linux-bluetooth
Hi Jakub,
On Thursday 29 of May 2014 07:59:11 Jakub Tyszkowski wrote:
> Wrong function was called resulting in read responses being send along
> with write response. As it is now 'process_dev_pending_requests' is
> processing only read requests.
> ---
> android/gatt.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/android/gatt.c b/android/gatt.c
> index 89aca16..fd35442 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -5043,7 +5043,7 @@ static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len,
> return ATT_ECODE_INSUFF_RESOURCES;
>
> data->handle = handle;
> - data->state = REQUEST_INIT;
> + data->state = REQUEST_PENDING;
>
> if (!queue_push_tail(dev->pending_requests, data)) {
> free(data);
> @@ -5057,7 +5057,8 @@ static uint8_t write_req_request(const uint8_t *cmd, uint16_t cmd_len,
> return ATT_ECODE_UNLIKELY;
> }
>
> - process_dev_pending_requests(dev, cmd[0]);
> + if (!queue_find(dev->pending_requests, match_pending_dev_request, NULL))
> + send_dev_pending_response(dev, cmd[0]);
>
> return 0;
> }
I've applied this patch, yet please prepare patches that will at least fix
names of those functions since this is becoming hard to follow. Thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-29 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 5:59 [PATCH] android/gatt: Fix doing database reads on write Jakub Tyszkowski
2014-05-29 7:32 ` Szymon Janc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox