Re: signal for interface up/down
- From: mh mike franken de (Michael Hirmke)
- To: networkmanager-list gnome org
- Subject: Re: signal for interface up/down
- Date: 27 Jun 2016 20:45:00 +0200
Hi Dan,
[...]
ok, got all devices and their properties, connected to the
StateChanged
signal for every device, but now, when such a signal is thrown, how
do I
know what device it belongs to? I know the old and new state and the
reason, but not the device.
Does every single device need its own signal handler?
You get the Object Path in the signal message header which uniquely
identifies the device. Now if you want to know other things about the
device, like what interface name it has, then you'll need to make some
more D-Bus calls to figure that out (using the standard
org.freedesktop.DBus.Properties API), eg:
$ dbus-send --system --print-reply \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager/Devices/1 \
org.freedesktop.DBus.Properties.Get \
string:"org.freedesktop.NetworkManager.Device" string:"Interface"
which gives me:
variant string "wlp4s0"
ok, got the idea.
Thx a lot.
Dan
Bye.
Michael.
--
Michael Hirmke
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]