2015-07-09 15:37:47

by Nathaniel McCallum

[permalink] [raw]
Subject: GATT service DBus interface violates DBus spec

The GATT service DBus interface currently requires that services
implement the following interfaces:
- org.freedesktop.DBus.ObjectManager
- org.freedesktop.DBus.Properties
- org.bluez.GattService1

An unwritten expectation is that the ObjectManager's GetManagedObjects
method should include the object itself in its return value. However,
the spec for GetManagedObjects states otherwise.

This currently works only because gdbus violates the spec.[1] Until
today, systemd's sd-bus library was compliant with the spec and thus
behaved differently from gdbus, making it impossible to use sd-bus with
bluez.[2]

I agree with Lennart's proposal that the best course of action is to
fix the spec, not the implementations. This would mean that no change
is needed for bluez (other than perhaps some documentation). However, I
wanted to raise awareness of this problem in case:
1. there is strong opposition to this proposal
2. others run into the same problem I did

[1] https://bugs.freedesktop.org/show_bug.cgi?id=91283
[2] https://github.com/systemd/systemd/commit/92d16a53e385781a55d9231d9
f8f89c1747ab0e4


2015-07-31 19:50:49

by Adam Moore

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

DQoNCk9uIDcvMzEvMTUsIDEyOjQ1IFBNLCAiT3RobWFuLCBPc3NhbWEiIDxvc3NhbWEub3RobWFu
QGludGVsLmNvbT4gd3JvdGU6DQoNCj5IaSBBZGFtLA0KPg0KPk9uIEZyaSwgSnVsIDMxLCAyMDE1
IGF0IDExOjAwIEFNLCBBZGFtIE1vb3JlDQo+PGFkYW0ubW9vcmVAc2F2YW50c3lzdGVtcy5jb20+
IHdyb3RlOg0KPj4gT3NzYW1hLCB0aGFua3MgZm9yIHNoYXJpbmcgLSBJIGRpZG6p9nQgaGF2ZSB0
aGUgaGVhcnQgdG8gZ28gZG93biB0aGF0DQo+PnBhdGgNCj4+IDopICBOaWNlIHRvIGhhdmUgdGhh
dCBzb2x1dGlvbiBhdmFpbGFibGUgdG9vLg0KPg0KPkhhISAgQmVsaWV2ZSB5b3UgbWUsIEkgcHJl
ZmVycmVkIG5vdCBnb2luZyBkb3duIHRoaXMgcGF0aCBzaW5jZSBpdA0KPmJhc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VyIGJ5IHJlcGx5IGUtbWFpbCBvciBhdCA1MDguNjgzLjI1MDAgYW5kIGRlbGV0
ZSB0aGlzIG1lc3NhZ2UgYW5kIGl0cyBhdHRhY2htZW50cywgaWYgYW55Lg0KDQo=

2015-07-31 19:45:31

by Othman, Ossama

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

Hi Adam,

On Fri, Jul 31, 2015 at 11:00 AM, Adam Moore
<[email protected]> wrote:
> Ossama, thanks for sharing - I didn¹t have the heart to go down that path
> :) Nice to have that solution available too.

Ha! Believe you me, I preferred not going down this path since it
basically reinvents the wheel. but I didn't have much choice at the
time since I needed to get something out the door that didn't rely too
heavily on upstream patches being merged.

> Just a thought - since the Characteristic objects must provide their
> service path via DBus Property, forcing their paths to be children of the
> service path may be redundant, unless some logic is planned to be based on
> the structure of the OM tree in the future.

Agreed. In this case, I just followed the convention found in the
example hierarchy described in the "GATT Manager Hierarchy" section in
the BlueZ doc/gatt-api.txt document, as well as the hierarchy found in
the BlueZ test/example-gatt-server Python code. Going with this
hierarchy also mimics the GATT service hierarchy described in the
Bluetooth spec.

Thanks!
-Ossama

2015-07-31 18:00:24

by Adam Moore

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

Ossama, thanks for sharing - I didn?t have the heart to go down that path
:) Nice to have that solution available too.

Just a thought - since the Characteristic objects must provide their
service path via DBus Property, forcing their paths to be children of the
service path may be redundant, unless some logic is planned to be based on
the structure of the OM tree in the future.

On 7/31/15, 10:47 AM, "Othman, Ossama" <[email protected]> wrote:

>On Fri, Jul 31, 2015 at 10:30 AM, Adam Moore
><[email protected]> wrote:
>> I ran into this as well when trying to build a an external service with
>> GLib?s GDBusObjectManagerServer. As I was highly motivated not to
>>rewrite
>> what I had, I have a little patch that relaxes the unwritten
>>expectation,
>> but it comes at the expense of being unable to enforce that
>> characteristics reside under the service object. (I think the proxy
>> callback orderings are not guaranteed) However, it does allow the
>>service
>> and characteristics to reside anywhere in the ObjectManager hierarchy.
>>
>> I?ll pass it along in case it helps accelerate a real fix, and perhaps
>>it
>> can unblock someone in the meantime.
>
>I ran into a similar problem with GLib, and ended up reluctantly
>replacing my use of GDBusObjectManagerServer with a hand-coded
>implementation (except for the signals) of the ObjectManager interface
>that was exported on the same object path as the
>org.bluez.GattService1 skeleton via
>g_dbus_interface_skeleton_export():
>https://git.iotivity.org/cgit/iotivity/tree/resource/csdk/connectivity/src
>/bt_le_adapter/linux/service.c#n213
>
>-Ossama


Statement of Confidentiality

The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683.2500 and delete this message and its attachments, if any.


2015-07-31 17:47:14

by Othman, Ossama

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

On Fri, Jul 31, 2015 at 10:30 AM, Adam Moore
<[email protected]> wrote:
> I ran into this as well when trying to build a an external service with
> GLibıs GDBusObjectManagerServer. As I was highly motivated not to rewrite
> what I had, I have a little patch that relaxes the unwritten expectation,
> but it comes at the expense of being unable to enforce that
> characteristics reside under the service object. (I think the proxy
> callback orderings are not guaranteed) However, it does allow the service
> and characteristics to reside anywhere in the ObjectManager hierarchy.
>
> Iıll pass it along in case it helps accelerate a real fix, and perhaps it
> can unblock someone in the meantime.

I ran into a similar problem with GLib, and ended up reluctantly
replacing my use of GDBusObjectManagerServer with a hand-coded
implementation (except for the signals) of the ObjectManager interface
that was exported on the same object path as the
org.bluez.GattService1 skeleton via
g_dbus_interface_skeleton_export():
https://git.iotivity.org/cgit/iotivity/tree/resource/csdk/connectivity/src/bt_le_adapter/linux/service.c#n213

-Ossama

2015-07-31 17:30:44

by Adam Moore

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

I ran into this as well when trying to build a an external service with
GLib?s GDBusObjectManagerServer. As I was highly motivated not to rewrite
what I had, I have a little patch that relaxes the unwritten expectation,
but it comes at the expense of being unable to enforce that
characteristics reside under the service object. (I think the proxy
callback orderings are not guaranteed) However, it does allow the service
and characteristics to reside anywhere in the ObjectManager hierarchy.

I?ll pass it along in case it helps accelerate a real fix, and perhaps it
can unblock someone in the meantime.

-Adam

On 7/31/15, 10:18 AM, "[email protected] on behalf of
Nathaniel McCallum" <[email protected] on behalf of
[email protected]> wrote:

>So it appears that our initial analysis was incorrect. In fact, all the
>dbus libraries behave the same. However, the Bluez GATT interface (and
>perhaps others) expects ObjectManager to behave incorrectly. Similarly,
>the Bluez test code contains a bug in its ObjectManager implementation.
>The offending line is here:
>http://git.kernel.org/cgit/bluetooth/bluez.git/tree/test/example-gatt-serv
>er#n91
>
>ObjectManager. GetManagedObjects() MUST NOT return itself in the set of
>returned children. The GATT interface needs to be updated to match this
>expectation.
>
>----- Original Message -----
>> The GATT service DBus interface currently requires that services
>> implement the following interfaces:
>> - org.freedesktop.DBus.ObjectManager
>> - org.freedesktop.DBus.Properties
>> - org.bluez.GattService1
>>
>> An unwritten expectation is that the ObjectManager's GetManagedObjects
>> method should include the object itself in its return value. However,
>> the spec for GetManagedObjects states otherwise.
>>
>> This currently works only because gdbus violates the spec.[1] Until
>> today, systemd's sd-bus library was compliant with the spec and thus
>> behaved differently from gdbus, making it impossible to use sd-bus with
>> bluez.[2]
>>
>> I agree with Lennart's proposal that the best course of action is to
>> fix the spec, not the implementations. This would mean that no change
>> is needed for bluez (other than perhaps some documentation). However, I
>> wanted to raise awareness of this problem in case:
>> 1. there is strong opposition to this proposal
>> 2. others run into the same problem I did
>>
>> [1] https://bugs.freedesktop.org/show_bug.cgi?id=91283
>> [2] https://github.com/systemd/systemd/commit/92d16a53e385781a55d9231d9
>> f8f89c1747ab0e4
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>>linux-bluetooth" in
>> the body of a message to [email protected]
>> 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 [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html


Statement of Confidentiality

The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683.2500 and delete this message and its attachments, if any.


2015-07-31 17:18:58

by Nathaniel McCallum

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

So it appears that our initial analysis was incorrect. In fact, all the dbus libraries behave the same. However, the Bluez GATT interface (and perhaps others) expects ObjectManager to behave incorrectly. Similarly, the Bluez test code contains a bug in its ObjectManager implementation. The offending line is here: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/test/example-gatt-server#n91

ObjectManager. GetManagedObjects() MUST NOT return itself in the set of returned children. The GATT interface needs to be updated to match this expectation.

----- Original Message -----
> The GATT service DBus interface currently requires that services
> implement the following interfaces:
> - org.freedesktop.DBus.ObjectManager
> - org.freedesktop.DBus.Properties
> - org.bluez.GattService1
>
> An unwritten expectation is that the ObjectManager's GetManagedObjects
> method should include the object itself in its return value. However,
> the spec for GetManagedObjects states otherwise.
>
> This currently works only because gdbus violates the spec.[1] Until
> today, systemd's sd-bus library was compliant with the spec and thus
> behaved differently from gdbus, making it impossible to use sd-bus with
> bluez.[2]
>
> I agree with Lennart's proposal that the best course of action is to
> fix the spec, not the implementations. This would mean that no change
> is needed for bluez (other than perhaps some documentation). However, I
> wanted to raise awareness of this problem in case:
> 1. there is strong opposition to this proposal
> 2. others run into the same problem I did
>
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=91283
> [2] https://github.com/systemd/systemd/commit/92d16a53e385781a55d9231d9
> f8f89c1747ab0e4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2015-08-10 22:55:47

by Adam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HRydXN0LCBhbmQgdGhlIHNvbGUgcHVy
cG9zZSBvZiBkZWxpdmVyeSB0byB0aGUgaW50ZW5kZWQgcmVjaXBpZW50LiBJZiB5b3UgaGF2ZSBy
ZWNlaXZlZCB0aGlzIHRyYW5zbWlzc2lvbiBpbiBlcnJvciwgYW55IHVzZSwgcmVwcm9kdWN0aW9u
IG9yIGRpc3NlbWluYXRpb24gb2YgdGhpcyB0cmFuc21pc3Npb24gaXMgc3RyaWN0bHkgcHJvaGli
aXRlZC4gSWYgeW91IGFyZSBub3QgdGhlIGludGVuZGVkIHJlY2lwaWVudCwgcGxlYXNlIGltbWVk
aWF0ZWx5IG5vdGlmeSB0aGUgc2VuZGVyIGJ5IHJlcGx5IGUtbWFpbCBvciBhdCA1MDguNjgzLjI1
MDAgYW5kIGRlbGV0ZSB0aGlzIG1lc3NhZ2UgYW5kIGl0cyBhdHRhY2htZW50cywgaWYgYW55Lg0K
DQo=

2015-08-02 08:57:25

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: GATT service DBus interface violates DBus spec

Hi,

On Fri, Jul 31, 2015 at 10:50 PM, Adam Moore
<[email protected]> wrote:
>
>
> On 7/31/15, 12:45 PM, "Othman, Ossama" <[email protected]> wrote:
>
>>Hi Adam,
>>
>>On Fri, Jul 31, 2015 at 11:00 AM, Adam Moore
>><[email protected]> wrote:
>>> Ossama, thanks for sharing - I didn¹t have the heart to go down that
>>>path
>>> :) Nice to have that solution available too.
>>
>>Ha! Believe you me, I preferred not going down this path since it
>>basically reinvents the wheel. but I didn't have much choice at the
>>time since I needed to get something out the door that didn't rely too
>>heavily on upstream patches being merged.
>>
>>> Just a thought - since the Characteristic objects must provide their
>>> service path via DBus Property, forcing their paths to be children of
>>>the
>>> service path may be redundant, unless some logic is planned to be based
>>>on
>>> the structure of the OM tree in the future.
>>
>>Agreed. In this case, I just followed the convention found in the
>>example hierarchy described in the "GATT Manager Hierarchy" section in
>>the BlueZ doc/gatt-api.txt document, as well as the hierarchy found in
>>the BlueZ test/example-gatt-server Python code. Going with this
>>hierarchy also mimics the GATT service hierarchy described in the
>>Bluetooth spec.
>
> Yeah, I used the same structure in my implementation - that was really
> more of a note for the maintainers that if we can live without a strict
> structure, it might simplify the final fix.
>
>>
>>Thanks!
>>-Ossama

It seems the issue was closed caused GDBus and other bindings follow
the D-Bus spec to the word, but how one would list interfaces in the
root '/'? So either '/' shall become special and no other interface
shall be registered there or the spec should be reworded to include
the initial path, but the former is probably not backward compatible
since afaik most bindings allow custom interfaces in '/' path.


--
Luiz Augusto von Dentz