aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-02-10 16:42:43 (GMT)
committerJouni Malinen <j@w1.fi>2013-02-10 16:42:43 (GMT)
commitb8dbc5d6891ab33eb11b40cc03749602ebe84288 (patch)
treefd9bc7fa6f44d416250df7c020aca81f80ef0b5a /wpa_supplicant/examples
parentbbaaaee17193abdebb862d43f3d7541906005eec (diff)
downloadhostap-b8dbc5d6891ab33eb11b40cc03749602ebe84288.zip
hostap-b8dbc5d6891ab33eb11b40cc03749602ebe84288.tar.gz
hostap-b8dbc5d6891ab33eb11b40cc03749602ebe84288.tar.bz2
WPS: Report only the carrier record from NFC to wpa_supplicant
Since there could be multiple carrier records, it is cleaner to report only the WPS carrier record instead of full NFC connection handover select to wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/examples')
-rwxr-xr-xwpa_supplicant/examples/wps-nfc.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py
index a2e8df4..1ab59c3 100755
--- a/wpa_supplicant/examples/wps-nfc.py
+++ b/wpa_supplicant/examples/wps-nfc.py
@@ -115,10 +115,25 @@ def wps_handover_init(peer):
nfc.llcp.shutdown()
client.close()
return
+ if message.type != "urn:nfc:wkt:Hs":
+ print "Response was not Hs - received: " + message.type
+ nfc.llcp.shutdown()
+ client.close()
+ return
+ print "Received message"
+ print message.pretty()
+ message = nfc.ndef.HandoverSelectMessage(message)
print "Handover select received"
print message.pretty()
- wpas_put_handover_sel(message)
+
+ for carrier in message.carriers:
+ print "Remote carrier type: " + carrier.type
+ if carrier.type == "application/vnd.wfa.wsc":
+ print "WPS carrier type match - send to wpa_supplicant"
+ wpas_put_handover_sel(carrier.record)
+ wifi = nfc.ndef.WifiConfigRecord(carrier.record)
+ print wifi.pretty()
print "Remove peer"
nfc.llcp.shutdown()