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 import logging
logging.basicConfig() logging.basicConfig()
import wpactrl import wpaspy
wpas_ctrl = '/var/run/hostapd' wpas_ctrl = '/var/run/hostapd'
@ -37,10 +37,9 @@ def wpas_connect():
for ctrl in ifaces: for ctrl in ifaces:
try: try:
wpas = wpactrl.WPACtrl(ctrl) wpas = wpaspy.Ctrl(ctrl)
return wpas return wpas
except wpactrl.error, error: except Exception, e:
print "Error: ", error
pass pass
return None return None

View file

@ -20,7 +20,7 @@ import nfc.handover
import logging import logging
logging.basicConfig() logging.basicConfig()
import wpactrl import wpaspy
wpas_ctrl = '/var/run/wpa_supplicant' wpas_ctrl = '/var/run/wpa_supplicant'
@ -39,10 +39,9 @@ def wpas_connect():
for ctrl in ifaces: for ctrl in ifaces:
try: try:
wpas = wpactrl.WPACtrl(ctrl) wpas = wpaspy.Ctrl(ctrl)
return wpas return wpas
except wpactrl.error, error: except Exception, e:
print "Error: ", error
pass pass
return None return None