From 25cfc6f11ee0f3d20d69e466598651692e3dcc8f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 12 Feb 2014 12:45:07 +0200 Subject: [PATCH] P2P NFC: Add p2p-nfc.py --handover-only option p2p-nfc.py allowed an NFC Tag to be read and reported to wpa_supplicant even in cases where it was explicitly asked to initiate negotiated connection handover and return after completing this operation. The new command line argument can be used to disable NFC Tag read operations when a negotiated connection handover is expected. Signed-hostap: Jouni Malinen --- wpa_supplicant/examples/p2p-nfc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wpa_supplicant/examples/p2p-nfc.py b/wpa_supplicant/examples/p2p-nfc.py index 03d1a2711..585029ba1 100755 --- a/wpa_supplicant/examples/p2p-nfc.py +++ b/wpa_supplicant/examples/p2p-nfc.py @@ -511,6 +511,8 @@ def main(): help='do not use stdout input to initiate handover') parser.add_argument('--tag-read-only', '-t', action='store_true', help='tag read only (do not allow connection handover)') + parser.add_argument('--handover-only', action='store_true', + help='connection handover only (do not allow tag read)') parser.add_argument('--freq', '-f', help='forced frequency of operating channel in MHz') parser.add_argument('command', choices=['write-p2p-sel'], @@ -564,6 +566,11 @@ def main(): if args.tag_read_only: if not clf.connect(rdwr={'on-connect': rdwr_connected}): break + elif args.handover_only: + if not clf.connect(llcp={'on-startup': llcp_startup, + 'on-connect': llcp_connected}, + terminate=terminate_loop): + break else: if not clf.connect(rdwr={'on-connect': rdwr_connected}, llcp={'on-startup': llcp_startup,