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)
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()