From 61c049da3d5b8dcf011b6ed667bc6c6a8f35f011 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 6 Feb 2020 23:22:39 +0200 Subject: [PATCH] DPP: Allow local channel list to be set The new dpp-nfc.py command line argument --chan can be used to replace the local channel list default (81/1). Signed-off-by: Jouni Malinen --- wpa_supplicant/examples/dpp-nfc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index 9aaff9247..9e8561d44 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -162,8 +162,8 @@ def wpas_get_nfc_uri(start_listen=True): wpas = wpas_connect() if wpas is None: return None - global own_id - own_id = dpp_bootstrap_gen(wpas, type="nfc-uri", chan="81/1", mac=True) + global own_id, chanlist + own_id = dpp_bootstrap_gen(wpas, type="nfc-uri", chan=chanlist, mac=True) res = wpas.request("DPP_BOOTSTRAP_GET_URI %d" % own_id).rstrip() if "FAIL" in res: return None @@ -579,6 +579,7 @@ def main(): parser.add_argument('--success', help='success file for writing success update') parser.add_argument('--device', default='usb', help='NFC device to open') + parser.add_argument('--chan', default='81/1', help='channel list') parser.add_argument('command', choices=['write-nfc-uri', 'write-nfc-hs'], nargs='?') @@ -591,6 +592,9 @@ def main(): global no_wait no_wait = args.no_wait + global chanlist + chanlist = args.chan + logging.basicConfig(level=args.loglevel) global init_on_touch