]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Allow local channel list to be set
authorJouni Malinen <jouni@codeaurora.org>
Thu, 6 Feb 2020 21:22:39 +0000 (23:22 +0200)
committerJouni Malinen <jouni@codeaurora.org>
Sat, 8 Feb 2020 05:19:53 +0000 (07:19 +0200)
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 <jouni@codeaurora.org>
wpa_supplicant/examples/dpp-nfc.py

index 9aaff9247ebb585bdd67c7b3df3c10b82d1e090e..9e8561d440686e9e42ba77b18648e4b3d8ce2b59 100755 (executable)
@@ -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