Correct interface for PropertiesChanged signal

Daniel Drake dsd at laptop.org
Tue Aug 9 12:57:59 PDT 2011


Hi,

I am writing some code that uses GDBusProxy (the one from gio) to
monitor wpa_supplicant interfaces.

I am finding that when wpa_supplicant's properties changed, the
g-properties-changed signal is not emitted. If I try to read back the
cached properties after I know they have changed, they read back stale
values.

For example, here is one of the changes that is missed by GDBusProxy:

signal sender=:1.9 -> dest=(null destination) serial=3442
path=/fi/w1/wpa_supplicant1/Interfaces/5;
interface=fi.w1.wpa_supplicant1.Interface; member=PropertiesChanged
   array [
      dict entry(
         string "Scanning"
         variant             boolean true
      )
   ]

Looking at glib/gio/gdbusproxy.c code, in async_initable_init_first()
I find the following code:

      /* subscribe to PropertiesChanged() */
      proxy->priv->properties_changed_subscriber_id =
        g_dbus_connection_signal_subscribe (proxy->priv->connection,
                                            proxy->priv->name,
                                            "org.freedesktop.DBus.Properties",
                                            "PropertiesChanged",
                                            proxy->priv->object_path,
                                            proxy->priv->interface_name,
                                            G_DBUS_SIGNAL_FLAGS_NONE,
                                            on_properties_changed,
                                            proxy,
                                            NULL);

I haven't checked, but I'd say that the problem is that wpa_supplicant
is raising the signal on the fi.w1.wpa_supplicant1.Interface
interface, but GDBusProxy is only monitoring for PropertiesChanged on
org.freedesktop.DBus.Properties.

Is this a wpa_supplicant bug, or is the gio code wrong?

I note that NetworkManager behaves the same in that it raises
PropertiesChanged on its own interface:

signal sender=:1.4 -> dest=(null destination) serial=9367
path=/org/freedesktop/NetworkManager/AccessPoint/48;
interface=org.freedesktop.NetworkManager.AccessPoint;
member=PropertiesChanged
   array [
      dict entry(
         string "Strength"
         variant             byte 29
      )
   ]


Thanks,
Daniel


More information about the dbus mailing list