diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-05-01 10:16:52 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-05-01 10:16:52 +0200 |
commit | 5b3c1583f2bad00bea37b0a261070dc1eb8e636a (patch) | |
tree | b83a7141c352327873ddc19d10d4044ea1194442 /test | |
parent | a25e63665687d881b3cb7d97bea07533284764b8 (diff) | |
download | connman-5b3c1583f2bad00bea37b0a261070dc1eb8e636a.tar.gz connman-5b3c1583f2bad00bea37b0a261070dc1eb8e636a.tar.bz2 connman-5b3c1583f2bad00bea37b0a261070dc1eb8e636a.zip |
test: Also monitor technology changes
Diffstat (limited to 'test')
-rwxr-xr-x | test/monitor-services | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/test/monitor-services b/test/monitor-services index 015dbd1a..9476bf8f 100755 --- a/test/monitor-services +++ b/test/monitor-services @@ -47,13 +47,23 @@ def property_changed(name, value, path): def services_changed(services, removed): for i in services: service = i[0][i[0].rfind("/") + 1:] - print "[%s] added / update" % (service) + print "[%s] changed" % (service) for n in i[1].keys(): property_changed(n, i[1][n], i[0]) for i in removed: service = i[i.rfind("/") + 1:] print "[%s] removed" % (service) +def technology_added(path, properties): + technology = path[path.rfind("/") + 1:] + print "[%s] added" % (technology) + for n in properties.keys(): + property_changed(n, properties[n], technology) + +def technology_removed(path): + technology = path[path.rfind("/") + 1:] + print "[%s] removed" % (technology) + if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -61,20 +71,36 @@ if __name__ == '__main__': bus.add_signal_receiver(property_changed, bus_name="net.connman", - dbus_interface="net.connman.Service", + dbus_interface="net.connman.Manager", signal_name="PropertyChanged", path_keyword="path") - bus.add_signal_receiver(property_changed, + bus.add_signal_receiver(services_changed, bus_name="net.connman", dbus_interface="net.connman.Manager", + signal_name="ServicesChanged") + + bus.add_signal_receiver(property_changed, + bus_name="net.connman", + dbus_interface="net.connman.Service", signal_name="PropertyChanged", path_keyword="path") - bus.add_signal_receiver(services_changed, + bus.add_signal_receiver(technology_added, bus_name="net.connman", dbus_interface="net.connman.Manager", - signal_name="ServicesChanged") + signal_name="TechnologyAdded") + + bus.add_signal_receiver(technology_removed, + bus_name="net.connman", + dbus_interface="net.connman.Manager", + signal_name="TechnologyRemoved") + + bus.add_signal_receiver(property_changed, + bus_name="net.connman", + dbus_interface="net.connman.Technology", + signal_name="PropertyChanged", + path_keyword="path") mainloop = gobject.MainLoop() mainloop.run() |