]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Clean up debug prints with nfcpy
authorJouni Malinen <j@w1.fi>
Sun, 10 Feb 2013 14:27:59 +0000 (16:27 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Feb 2013 14:27:59 +0000 (16:27 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/examples/wps-nfc.py

index 9830a22cbb8328b3bd84f43293831bb8b58224ac..f6c9e605f68bd567e40134958fbf1daf8769f7a0 100755 (executable)
@@ -75,7 +75,8 @@ def wps_handover_init(peer):
         return
     print "Handover request from wpa_supplicant: " + data.encode("hex")
     message = nfc.ndef.Message(data)
-    print "Parsed handover request: " + message.pretty()
+    print "Parsed handover request:"
+    print message.pretty()
 
     nfc.llcp.activate(peer);
 
@@ -97,6 +98,12 @@ def wps_handover_init(peer):
 
     print "Receiving handover response"
     message = client._recv()
+    if message is None:
+        print "No response received"
+        nfc.llcp.shutdown()
+        client.close()
+        return
+
     print "Handover select received"
     print message.pretty()
     wpas_put_handover_sel(message)