]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Convert WPS NFC python scripts from using wpactrl to wpaspy
authorJouni Malinen <j@w1.fi>
Sat, 16 Mar 2013 19:47:10 +0000 (21:47 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Mar 2013 19:47:10 +0000 (21:47 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/wps-ap-nfc.py
wpa_supplicant/examples/wps-nfc.py

index 6ad0b430532d5841194bf6dfac7205a476cfe02b..61b5519ace3071e8f9b3b9e05c48c4d4ac060d44 100755 (executable)
@@ -18,7 +18,7 @@ import nfc.handover
 import logging
 logging.basicConfig()
 
-import wpactrl
+import wpaspy
 
 wpas_ctrl = '/var/run/hostapd'
 
@@ -37,10 +37,9 @@ def wpas_connect():
 
     for ctrl in ifaces:
         try:
-            wpas = wpactrl.WPACtrl(ctrl)
+            wpas = wpaspy.Ctrl(ctrl)
             return wpas
-        except wpactrl.error, error:
-            print "Error: ", error
+        except Exception, e:
             pass
     return None
 
index 9a6da5f974c62eb0cc56ba0d00b4d46f9a4c0958..86473cd62a3d61624906563d655959281f68fdda 100755 (executable)
@@ -20,7 +20,7 @@ import nfc.handover
 import logging
 logging.basicConfig()
 
-import wpactrl
+import wpaspy
 
 wpas_ctrl = '/var/run/wpa_supplicant'
 
@@ -39,10 +39,9 @@ def wpas_connect():
 
     for ctrl in ifaces:
         try:
-            wpas = wpactrl.WPACtrl(ctrl)
+            wpas = wpaspy.Ctrl(ctrl)
             return wpas
-        except wpactrl.error, error:
-            print "Error: ", error
+        except Exception, e:
             pass
     return None