All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Holmberg <jonas.holmberg@axis.com>
To: Andrejs Hanins <andrejs.hanins@ubnt.com>,
	Ryan Kuester <rkuester@insymbols.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: GATT service object required in D-Bus ObjectManager result
Date: Mon, 30 Nov 2015 08:44:04 +0100	[thread overview]
Message-ID: <565BFE44.4060706@axis.com> (raw)
In-Reply-To: <565BF7B0.2020905@ubnt.com>

Hi All,

On 11/30/2015 08:16 AM, Andrejs Hanins wrote:
> Hi,
> 
> On 11/29/2015 04:04 AM, Ryan Kuester wrote:
>> Hello everyone,
>>
>> When registering a GATT service via the D-Bus API, bluez-5.36
>> seems to expect the objects returned by the service's
>> GetManagedObjects method to include the service object itself,
>> the root of the managed object tree. Indeed, the included
>> test/example-gatt-server behaves this way[1].
>>
>> However, the D-Bus Specification seems to say an ObjectManager
>> should return the objects *under* the ObjectManager, i.e., only
>> the service's children---characteristics and descriptors. This
>> reading of the specification is in agreement with the
>> ObjectManager implementations in GDBus and Python's txdbus (I
>> didn't check other implementations).
>>
>> bluez's disagreement with the standard causes pain when trying to
>> use the ObjectManager implementations in the libraries, because
>> they don't return the ObjectManager itself, the service object,
>> as bluez expects. E.g., in txdbus, it's impossible to implement
>> the ObjectManager interface in application code (to get the
>> non-standard behavior) without patching the library.
>>
>> Does the expectation that the service object appear in the
>> GetManagedObjects result look like a disagreement with the D-Bus
>> standard to anyone else?
> 
> The same to me. I'm using Glib/Glibmm to export GATT services and
> Glib D-Bus code asserts in debug mode when object path matches
> with object manager path. I'm currently blindly ignoring this, cause
> it doesn't seems to cause any functionality problems in release code.

I was also bitten by that assert. I assumed it was a bug  so I wrote a
bug report about it: https://bugzilla.gnome.org/show_bug.cgi?id=758393
But after this discussion I'm not sure if it is a bug.

Regards
/Jonas

> 
>>
>> Thanks for all the good work on bluez,
>> -- Ryan
>>
>>
>> P.S. A possibly related issue is causing tools/gatt-service.c to
>> fail. It implements the ObjectManager interface on the root path
>> of the bus connection, rather on the service object. Perhaps this
>> indicates the service object *was* under a separate ObjectManager
>> in past versions, and this evolved into the current discrepancy
>> now that the service object *is* the ObjectManager.
>>
>> 1: text/example-gatt-server implements the ObjectManger
>> interface directly, making it easy to include the service object
>> in the GetManagedObjects result, even if returning the object is
>> nonstandard behavior, because the example is is written using
>> dbus-python, which doesn't provide help implementing the
>> ObjectManager interface.
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2015-11-30  7:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29  2:04 GATT service object required in D-Bus ObjectManager result Ryan Kuester
2015-11-30  7:16 ` Andrejs Hanins
2015-11-30  7:44   ` Jonas Holmberg [this message]
2015-11-30  7:59     ` Johan Hedberg
2015-11-30  9:12       ` Luiz Augusto von Dentz
2016-01-10 22:22         ` Luiz Augusto von Dentz
2016-01-11  8:53           ` Jonas Holmberg
2016-01-11 10:05           ` Andrejs Hanins

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=565BFE44.4060706@axis.com \
    --to=jonas.holmberg@axis.com \
    --cc=andrejs.hanins@ubnt.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=rkuester@insymbols.com \
    /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.