Convert WPS NFC python scripts from using wpactrl to wpaspy

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-03-16 21:47:10 +02:00
parent 15cb4772d6
commit c3aa4da94d
2 changed files with 6 additions and 8 deletions

View file

@ -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

View file

@ -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