aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-11-29 10:59:26 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-27 20:08:14 (GMT)
commitc209dd11080de6defb048450fe0474dcf70d10ca (patch)
treed1bfbc09c4e6a161c372cac01bd14a8e9460beac /wpa_supplicant/examples
parent6202500f6fb8d871b3cf3e6249cfc9f0e8c89316 (diff)
downloadhostap-c209dd11080de6defb048450fe0474dcf70d10ca.zip
hostap-c209dd11080de6defb048450fe0474dcf70d10ca.tar.gz
hostap-c209dd11080de6defb048450fe0474dcf70d10ca.tar.bz2
WPS NFC: nfcpy script to use new connection handover design
Fetch a carrier record from wpa_supplicant instead of full handover request. This makes it easier for external programs to build handover request messages with multiple alternative carriers. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/examples')
-rwxr-xr-xwpa_supplicant/examples/wps-nfc.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py
index c349b46..5946512 100755
--- a/wpa_supplicant/examples/wps-nfc.py
+++ b/wpa_supplicant/examples/wps-nfc.py
@@ -10,7 +10,6 @@ import os
import sys
import time
import random
-import StringIO
import threading
import argparse
@@ -164,16 +163,11 @@ def wps_handover_init(llc):
print "Could not get handover request carrier record from wpa_supplicant"
return
print "Handover request carrier record from wpa_supplicant: " + data.encode("hex")
- record = nfc.ndef.Record()
- f = StringIO.StringIO(data)
- record._read(f)
- record = nfc.ndef.HandoverCarrierRecord(record)
- print "Parsed handover request carrier record:"
- print record.pretty()
message = nfc.ndef.HandoverRequestMessage(version="1.2")
message.nonce = random.randint(0, 0xffff)
- message.add_carrier(record, "active")
+ datamsg = nfc.ndef.Message(data)
+ message.add_carrier(datamsg[0], "active", datamsg[1:])
print "Handover request:"
print message.pretty()