@@ -504,21 +504,21 @@ def connect_AP(self, ssid, password, timeout_s=10): # pylint: disable=invalid-na
504
504
raise RuntimeError ("No such ssid" , ssid )
505
505
raise RuntimeError ("Unknown error 0x%02X" % stat )
506
506
507
- def create_AP (self , ssid , password , channel = 1 , timeout_s = 10 ): # pylint: disable=invalid-name
507
+ def create_AP (self , ssid , password , channel = 1 , timeout = 10 ): # pylint: disable=invalid-name
508
508
"""
509
509
Create an access point with the given name, password, and channel.
510
510
Will wait until specified timeout seconds and return on success
511
511
or raise an exception on failure.
512
512
513
- :param ssid: the SSID of the created Access Point. Must be 8 or more characters
514
- :param passphrase : the password of the created Access Point. Must be 8 or more characters .
515
- :param channel: channel of created Access Point (1 - 14).
516
- :param timeout_s : number of seconds until we time out and fail to create AP
513
+ :param str ssid: the SSID of the created Access Point. Must be less than 32 chars.
514
+ :param str password : the password of the created Access Point. Must be 8-63 chars .
515
+ :param int channel: channel of created Access Point (1 - 14).
516
+ :param int timeout : number of seconds until we time out and fail to create AP
517
517
"""
518
- if len (ssid ) < 8 :
519
- raise RuntimeError ("ssid must be 8 more more characters" )
520
- if len (password ) < 8 :
521
- raise RuntimeError ("password must be 8 or more characters" )
518
+ if len (ssid ) > 32 :
519
+ raise RuntimeError ("ssid must be no more than 32 characters" )
520
+ if len (password ) < 8 or len ( password ) < 64 :
521
+ raise RuntimeError ("password must be 8 - 63 characters" )
522
522
if channel < 1 or channel > 14 :
523
523
raise RuntimeError ("channel must be between 1 and 14" )
524
524
@@ -534,7 +534,7 @@ def create_AP(self, ssid, password, channel=1, timeout_s=10): # pylint: disable=
534
534
self ._wifi_set_ap_network (ssid , channel )
535
535
536
536
times = time .monotonic ()
537
- while (time .monotonic () - times ) < timeout_s : # wait up until timeout
537
+ while (time .monotonic () - times ) < timeout : # wait up to timeout
538
538
stat = self .status
539
539
if stat == WL_AP_LISTENING :
540
540
return stat
0 commit comments