P2P NFC: Add p2p-nfc.py --handover-only option
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 12 Feb 2014 10:45:07 +0000 (12:45 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 12 Feb 2014 10:45:07 +0000 (12:45 +0200)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/examples/p2p-nfc.py

index 03d1a27..585029b 100755 (executable)
@@ -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,