Re: DBus Properties?

On Mon, 2008-03-03 at 11:57 +0100, Helmut Schaa wrote:
> Hi,
> I was just working on getting all seen bssids into the appropriate connection 
> in KNetworkManager while roaming between several APs.
> The wireless device provides a DBus signal "PropertiesChanged" which is useful 
> for updating the seen_bssids property. Unfortunately the properties name 
> provided in "PropertiesChanged" is not the same as the one defined in 
> nm-device-802-11-wireless.h but the one from nm-device-802-11-wireless.c.
> Shouldn't the properties DBus-names be available in the header file too?

Not really; with libnm-glib the whole point is to wrap the D-Bus API in
a glib API so the client doesn't have to do any of the
marshalling/demarshalling or signal handling stuff directly.  But it
likely doesn't hurt to synchronize them.

Many of the functions there send the glib 'notify' signal like so:

	g_object_notify (G_OBJECT (self), NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT);

then you can attach to the "notify::ActiveAccessPoint" signal and get
property change notifications like so:

	g_signal_connect (wdev,
	                  "notify::" NM_DEVICE_802_11_WIRELESS_ACTIVE_ACCESS_POINT,
	                  G_CALLBACK (notify_active_ap_changed_cb),

There's a few things we need to do to libnm-glib before 0.7:

1) Ensure that any time a cached property changes, the notify gets sent

2) Convert all devices over to cached properties (ethernet isn't, others
might not be either)

3) Maybe harmonize the glib and dbus property names just for consistency
(also, Will noticed a discrepancy between the AP object's 'rate'
property and the 802.11 device's 'bitrate' property names)

4) Make sure that most of the stuff that needs to be exported is

5) I've toyed with a global rename of '802-11-wireless' -> 'wifi' which
I think is a good idea, but it's exposed in the NMSetting D-Bus API and
hence stored in GConf too, so it's a bit tricker to get right.  I might
settle for keeping the NMSetting name the same and renaming everything
else.  '802-3-ethernet' could also just be 'ethernet'.  Shorter to type,
less stupid.  But there were bigger fish to fry.


> Just have a look at the attached patch to see what I mean :)
> The patch is not meant for committing as the identifier-names should be 
> cleaned up first.
> Thanks,
> Helmut

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]