linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gix <bgix@codeaurora.org>
To: "Ganir, Chen" <chen.ganir@ti.com>
Cc: Anderson Lizardo <anderson.lizardo@openbossa.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Mat Martineau <mathewm@codeaurora.org>,
	Claudio Takahasi <claudio.takahasi@openbossa.org>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"ingas@codeaurora.org" <ingas@codeaurora.org>
Subject: Re: GATT Dbus API on BlueZ - attirbute-api.txt modifications
Date: Fri, 28 Oct 2011 09:19:39 -0700	[thread overview]
Message-ID: <4EAAD61B.60600@codeaurora.org> (raw)
In-Reply-To: <7769C83744F2C34A841232EF77AEA20C01DCBC41E0@dnce01.ent.ti.com>

Hi Chen, Anderson, Luiz,

On 10/27/2011 8:06 AM, Ganir, Chen wrote:
> Anderson,Luiz,
>
>>
>> Regarding caching reads and writes, the way LE works from my POV is
>> that most devices (except ones which rely on Proximity Link Loss) will
>> have Link Supervision Timeout of a few seconds at least. I have
>> already seen devices with 30 seconds LSTO.
>>
>> For these high latency devices (which use conservative connection
>> parameters for saving battery) some caching is good. But we should
>> provide ways to let the D-Bus API user know whether the data has
>> effectively been written, or updated locally. This can be done by
>> means of D-Bus signals. Which point us back to the reason why we have
>> Value as a property in the first place.
>>
>> Also imagine that the API might allow a couple of D-Bus clients
>> talking to the same device, but using different services. In case of
>> temporary link loss (or high latency), the values should be kept by
>> BlueZ, which will then write the value once connection is restored.
>> Otherwise, you would see many D-Bus clients trying to read/write data
>> while the link is not ok.
>>
> Caching seems very wrong to me. A client expects the correct data from the server, and not something that is not correct. Why provide a cached value instead of notifying the client that the link is down ? What if the server changes the value, and the client keeps getting the wrong value ? I believe the client should be notified if the link is down and there is an error reading the correct value.
>
> Regarding the multiple client scenario - Since dbus is still not my expertise, I would be happy to get some ideas here - currently the function is blocking. It means that it will not return until the server replies or the link is down. I assume that the dbus daemon will queue multiple requests to allow bluetoothd to handle each one at it's turn ? If this is not the case, I would be happy if someone could elaborate on this and highlight the correct usage in multiple client scenario.
>

I am also of the opinion that caching is the wrong thing to do in 
bluez/bluetoothd.

Caching should only be done when there is established knowledge by 
entity doing the caching, that the data persists.  There are a few cases 
where this is known to be true, such as device/manufacturer text 
strings, but for the vast majority of characteristics that have already 
been invented, and will be invented in the future bluez should have no 
privledged knowledge of.

Temperature readings of course are the perfect example of why we don't 
want to make caching the default behavior.

As to moving forward towards more characteristic definitions and 
profiles, a do not think that by not caching, we will create the "poll 
fest" situation that Luiz fears. Applications that have been written 
with LE in mind should be the place where characteristic specific 
knowledge, such as persistence of data over time, should be.  An App 
that repeatedly polls a persistent characteristic value would be poorly 
written (the App should do it's own caching). In the unlikely event that 
Multiple Apps are sharing the same remote server (which as a LE Use 
Case, I would consider Rare) you are only increasing the Reads of 
persistent data on a 1 per App basis.

But we should NOT cache values simply as a way to protect ourselves from 
poorly behaving (excessively polling) Apps.

Unless we could convince the BT Sig to add a Persistent Property 
(perhaps to the Extended Property mask) I would not do any caching in 
bluez, with the exception of a few known Characteristrics (such as in 
the GATT and GAP service) that bluez itself directly is the "client".





>>
>> Luiz, while I totally agree with the D-Bus error instead of return
>> value (and you know about this stuff better than me :), how could we
>> pass the "custom"  ATT error codes to the client? Any profile can
>> define their own ATT error codes, and BlueZ cannot know all of them.
>>
> This is why I wanted it to be integer.
>
>
>>>
>>> Create an array of string WriteMethods which represents the methods
>>> supported by the characteristic.
>>
>> Agreed. They are readonly anyway. and makes it easier to extend.
>>
>> I would just go with "SupportedWriteMethods" of something like that :)
>> (but it is a detail).
>>
> I also agree here. This property will be changed to writableMethods string array, with string>Boolean dictionary.
>
> Thanks for your comments so far.
>
> Chen Ganir.
>


-- 
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

  parent reply	other threads:[~2011-10-28 16:19 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24 23:06 [PATCH bluez 0/2] Add BT 3.0+HS signalling definitions Peter Krystad
2011-10-24 23:06 ` [PATCH bluez 1/2] Add L2CAP Create/Move Channel definitions Peter Krystad
2011-10-24 23:06 ` [PATCH bluez 2/2] Add A2MP definitions Peter Krystad
2011-10-25  1:43 ` Add BT 3.0+HS signalling definitions Timur Mehrvarz
2011-10-25  7:38   ` GATT Dbus API on BlueZ Ganir, Chen
2011-10-25 12:52     ` Claudio Takahasi
2011-10-25 13:19       ` Ganir, Chen
2011-10-26  0:06         ` Claudio Takahasi
2011-10-26  7:20           ` GATT Dbus API on BlueZ - attirbute-api.txt modifications Ganir, Chen
2011-10-27  7:16             ` Mat Martineau
2011-10-27  8:22               ` Ganir, Chen
2011-10-27 11:30                 ` Mat Martineau
2011-10-27 13:31                 ` Luiz Augusto von Dentz
2011-10-27 13:57                   ` Anderson Lizardo
2011-10-27 14:02                     ` Anderson Lizardo
2011-10-27 14:58                       ` Ganir, Chen
2011-10-27 15:13                         ` Anderson Lizardo
2011-10-27 15:18                           ` Ganir, Chen
2011-10-27 15:35                             ` Anderson Lizardo
2011-10-27 15:06                     ` Ganir, Chen
2011-10-27 15:29                       ` Anderson Lizardo
2011-10-27 15:48                         ` Ganir, Chen
2011-10-27 16:29                           ` Anderson Lizardo
2011-10-27 16:47                             ` Ganir, Chen
2011-10-27 17:32                               ` Anderson Lizardo
2011-10-30  6:56                                 ` Ganir, Chen
2011-10-30 14:23                                   ` Anderson Lizardo
2011-10-30 15:48                                     ` Ganir, Chen
2011-10-30 18:02                                       ` Anderson Lizardo
2011-10-31  6:38                                         ` Ajay Pillai
2011-10-31  6:57                                           ` Ganir, Chen
2011-10-31  8:04                                             ` Ajay Pillai
2011-10-31 10:47                                           ` Anderson Lizardo
2011-10-31  7:19                                         ` Ganir, Chen
2011-10-31 11:07                                           ` Anderson Lizardo
2011-10-31 13:35                                             ` Ajay Pillai
2011-10-31 14:53                                               ` Luiz Augusto von Dentz
2011-10-28 16:19                       ` Brian Gix [this message]
2011-10-28 20:09                         ` Anderson Lizardo
2011-10-27 13:32             ` Anderson Lizardo
2011-10-31 17:41             ` Tsai, Mike
2012-01-11 14:25           ` GATT Dbus API on BlueZ Vijaykumar Dadmode
2012-01-11 14:57             ` Claudio Takahasi
2011-10-25 14:41   ` Add BT 3.0+HS signalling definitions Peter Krystad
2011-10-26  0:15     ` Timur Mehrvarz
2011-10-26  7:54       ` Andrei Emeltchenko
2011-10-27 13:39         ` BT 3.0+HS Timur Mehrvarz
2011-10-27 16:46           ` tim.howes
2011-11-03 16:38             ` Timur Mehrvarz
2011-10-26  7:36 ` [PATCH bluez 0/2] Add BT 3.0+HS signalling definitions Andrei Emeltchenko
2011-10-26 17:44   ` Peter Krystad
2011-10-27  8:00     ` 'Andrei Emeltchenko'
2011-10-28  0:23       ` Peter Krystad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EAAD61B.60600@codeaurora.org \
    --to=bgix@codeaurora.org \
    --cc=anderson.lizardo@openbossa.org \
    --cc=chen.ganir@ti.com \
    --cc=claudio.takahasi@openbossa.org \
    --cc=ingas@codeaurora.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=mathewm@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).