Jelajahi Sumber

Wifi_provisioning_mgr_test: Allow three attempts to connect to AP before concluding provisioning failure(v3.3)

Prasad Alatkar 5 tahun lalu
induk
melakukan
3a5c7700a7
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      examples/provisioning/manager/wifi_prov_mgr_test.py

+ 5 - 0
examples/provisioning/manager/wifi_prov_mgr_test.py

@@ -101,6 +101,7 @@ def test_examples_wifi_prov_mgr(env, extra_data):
         raise RuntimeError("Failed to send apply config")
 
     success = False
+    retry = 0
     while True:
         time.sleep(5)
         print("Wi-Fi connection state")
@@ -110,6 +111,10 @@ def test_examples_wifi_prov_mgr(env, extra_data):
         elif (ret == 0):
             print("Provisioning was successful")
             success = True
+        elif (ret == 3 and retry < 3):
+            retry = retry + 1
+            print("Connection failed.. retry again...: ", ret)
+            continue
         break
 
     if not success: