summaryrefslogtreecommitdiff
path: root/recipes/networkmanager/netm-cli-0.2
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/networkmanager/netm-cli-0.2
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/networkmanager/netm-cli-0.2')
-rw-r--r--recipes/networkmanager/netm-cli-0.2/scan_support.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/recipes/networkmanager/netm-cli-0.2/scan_support.patch b/recipes/networkmanager/netm-cli-0.2/scan_support.patch
new file mode 100644
index 0000000000..efa3cd89b4
--- /dev/null
+++ b/recipes/networkmanager/netm-cli-0.2/scan_support.patch
@@ -0,0 +1,69 @@
+diff --git a/netm-cli/netm-cli b/netm-cli/netm-cli
+index 46c3fa6..0a53036 100755
+--- a/netm-cli/netm-cli
++++ b/netm-cli/netm-cli
+@@ -29,6 +29,7 @@ __version__ = "0.2"
+ import dbus
+ import gobject
+ import os
++import sys
+ from dbus.mainloop.glib import DBusGMainLoop
+ from ConfigParser import ConfigParser
+ from optparse import OptionParser, OptionGroup
+@@ -499,6 +500,14 @@ class NMCLI:
+ self._we_cipher, self._hexkey,
+ self._wpa_version, self._key_mgmt)
+
++ def scan(self):
++ """Scan the network and update the NM device struct."""
++ for devname in self.devices:
++ device = self.devices[devname]
++ if device['type'] == DEVICE_TYPE_802_11_WIRELESS:
++ devobj = self.bus.get_object(NM_DBUS_SERVICE, device['path'])
++ devobj.performScan()
++
+ def sleep(self):
+ """Tell NetworkManager to go into offline mode mode."""
+ self.nm.sleep(ignore_reply=True)
+@@ -782,7 +791,33 @@ def main():
+ nm = NMCLI(device, essid, hexkey, contype, wep_alg, wpa_pairwise,
+ options.verbose)
+
++ loop = gobject.MainLoop()
++
+ # Main actions
++ if options.networks:
++ print "Performing scan...",
++ sys.stdout.flush()
++ devices = [nm.devices[dev]['path'] for dev in nm.devices if
++ nm.devices[dev]['type'] == DEVICE_TYPE_802_11_WIRELESS]
++
++ def scan_performed(device):
++ """Scan helper."""
++ if device in devices:
++ devices.remove(device)
++ if not devices:
++ loop.quit()
++
++ nm.bus.add_signal_receiver(
++ handler_function=scan_performed, signal_name="ScanPerformed",
++ path=NM_DBUS_PATH, dbus_interface=NM_DBUS_INTERFACE)
++ nm.scan()
++ loop.run()
++ nm.bus.remove_signal_receiver(
++ handler_or_match=scan_performed, signal_name="ScanPerformed",
++ path=NM_DBUS_PATH, dbus_interface=NM_DBUS_INTERFACE)
++ print "OK"
++ sys.stdout.flush()
++ nm.update_devices()
+ if options.monitor:
+ nm.set_signals()
+ if options.nmstatus:
+@@ -811,7 +846,6 @@ def main():
+ config.save()
+
+ if options.monitor:
+- loop = gobject.MainLoop()
+ loop.run()
+
+ # Run the program