* [PATCH BlueZ] gatt: Fix sending indications with proxy
@ 2017-10-03 18:35 Yunhan Wang
2017-10-04 11:19 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 5+ messages in thread
From: Yunhan Wang @ 2017-10-03 18:35 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Yunhan Wang
When using AcquireNotify with indication, the proxy needs to be filled in
send_notification_to_devices so as to get indication confirmation in
applciation.
---
src/gatt-database.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gatt-database.c b/src/gatt-database.c
index 0c84b2569..47304704a 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -1831,7 +1831,7 @@ static bool pipe_io_read(struct io *io, void *user_data)
buf, bytes_read,
gatt_db_attribute_get_handle(chrc->ccc),
chrc->props & BT_GATT_CHRC_PROP_INDICATE,
- NULL);
+ chrc->proxy);
return true;
}
--
2.14.2.822.g60be5d43e6-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ] gatt: Fix sending indications with proxy
2017-10-03 18:35 [PATCH BlueZ] gatt: Fix sending indications with proxy Yunhan Wang
@ 2017-10-04 11:19 ` Luiz Augusto von Dentz
2017-10-04 14:55 ` Yunhan Wang
0 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2017-10-04 11:19 UTC (permalink / raw)
To: Yunhan Wang; +Cc: linux-bluetooth@vger.kernel.org
Hi Yunhan,
On Tue, Oct 3, 2017 at 9:35 PM, Yunhan Wang <yunhanw@google.com> wrote:
> When using AcquireNotify with indication, the proxy needs to be filled in
> send_notification_to_devices so as to get indication confirmation in
> applciation.
> ---
> src/gatt-database.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gatt-database.c b/src/gatt-database.c
> index 0c84b2569..47304704a 100644
> --- a/src/gatt-database.c
> +++ b/src/gatt-database.c
> @@ -1831,7 +1831,7 @@ static bool pipe_io_read(struct io *io, void *user_data)
> buf, bytes_read,
> gatt_db_attribute_get_handle(chrc->ccc),
> chrc->props & BT_GATT_CHRC_PROP_INDICATE,
> - NULL);
> + chrc->proxy);
>
> return true;
> }
> --
> 2.14.2.822.g60be5d43e6-goog
Im not sure this the correct fix, the reason why the proxy is NULL is
because the fd is being used for io, though the confirmation has no
effect on the flow control Id expect some inband signalling in this
case but that might actually require something like a socketpair in
order to be able to write confirmation back.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ] gatt: Fix sending indications with proxy
2017-10-04 11:19 ` Luiz Augusto von Dentz
@ 2017-10-04 14:55 ` Yunhan Wang
2017-10-05 8:21 ` Yunhan Wang
0 siblings, 1 reply; 5+ messages in thread
From: Yunhan Wang @ 2017-10-04 14:55 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
Hi, Luiz
On Wed, Oct 4, 2017 at 4:19 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Yunhan,
>
> On Tue, Oct 3, 2017 at 9:35 PM, Yunhan Wang <yunhanw@google.com> wrote:
>> When using AcquireNotify with indication, the proxy needs to be filled in
>> send_notification_to_devices so as to get indication confirmation in
>> applciation.
>> ---
>> src/gatt-database.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gatt-database.c b/src/gatt-database.c
>> index 0c84b2569..47304704a 100644
>> --- a/src/gatt-database.c
>> +++ b/src/gatt-database.c
>> @@ -1831,7 +1831,7 @@ static bool pipe_io_read(struct io *io, void *user_data)
>> buf, bytes_read,
>> gatt_db_attribute_get_handle(chrc->ccc),
>> chrc->props & BT_GATT_CHRC_PROP_INDICATE,
>> - NULL);
>> + chrc->proxy);
>>
>> return true;
>> }
>> --
>> 2.14.2.822.g60be5d43e6-goog
>
> Im not sure this the correct fix, the reason why the proxy is NULL is
> because the fd is being used for io, though the confirmation has no
> effect on the flow control Id expect some inband signalling in this
> case but that might actually require something like a socketpair in
> order to be able to write confirmation back.
>
I think pipe_io_read should be pretty similar to property_changed_cb
in https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n2103,
both are used to handle the written value from application. Therefore,
send_notification_to_devices should be fine here with proxy. For
"socketpair", I guess you concern is Confirm? If Confirm is defined in
application, then confirmation should be able to be sent back to
application. If Confirm is not defined, it should be also fine in
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n883.
> --
> Luiz Augusto von Dentz
Thanks
Best wishes
Yunhan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ] gatt: Fix sending indications with proxy
2017-10-04 14:55 ` Yunhan Wang
@ 2017-10-05 8:21 ` Yunhan Wang
2017-10-05 13:41 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 5+ messages in thread
From: Yunhan Wang @ 2017-10-05 8:21 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
Hi, Luiz
With this change, all are working fine via using AcquireWrite and
AcquireNotify now in my end. I have not yet see any issue so far. Any
other concern or better idea?
Thanks
Best wishes
Yunhan
On Wed, Oct 4, 2017 at 7:55 AM, Yunhan Wang <yunhanw@google.com> wrote:
> Hi, Luiz
>
> On Wed, Oct 4, 2017 at 4:19 AM, Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
>> Hi Yunhan,
>>
>> On Tue, Oct 3, 2017 at 9:35 PM, Yunhan Wang <yunhanw@google.com> wrote:
>>> When using AcquireNotify with indication, the proxy needs to be filled in
>>> send_notification_to_devices so as to get indication confirmation in
>>> applciation.
>>> ---
>>> src/gatt-database.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/gatt-database.c b/src/gatt-database.c
>>> index 0c84b2569..47304704a 100644
>>> --- a/src/gatt-database.c
>>> +++ b/src/gatt-database.c
>>> @@ -1831,7 +1831,7 @@ static bool pipe_io_read(struct io *io, void *user_data)
>>> buf, bytes_read,
>>> gatt_db_attribute_get_handle(chrc->ccc),
>>> chrc->props & BT_GATT_CHRC_PROP_INDICATE,
>>> - NULL);
>>> + chrc->proxy);
>>>
>>> return true;
>>> }
>>> --
>>> 2.14.2.822.g60be5d43e6-goog
>>
>> Im not sure this the correct fix, the reason why the proxy is NULL is
>> because the fd is being used for io, though the confirmation has no
>> effect on the flow control Id expect some inband signalling in this
>> case but that might actually require something like a socketpair in
>> order to be able to write confirmation back.
>>
> I think pipe_io_read should be pretty similar to property_changed_cb
> in https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n2103,
> both are used to handle the written value from application. Therefore,
> send_notification_to_devices should be fine here with proxy. For
> "socketpair", I guess you concern is Confirm? If Confirm is defined in
> application, then confirmation should be able to be sent back to
> application. If Confirm is not defined, it should be also fine in
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n883.
>> --
>> Luiz Augusto von Dentz
>
> Thanks
> Best wishes
> Yunhan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ] gatt: Fix sending indications with proxy
2017-10-05 8:21 ` Yunhan Wang
@ 2017-10-05 13:41 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2017-10-05 13:41 UTC (permalink / raw)
To: Yunhan Wang; +Cc: linux-bluetooth@vger.kernel.org
Hi Yunhan,
On Thu, Oct 5, 2017 at 11:21 AM, Yunhan Wang <yunhanw@google.com> wrote:
> Hi, Luiz
>
> With this change, all are working fine via using AcquireWrite and
> AcquireNotify now in my end. I have not yet see any issue so far. Any
> other concern or better idea?
>
> Thanks
> Best wishes
> Yunhan
>
> On Wed, Oct 4, 2017 at 7:55 AM, Yunhan Wang <yunhanw@google.com> wrote:
>> Hi, Luiz
>>
>> On Wed, Oct 4, 2017 at 4:19 AM, Luiz Augusto von Dentz
>> <luiz.dentz@gmail.com> wrote:
>>> Hi Yunhan,
>>>
>>> On Tue, Oct 3, 2017 at 9:35 PM, Yunhan Wang <yunhanw@google.com> wrote:
>>>> When using AcquireNotify with indication, the proxy needs to be filled in
>>>> send_notification_to_devices so as to get indication confirmation in
>>>> applciation.
>>>> ---
>>>> src/gatt-database.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/gatt-database.c b/src/gatt-database.c
>>>> index 0c84b2569..47304704a 100644
>>>> --- a/src/gatt-database.c
>>>> +++ b/src/gatt-database.c
>>>> @@ -1831,7 +1831,7 @@ static bool pipe_io_read(struct io *io, void *user_data)
>>>> buf, bytes_read,
>>>> gatt_db_attribute_get_handle(chrc->ccc),
>>>> chrc->props & BT_GATT_CHRC_PROP_INDICATE,
>>>> - NULL);
>>>> + chrc->proxy);
>>>>
>>>> return true;
>>>> }
>>>> --
>>>> 2.14.2.822.g60be5d43e6-goog
>>>
>>> Im not sure this the correct fix, the reason why the proxy is NULL is
>>> because the fd is being used for io, though the confirmation has no
>>> effect on the flow control Id expect some inband signalling in this
>>> case but that might actually require something like a socketpair in
>>> order to be able to write confirmation back.
>>>
>> I think pipe_io_read should be pretty similar to property_changed_cb
>> in https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n2103,
>> both are used to handle the written value from application. Therefore,
>> send_notification_to_devices should be fine here with proxy. For
>> "socketpair", I guess you concern is Confirm? If Confirm is defined in
>> application, then confirmation should be able to be sent back to
>> application. If Confirm is not defined, it should be also fine in
>> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n883.
>>> --
>>> Luiz Augusto von Dentz
Applied, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-05 13:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 18:35 [PATCH BlueZ] gatt: Fix sending indications with proxy Yunhan Wang
2017-10-04 11:19 ` Luiz Augusto von Dentz
2017-10-04 14:55 ` Yunhan Wang
2017-10-05 8:21 ` Yunhan Wang
2017-10-05 13:41 ` Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox