aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-02-24 08:57:06 (GMT)
committerJouni Malinen <j@w1.fi>2013-02-24 08:57:06 (GMT)
commitf23ce1f0320a86ed0f002044152230fbe52c1d3b (patch)
tree2e849e155b59131762ee7404a9f74eda95a45141 /wpa_supplicant/examples
parentf3f2ba2e6ef3d33cf76b8ac4d828c1417357424e (diff)
downloadhostap-f23ce1f0320a86ed0f002044152230fbe52c1d3b.zip
hostap-f23ce1f0320a86ed0f002044152230fbe52c1d3b.tar.gz
hostap-f23ce1f0320a86ed0f002044152230fbe52c1d3b.tar.bz2
WPS: Add AP mode NFC connection handover with wpa_supplicant/nfcpy
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/examples')
-rwxr-xr-xwpa_supplicant/examples/wps-nfc.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py
index 2d54cd2..9a6da5f 100755
--- a/wpa_supplicant/examples/wps-nfc.py
+++ b/wpa_supplicant/examples/wps-nfc.py
@@ -86,6 +86,8 @@ def wpas_get_handover_sel(uuid):
wpas = wpas_connect()
if (wpas == 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")
@@ -133,7 +135,10 @@ class HandoverServer(nfc.handover.HandoverServer):
def wps_handover_resp(peer, uuid):
- print "Trying to handle WPS handover with AP " + uuid
+ if uuid is None:
+ print "Trying to handle WPS handover"
+ else:
+ print "Trying to handle WPS handover with AP " + uuid
srv = HandoverServer()
srv.sent_carrier = None
@@ -375,6 +380,8 @@ def main():
if isinstance(tag, nfc.DEP):
if arg_uuid is None:
wps_handover_init(tag)
+ elif arg_uuid is "ap":
+ wps_handover_resp(tag, None)
else:
wps_handover_resp(tag, arg_uuid)
continue