Convert WPS NFC python scripts from using wpactrl to wpaspy
Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
15cb4772d6
commit
c3aa4da94d
2 changed files with 6 additions and 8 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue