All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arman Uguray <armansito@chromium.org>
To: BlueZ development <linux-bluetooth@vger.kernel.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	chao.jie.gu@intel.com
Subject: Re: [RFC v1 0/1] doc/gatt-api: New API properties and methods for the GATT D-Bus API.
Date: Tue, 22 Jul 2014 13:40:48 -0700	[thread overview]
Message-ID: <CAHrH25SR83cXq-xGQz4x7axjcW=CUL_VCcAfhny_RyZ+t0oZ-g@mail.gmail.com> (raw)
In-Reply-To: <20140722085507.GA29664@t440s.lan>

Hi Chaojie, Johan,

Please see my responses inline:


>> +             array{object} Characteristics [read-only]
>> +
>> +                     Array of object paths representing the characteristics
>> +                     of this service. This property is set only when the
>> +                     characteristic discovery has been completed, however the
>> +                     characteristic objects will become available via
>> +                     ObjectManager as soon as they get discovered.
> For this new property, I think there is not essential as other property,
> because when characteristic discovery happen , all the object path will setup
> on DBus Hierarchy. And user can get all the characteristic by ObjectManger.

The problem is that ObjectManager has no clear way to tell a client
that "this subset of object paths have been published" and when they
are all available via GetManagedObjects. The most a client can do is
observe the InterfacesAdded signal and that signal is sent on a per
object path basis. For most external applications, it might be enough
but I would like application APIs to have to ability to say "all
objects published, service is ready to use".


> Through this, User can use their own structure to get this array of object.
> That is also why we need object property such as Device, Service and so on.
>
> And another reason , it have to wait for characteristic discovery completed, it
> also can say that it have to wait for characteristic setup DBus Hirarchy is
> ready. There exists asynchronous issues, if user get this property operation
> before all the characteristic DBus setup is ready, it will make a mistake.
>

This is exactly the problem. A simple update of this property lets the
user know that the hierarchy has been set up. For all I care, this
could even be a simple boolean property such as "DiscoveryComplete"
but I kind of like the list of characteristics even though
GetManagedObjects/InterfacesAdded, as you say, can achieve the same
result. We have the similar "Includes" property already, so it's not
entirely inconsistent from an API standpoint.


>> +             void StartNotify()
>> +
>> +                     Starts a notification session from this characteristic
>> +                     if it supports value notifications or indications.
>> +
>> +                     Possible Errors: org.bluez.Error.Failed
>> +                                      org.bluez.Error.InProgress
>> +                                      org.bluez.Error.NotSupported
> About this method , I think other LE profile offer similar interface to user,
> such as in heartrate profile. It will give registerwatcher method, in which
> it will enable notify for heartrate. This will help to trace descriptor
> including notification bit changed and send Propertychanged signal.

Are you referring to the HeartRateManager1 hierarchy? Since we're now
building a generic API, we need a proper way of reference-counted,
per-connection way to access the Client Characteristic Configuration
descriptor. In this proposal, calling WriteValue on the CCC descriptor
will always fail with WriteNotPermitted.

Do you have any suggestions for the method name or are you OK with
StartNotify for now? We can always change it later.


> "Insufficient Authorization" seems different from the other two in that
> it's something that can't be attempted to be "fixed" from the client
> side. It effectively means that our request was rejected by the remote
> user, doesn't it?

Good point, there is really not much bluetoothd or the external app
can do in this case so we should probably propagate the authentication
error separately from the NotPaired cases. Or do you think that it
would be beneficial to have separate error definitions for Encryption
and Authentication as well? Having Error.NotPaired and
Error.Authentication seems reasonable to me.

Cheers,
Arman

  reply	other threads:[~2014-07-22 20:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 23:40 [RFC v1 0/1] doc/gatt-api: New API properties and methods for the GATT D-Bus API Arman Uguray
2014-07-21 23:40 ` [RFC v1 1/1] " Arman Uguray
2014-07-22  8:38   ` guchaojie
2014-07-28  9:17   ` Gu, Chao Jie
2014-07-28 20:52     ` Arman Uguray
2014-07-28 22:34       ` Marcel Holtmann
2014-07-28 23:31         ` Arman Uguray
2014-07-28 23:51           ` Marcel Holtmann
2014-07-29  6:03           ` Gu, Chao Jie
2014-07-29 19:07             ` Arman Uguray
2014-07-30 16:46               ` Marcel Holtmann
2014-08-01  3:11                 ` Arman Uguray
2014-08-11  9:56                   ` Gu, Chao Jie
2014-08-11 17:49                     ` Marcel Holtmann
2014-08-11 18:46                       ` Arman Uguray
2014-08-11 19:03                         ` Marcel Holtmann
2014-08-11 20:38                           ` Arman Uguray
2014-07-22  8:55 ` [RFC v1 0/1] " Johan Hedberg
2014-07-22 20:40   ` Arman Uguray [this message]
2014-07-23  5:24     ` Marcin Kraglak
2014-07-23 16:20       ` Arman Uguray
2014-07-23 13:22     ` Gu, Chao Jie
2014-07-23 16:18       ` Arman Uguray
2014-07-23 16:32         ` Marcel Holtmann
2014-07-23 20:39           ` Arman Uguray
2014-07-24  4:11           ` Gu, Chao Jie
2014-07-24  7:58             ` Luiz Augusto von Dentz
2014-07-24  8:01               ` Luiz Augusto von Dentz
2014-07-25 18:50               ` Arman Uguray
2014-07-25 19:17                 ` Luiz Augusto von Dentz
2014-07-25 19:28                   ` Marcel Holtmann
2014-07-25 21:06                     ` Arman Uguray

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='CAHrH25SR83cXq-xGQz4x7axjcW=CUL_VCcAfhny_RyZ+t0oZ-g@mail.gmail.com' \
    --to=armansito@chromium.org \
    --cc=chao.jie.gu@intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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 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.