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

From: Hugh Daschbach <[email-masked]>
Date: Mon, 07 Sep 2020 10:35:27 -0700

Michael Albinus writes:

> Hugh Daschbach <[email-masked]> writes:
>
> Hi Hugh,
>
>> There doesn't seem to be any mechanism to register the property 
>> and have
>> introspection describe it as as an :object-path.
>>
>
> 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.
>

I had considered an optional or keyword argument to
dbus-register-property, but I like introspection even more.  Then 
the
application simply registers ofD.Introspectable.Introspect for 
each of
its objects?

Introspect returns XML.  The SEXP that dbus-introspect-xml returns 
is
easier to work with.  So do you memoize the returned value?  There 
may
not be enough overhead to be concerned.  I'm just trying to 
imagine what
overhead would be introduced.

I'm looking at emulating a Bluetooth keyboard.  So I'm 
anticipating
bursty property updates on the order of tens per second.  User
initiated, rather than continuous background activity.  But I 
don't want
to bog the system down.  An introspection per property update 
probably
isn't much to worry about.

Sounds good to me.

Cheer,
Hugh