* gatt client clones break indication/confirmation
@ 2016-05-23 9:57 Mikhail Krivtsov
2016-05-23 12:24 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Krivtsov @ 2016-05-23 9:57 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 821 bytes --]
When bt_gatt_client receives 'indication' it sends 'confirmation'.
'confirmation' sending was broken after adding support for 'clones' of
bt_gatt_client. In addition to first bt_gatt_client each clone also
sends 'confirmation'.
# > ACL Data RX: Handle 69 flags 0x02 dlen 27
# ATT: Handle Value Indication (0x1d) len 22
# Handle: 0x001f
# Data: 68656c6c6f2027302e302e302e303a3532353332
# < ACL Data TX: Handle 69 flags 0x00 dlen 5
# ATT: Handle Value Confirmation (0x1e) len 0
# < ACL Data TX: Handle 69 flags 0x00 dlen 5
# ATT: Handle Value Confirmation (0x1e) len 0
Extra confirmation sent by clone confuses remote side. When bluetooth
daemon receives extra confirmation it breaks connection.
Attached patch fixes the issue limiting confirmation sending to single
bt_gatt_client.
[-- Attachment #2: 0001-shared-gatt-client_Fix_sending_confirmation.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]
>>From e470089b4b5788ab5d2ec9af21bffee4f9240c97 Mon Sep 17 00:00:00 2001
From: "Mikhail I. Krivtsov" <mikhail.krivtsov@gmail.com>
Date: Sat, 14 May 2016 11:37:30 +0300
Subject: [PATCH] shared/gatt-client: Fix sending confirmation
Confirmation shall be sent from topmost parent only.
Extra confirmation sent by clone confuses remote side.
> ACL Data RX: Handle 69 flags 0x02 dlen 27
ATT: Handle Value Indication (0x1d) len 22
Handle: 0x001f
Data: 68656c6c6f2027302e302e302e303a3532353332
< ACL Data TX: Handle 69 flags 0x00 dlen 5
ATT: Handle Value Confirmation (0x1e) len 0
< ACL Data TX: Handle 69 flags 0x00 dlen 5
ATT: Handle Value Confirmation (0x1e) len 0
---
src/shared/gatt-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 84689f6..adabfe3 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -1745,7 +1745,7 @@ static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length,
queue_foreach(client->notify_list, notify_handler, &pdu_data);
- if (opcode == BT_ATT_OP_HANDLE_VAL_IND)
+ if (opcode == BT_ATT_OP_HANDLE_VAL_IND && !client->parent)
bt_att_send(client->att, BT_ATT_OP_HANDLE_VAL_CONF, NULL, 0,
NULL, NULL, NULL);
--
2.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: gatt client clones break indication/confirmation
2016-05-23 9:57 gatt client clones break indication/confirmation Mikhail Krivtsov
@ 2016-05-23 12:24 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2016-05-23 12:24 UTC (permalink / raw)
To: Mikhail Krivtsov; +Cc: linux-bluetooth@vger.kernel.org
Hi Mikhail,
On Mon, May 23, 2016 at 12:57 PM, Mikhail Krivtsov
<mikhail.krivtsov@gmail.com> wrote:
> When bt_gatt_client receives 'indication' it sends 'confirmation'.
> 'confirmation' sending was broken after adding support for 'clones' of
> bt_gatt_client. In addition to first bt_gatt_client each clone also
> sends 'confirmation'.
>
> # > ACL Data RX: Handle 69 flags 0x02 dlen 27
> # ATT: Handle Value Indication (0x1d) len 22
> # Handle: 0x001f
> # Data: 68656c6c6f2027302e302e302e303a3532353332
> # < ACL Data TX: Handle 69 flags 0x00 dlen 5
> # ATT: Handle Value Confirmation (0x1e) len 0
> # < ACL Data TX: Handle 69 flags 0x00 dlen 5
> # ATT: Handle Value Confirmation (0x1e) len 0
>
> Extra confirmation sent by clone confuses remote side. When bluetooth
> daemon receives extra confirmation it breaks connection.
>
> Attached patch fixes the issue limiting confirmation sending to single
> bt_gatt_client.
I went ahead and applied this fix, thanks for the contribution.
*Next time please do follow the instruction under HACKING and send as
a proper patch.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-23 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 9:57 gatt client clones break indication/confirmation Mikhail Krivtsov
2016-05-23 12:24 ` Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.