@@ -325,7 +325,7 @@ def _send_command_get_response(
325
325
* ,
326
326
reply_params = 1 ,
327
327
sent_param_len_16 = False ,
328
- recv_param_len_16 = False
328
+ recv_param_len_16 = False ,
329
329
):
330
330
"""Send a high level SPI command, wait and return the response"""
331
331
self ._send_command (cmd , params , param_len_16 = sent_param_len_16 )
@@ -563,17 +563,23 @@ def connect(self, secrets):
563
563
that contains a 'ssid' and 'password' entry"""
564
564
self .connect_AP (secrets ["ssid" ], secrets ["password" ])
565
565
566
- def connect_AP (self , ssid , password , timeout_s = 10 ): # pylint: disable=invalid-name
566
+ def connect_AP (
567
+ self , ssid , password , timeout_s = 10 , show_password = False
568
+ ): # pylint: disable=invalid-name
567
569
"""Connect to an access point with given name and password.
568
570
Will wait until specified timeout seconds and return on success
569
571
or raise an exception on failure.
570
572
571
573
:param ssid: the SSID to connect to
572
574
:param passphrase: the password of the access point
573
575
:param timeout_s: number of seconds until we time out and fail to create AP
576
+ :param show_password: print password if debug == True (default False)
574
577
"""
575
578
if self ._debug :
576
- print ("Connect to AP" , ssid , password )
579
+ print (
580
+ f"Connect to AP: { ssid = } , password=\
581
+ { repr (password if show_password else '*' * len (password ))} "
582
+ )
577
583
if isinstance (ssid , str ):
578
584
ssid = bytes (ssid , "utf-8" )
579
585
if password :
0 commit comments