From: Jouni Malinen Date: Fri, 29 Nov 2013 10:59:26 +0000 (+0200) Subject: WPS NFC: nfcpy script to use new connection handover design X-Git-Tag: hostap_2_1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c209dd11080de6defb048450fe0474dcf70d10ca;p=thirdparty%2Fhostap.git 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 --- diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py index c349b4698..5946512d9 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()