예제 #1
0
파일: wi.py 프로젝트: fygrave/wibat
    def init(self):
        if self.interface == "":
            print "No interface set\n"
            return
        print "Using device:", self.interface, "\n"
        print "Version [ PyIW      ]:", pyiw.version()
        print "Version [ libiw/WE  ]:", pyiw.iw_version()
        print "Version [ kernel/WE ]:", pyiw.we_version(), "\n"
        try:
            self.iface = pyiw.WirelessInterface(self.interface)
            for val in self.iface:
                print "%-9s = %s" % (val, self.iface[val])
            self.essid = self.iface["essid"]

        except pyiw.error, error:
            print "Error:", error
            sys.exit(1)
예제 #2
0
파일: test.py 프로젝트: e110c0/unisono
#!/usr/bin/env python

import sys
#import time
import pyiw

INTERFACE = "wlan0"

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)
        print("\n current settings \n")
        for i in iface:
            print(i, "-", iface[i])

        #iface["essid"]   = "01234567890123456789fasdfasdfas"
        #iface["channel"] = 1.0
        #print("\n settings after essid and channel set\n")
        #for i in iface:
            #print(i, "-", iface[i])

    except pyiw.error as error: