Initial commit with current version (0.3.3)
[pyiw] / test.py
diff --git a/test.py b/test.py
new file mode 100755 (executable)
index 0000000..a30a356
--- /dev/null
+++ b/test.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+import sys
+import time
+import pyiw
+
+INTERFACE = "eth1"
+
+def PrintAllValues(iface):
+       for val in iface:
+               print "%-9s = %s" % (val, iface[val])
+       
+if __name__ == "__main__":
+       print "Using device:", INTERFACE, "\n"
+       print "Version [ PyIW      ]:", pyiw.version()
+       print "Version [ libiw/WE  ]:", pyiw.iw_version()
+       print "Version [ kernel/WE ]:", pyiw.we_version(), "\n"
+
+       try:
+               iface = pyiw.WirelessInterface(INTERFACE)
+
+               iface["essid"]   = "01234567890123456789fasdfasdfas"
+               iface["channel"] = 1.0
+
+               for i in iface:
+                       print i, "-", iface[i]
+
+       except pyiw.error, error:
+               print "Error:", error
+
+               sys.exit(1)
+
+       print "\nScanning...\n"
+
+       for net in iface.Scan():
+               print net["essid"], "- WPA Active:", net["wpa"]