mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
esp_prov: Refactor to use new 'wait_wifi_connected' function
Means all provisioning examples will have the same retry behaviour.
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
from __future__ import print_function
|
||||
import re
|
||||
import os
|
||||
import time
|
||||
|
||||
import ttfw_idf
|
||||
import esp_prov
|
||||
@@ -96,19 +95,7 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||
if not esp_prov.apply_wifi_config(transport, security):
|
||||
raise RuntimeError("Failed to send apply config")
|
||||
|
||||
success = False
|
||||
while True:
|
||||
time.sleep(5)
|
||||
print("Wi-Fi connection state")
|
||||
ret = esp_prov.get_wifi_config(transport, security)
|
||||
if (ret == "connecting"):
|
||||
continue
|
||||
elif (ret == "connected"):
|
||||
print("Provisioning was successful")
|
||||
success = True
|
||||
break
|
||||
|
||||
if not success:
|
||||
if not esp_prov.wait_wifi_connected(transport, security):
|
||||
raise RuntimeError("Provisioning failed")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user