File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -114,18 +114,15 @@ def wait_for_join(dut:IdfDut, role:str) -> bool:
114114def joinWiFiNetwork (dut :IdfDut , wifi :wifi_parameter ) -> Tuple [str , int ]:
115115 clean_buffer (dut )
116116 ip_address = ''
117- information = ''
118117 for order in range (1 , wifi .retry_times ):
119118 command = 'wifi connect -s ' + str (wifi .ssid ) + ' -p ' + str (wifi .psk )
120119 tmp = get_ouput_string (dut , command , 10 )
121120 if 'sta ip' in str (tmp ):
122121 ip_address = re .findall (r'sta ip: (\w+.\w+.\w+.\w+),' , str (tmp ))[0 ]
123- if 'wifi sta' in str (tmp ):
124- information = re .findall (r'wifi sta (\w+ \w+ \w+)\W' , str (tmp ))[0 ]
125- if information == 'is connected successfully' :
126- break
127- assert information == 'is connected successfully'
128- return ip_address , order
122+ execute_command (dut , 'wifi state' )
123+ if dut .expect ('\n connected\r ' , timeout = 5 ):
124+ return ip_address , order
125+ raise Exception (f'{ dut } connect wifi { str (wifi .ssid )} with password { str (wifi .psk )} fail' )
129126
130127
131128def getDeviceRole (dut :IdfDut ) -> str :
You can’t perform that action at this time.
0 commit comments