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



On Donnerstag, 15. Juli 2021 10:43:27 CEST Andrei Borzenkov wrote:
On Thu, Jul 15, 2021 at 11:27 AM <mh mike franken de> wrote:
On Donnerstag, 15. Juli 2021 06:45:06 CEST Andrei Borzenkov via
networkmanager-list wrote:
[...]

#!/usr/bin/perl -w

use strict;

use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Indent = 1;
use Net::DBus;
use Net::DBus::Dumper;
use Net::DBus::Reactor;

my $oBUS = Net::DBus->system || die $!;
my $nm = "org.freedesktop.NetworkManager";
my $oNM = $oBUS->get_service( $nm ) || die $!;
my $nmobjpath = "/org/freedesktop/NetworkManager";
my $nmif = "org.freedesktop.NetworkManager";

my $nmif = "org.freedesktop.DBus.Properties";

my $oNMIF = $oNM->get_object( $nmobjpath, $nmif ) || die $!;

$nmobjpath = "/org/freedesktop/NetworkManager/Settings";
$nmif = "org.freedesktop.NetworkManager.Settings";

my $nmif = "org.freedesktop.DBus.Properties";

my $oNMIFS = $oNM->get_object( $nmobjpath, $nmif ) || die $!;

$oNMIF->connect_to_signal(

  "PropertiesChanged", sub {
  
    &{ \&dbnm_onNMPropertiesChanged }( $oNM, $oNMIF, $oNMIFS, @_ );
  
  }

);
my $reactor = Net::DBus::Reactor->main() || die $!;
$reactor->run() || die $!;

sub dbnm_onNMPropertiesChanged {

  my( $oNM, $oNMIF, $oNMIFS, $props ) = @_;

my( $oNM, $oNMIF, $oNMIFS, $interface, $props, $invalidated_props ) = @_;

  print "\n- props -\n", Dumper( $props ), "\n--\n";

}

NM PropertiesChanged and D-Bus
org.freedesktop.DBus.Properties.PropertiesChanged have different
signatures. You are dumping interface name, not properties dictionary.

I am not sure, I understand this:
The example above is the one for NetworkManager's PropertiesChanged
signal.
It worked perfectly as long as this signal existed.

If you replace NM signal with DBus signal you also need to change
handler to look for different parameter

Besides that, what does "signature" mean in this context? Different
parameters?

Yes.

So last questions regarding signatures:
A handler only is accepted, if all parameters are correct?
Or - a handler is accepted, but not executed, if paramaters are not correct?

Thx and bye.
Michael.





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