Re: org.freedesktop.NetworkManager.Settings.PropertiesChanged deprecated

On 14.07.2021 19:58, mh mike franken de wrote:

On Mittwoch, 14. Juli 2021 16:52:53 CEST Andrei Borzenkov via networkmanager-
list wrote:

Probably there is a fundamental misunderstanding regaring the concept on

You have object which has properties. When properties change, you get
signal *from this object*. If you want to monitor for connectivity
changes, you need to monitor active connection.

The examples/python/dbus/ in NM source tree does precisely
that - it monitors for connectivity changes on current connection.

yes, but because I also need to monitor VPN changes, I have to monitor /o/f/

In your original mail you only said "monitor connectivity" so anything
is just guesswork.

If you want to monitor overall connectivity, you need to monitor main
/o/f/NM object.

This is, what I did before NetworkManager's PropertiesChanged signal got 
My problem is to understand, what path and what interface I have to use in 
this part of my code, after the PropertiesChanged signal moved from 
NetworkManager to DBus:

my $busobjpath = "org.freedesktop.NetworkManager";
my $busif = "org.freedesktop.DBus.Properties";
my $oBUSIF = $oBUSSVC->get_object( $busobjpath, $busif ) || die $!;
  "PropertiesChanged", sub {
    &{ \&onPropertiesChanged }( @_ )
  } || die $!;

I do not see any reference to object here so I have no idea what this
code does. The following certainly works

def properties_changed(interface_name, changed_properties,
    print (interface_name, changed_properties, invalidated_properties)

bus = dbus.SystemBus()
obj = bus.get_object("org.freedesktop.NetworkManager",
iface = dbus.Interface(obj, "org.freedesktop.DBus.Properties")
iface.connect_to_signal("PropertiesChanged", properties_changed)

The original code now tells me

no signal PropertiesChanged in interface org.freedesktop.NetworkManager at /
usr/lib/perl5/vendor_perl/5.32.1/x86_64-linux-thread-multi/Net/DBus/Binding/ line 420.

which seemed clear to me, because it got deprecated.

Thx and bye.

networkmanager-list mailing list
networkmanager-list gnome org

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