Subject: bug#43252: 27.1; DBus properties lack type hints or overrides

From: Michael Albinus <[email-masked]>
Date: Mon, 07 Sep 2020 09:48:27 +0200

Hugh Daschbach <[email-masked]> writes:

Hi Hugh,

> In order to implement a service exposing interface
> "org.bluez.GattService1", I need to export the properties defined for
> that interface.  (See,
> https://kernel.googlesource.com/pub/scm/bluetooth/bluez/+/refs/tags/5.55/doc/gatt-api.txt)
>
> There are two properties that require an object path: "Device", and
> "Includes".  Since there is no type information associated with the
> registered property, introspection supplies its best guess.  If the
> value is a string it is described as a :string, not an :object-path
>
> There doesn't seem to be any mechanism to register the property and have
> introspection describe it as as an :object-path.
>
> Am I missing something?  Is this out of scope?  Is there anyway to
> specify simple types for parameter values?

Confirmed. In `dbus-registered-objects-table', properties are stored w/o
signature. An object path is stored as string, and dbus-get-property
returns a string.

Introspection data could be used if exists (like in your case). But they
are optional, so one cannot trust on their existence. Maybe we could say
that, in absence of introspection data, ofD.Properties.Get and
ofD.Properties.GetAll shall return a default type, like string in case
of object paths? Then it would be the responsibility of the user to
provide proper introspection data if needed.

> Thanks,
> Hugh

Best regards, Michael.