This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 src/element.c           |    3 +++
 test/disable-network    |   35 +++++++++++++++++++----------------
 test/select-network     |   30 ++++++++++++++++++------------
 test/show-introspection |    4 ++--
 test/start-scanning     |   21 +++++++++------------
 5 files changed, 51 insertions(+), 42 deletions(-)

New commits:
commit 416e8cbe721a7ed8052e599edd3b7ae4249642ba
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Wed Dec 3 23:02:07 2008 +0100

    Use device interface to trigger scanning

commit 0b55d59e5c43bb5358fb830691f504ffee8d7e75
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Wed Dec 3 23:00:14 2008 +0100

    Add method for starting scan via the device interface

commit 647a017fc5c757d99dd39e2a65f113abe3ea0a3e
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Wed Dec 3 22:57:52 2008 +0100

    Only introspect devices

commit 1a3b9647cf270105ddc3d62ade586a776dc93592
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Wed Dec 3 22:55:35 2008 +0100

    Use network interface for connecting and disconnecting

commit 51b3dc6f611f7a0b1bbf309a4ac766a696828fff
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Wed Dec 3 22:55:10 2008 +0100

    Add network methods for connect and disconnect


Diff in this email is a maximum of 400 lines.
diff --git a/src/element.c b/src/element.c
index eb91fc9..408c46e 100644
--- a/src/element.c
+++ b/src/element.c
@@ -663,12 +663,15 @@ static GDBusSignalTable element_signals[] = {
 static GDBusMethodTable device_methods[] = {
        { "GetProperties", "",   "a{sv}", get_device_properties },
        { "SetProperty",   "sv", "",      set_device_property   },
+       { "Scan",          "",   "",      do_update             },
        { },
 };
 
 static GDBusMethodTable network_methods[] = {
        { "GetProperties", "",   "a{sv}", get_network_properties },
        { "SetProperty",   "sv", "",      set_network_property   },
+       { "Connect",       "",   "",      do_enable              },
+       { "Disconnect",    "",   "",      do_disable             },
        { },
 };
 
diff --git a/test/disable-network b/test/disable-network
index eede449..beea2f1 100755
--- a/test/disable-network
+++ b/test/disable-network
@@ -7,19 +7,22 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-elements = manager.ListElements()
-
-for path in elements:
-       element = dbus.Interface(bus.get_object("org.moblin.connman", path),
-                                               "org.moblin.connman.Element")
-
-       try:
-               properties = element.GetProperties()
-               if (properties["Type"] != "network"):
-                       continue
-
-               if (properties["Enabled"] == dbus.Boolean(1)):
-                       print "Disabling %s" % (path)
-                       element.Disable()
-       except:
-               pass
+properties = manager.GetProperties()
+
+for path in properties["Devices"]:
+       device = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Device")
+
+       properties = device.GetProperties()
+
+       print "[ %s ]" % (path)
+
+       for path in properties["Networks"]:
+               network = dbus.Interface(bus.get_object("org.moblin.connman", 
path),
+                                               "org.moblin.connman.Network")
+
+               properties = network.GetProperties()
+
+               if (properties["Connected"] == dbus.Boolean(1)):
+                       print "Disconnecting %s" % (path)
+                       network.Disconnect()
diff --git a/test/select-network b/test/select-network
index 7684546..e7491e8 100755
--- a/test/select-network
+++ b/test/select-network
@@ -12,19 +12,25 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-elements = manager.ListElements()
+properties = manager.GetProperties()
 
-for path in elements:
-       element = dbus.Interface(bus.get_object("org.moblin.connman", path),
-                                               "org.moblin.connman.Element")
+for path in properties["Devices"]:
+       device = dbus.Interface(bus.get_object("org.moblin.connman", path),
+                                               "org.moblin.connman.Device")
 
-       properties = element.GetProperties()
-       if (properties["Type"] != "network"):
-               continue
+       properties = device.GetProperties()
 
-       if (properties["Enabled"] == dbus.Boolean(1)):
-               continue
+       print "[ %s ]" % (path)
 
-       if (properties["WiFi.Name"] == sys.argv[1]):
-               print "Enabling %s" % (path)
-               element.Enable()
+       for path in properties["Networks"]:
+               network = dbus.Interface(bus.get_object("org.moblin.connman", 
path),
+                                               "org.moblin.connman.Network")
+
+               properties = network.GetProperties()
+
+               if (properties["Connected"] == dbus.Boolean(1)):
+                       continue
+
+               if (properties["WiFi.Name"] == sys.argv[1]):
+                       print "Connecting %s" % (path)
+                       network.Connect()
diff --git a/test/show-introspection b/test/show-introspection
index 86faca1..bbf93c8 100755
--- a/test/show-introspection
+++ b/test/show-introspection
@@ -12,9 +12,9 @@ print object.Introspect()
 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
                                        "org.moblin.connman.Manager")
 
-elements = manager.ListElements()
+properties = manager.GetProperties()
 
-for path in elements:
+for path in properties["Devices"]:
        object = dbus.Interface(bus.get_object("org.moblin.connman", path),
                                        "org.freedesktop.DBus.Introspectable")
 
diff --git a/test/start-scanning b/test/start-scanning
index ff0dd07..9d3f4db 100755
--- a/test/start-scanning
+++ b/test/start-scanning
@@ -7,25 +7,22 @@ bus = dbus.SystemBus()
 manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
                                        'org.moblin.connman.Manager')
 
-elements = manager.ListElements()
+properties = manager.GetProperties()
 
-for path in elements:
-       element = dbus.Interface(bus.get_object('org.moblin.connman', path),
-                                               'org.moblin.connman.Element')
+for path in properties["Devices"]:
+       device = dbus.Interface(bus.get_object('org.moblin.connman', path),
+                                               'org.moblin.connman.Device')
 
-       properties = element.GetProperties()
-
-       if (properties["Type"] != "device"):
-               continue
+       properties = device.GetProperties()
 
        print "[ %s ]" % (path)
 
-       if (properties["Subtype"] == "wifi"):
+       if (properties["Type"] == "wifi"):
                print "   Started WiFi scanning"
-               element.Update()
-       elif (properties["Subtype"] == "wimax"):
+               device.Scan()
+       elif (properties["Type"] == "wimax"):
                print "   Started WiMAX scanning"
-               element.Update()
+               device.Scan()
        else:
                print "   No scanning"
 
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to