WPS: Add AP mode NFC connection handover with wpa_supplicant/nfcpy
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
f3f2ba2e6e
commit
f23ce1f032
1 changed files with 8 additions and 1 deletions
|
@ -86,6 +86,8 @@ def wpas_get_handover_sel(uuid):
|
||||||
wpas = wpas_connect()
|
wpas = wpas_connect()
|
||||||
if (wpas == None):
|
if (wpas == None):
|
||||||
return None
|
return None
|
||||||
|
if uuid is None:
|
||||||
|
return wpas.request("NFC_GET_HANDOVER_SEL NDEF WPS-CR").rstrip().decode("hex")
|
||||||
return wpas.request("NFC_GET_HANDOVER_SEL NDEF WPS-CR " + uuid).rstrip().decode("hex")
|
return wpas.request("NFC_GET_HANDOVER_SEL NDEF WPS-CR " + uuid).rstrip().decode("hex")
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,6 +135,9 @@ class HandoverServer(nfc.handover.HandoverServer):
|
||||||
|
|
||||||
|
|
||||||
def wps_handover_resp(peer, uuid):
|
def wps_handover_resp(peer, uuid):
|
||||||
|
if uuid is None:
|
||||||
|
print "Trying to handle WPS handover"
|
||||||
|
else:
|
||||||
print "Trying to handle WPS handover with AP " + uuid
|
print "Trying to handle WPS handover with AP " + uuid
|
||||||
|
|
||||||
srv = HandoverServer()
|
srv = HandoverServer()
|
||||||
|
@ -375,6 +380,8 @@ def main():
|
||||||
if isinstance(tag, nfc.DEP):
|
if isinstance(tag, nfc.DEP):
|
||||||
if arg_uuid is None:
|
if arg_uuid is None:
|
||||||
wps_handover_init(tag)
|
wps_handover_init(tag)
|
||||||
|
elif arg_uuid is "ap":
|
||||||
|
wps_handover_resp(tag, None)
|
||||||
else:
|
else:
|
||||||
wps_handover_resp(tag, arg_uuid)
|
wps_handover_resp(tag, arg_uuid)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue