for key in ipv4.keys():
print " IPv4.%s = %s" % (key, ipv4[key])
+ networks = interface.ListNetworks()
+ for i in networks:
+ print " Network.Path = %s" % (i)
+
+ network = dbus.Interface(bus.get_object('org.freedesktop.connman', i),
+ 'org.freedesktop.connman.Network')
+
+ print " Network.Identifier = %s" % (network.GetIdentifier())
+ print " Network.Passphrase = %s" % (network.GetPassphrase())
+
print
properties = interface.GetProperties()
if (properties["Type"] == "80211"):
- print " Selecting network"
- interface.SelectNetwork("ConnMan Testing")
+ networks = interface.ListNetworks()
+ for i in networks:
+ network = dbus.Interface(bus.get_object('org.freedesktop.connman', i),
+ 'org.freedesktop.connman.Network')
+
+ if (network.GetIdentifier() == "ConnMan Testing"):
+ print " Selecting network %s" % (i)
+ interface.SelectNetwork(i)
else:
print " No networks"