kopia lustrzana https://github.com/espressif/esp-idf
examples: Add Kconfig for resetting provisioning config
rodzic
49f3fba14d
commit
3ff3ea8f88
|
@ -20,4 +20,11 @@ menu "Example Configuration"
|
|||
default 1 if EXAMPLE_PROV_TRANSPORT_BLE
|
||||
default 2 if EXAMPLE_PROV_TRANSPORT_SOFTAP
|
||||
|
||||
config EXAMPLE_RESET_PROVISIONED
|
||||
bool
|
||||
default n
|
||||
prompt "Reset provisioned status of the device"
|
||||
help
|
||||
This erases the NVS to reset provisioned status of the device on every reboot.
|
||||
Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS.
|
||||
endmenu
|
||||
|
|
|
@ -185,9 +185,13 @@ void app_main(void)
|
|||
ESP_ERROR_CHECK(wifi_prov_mgr_init(config));
|
||||
|
||||
bool provisioned = false;
|
||||
#ifdef CONFIG_EXAMPLE_RESET_PROVISIONED
|
||||
wifi_prov_mgr_reset_provisioning();
|
||||
#else
|
||||
/* Let's find out if the device is provisioned */
|
||||
ESP_ERROR_CHECK(wifi_prov_mgr_is_provisioned(&provisioned));
|
||||
|
||||
#endif
|
||||
/* If device is not yet provisioned start provisioning service */
|
||||
if (!provisioned) {
|
||||
ESP_LOGI(TAG, "Starting provisioning");
|
||||
|
|
Ładowanie…
Reference in New Issue