forked from espressif/arduino-esp32
Initial IDF-4.0 port
SmartConfig and ETH need some work to adapt to the new API
This commit is contained in:
@ -687,7 +687,12 @@ bool WiFiSTAClass::beginSmartConfig() {
|
||||
esp_wifi_disconnect();
|
||||
|
||||
esp_err_t err;
|
||||
#ifdef ESP_IDF_VERSION_MAJOR
|
||||
smartconfig_start_config_t conf = SMARTCONFIG_START_CONFIG_DEFAULT();
|
||||
err = esp_smartconfig_start(&conf);
|
||||
#else
|
||||
err = esp_smartconfig_start(reinterpret_cast<sc_callback_t>(&WiFiSTAClass::_smartConfigCallback), 1);
|
||||
#endif
|
||||
if (err == ESP_OK) {
|
||||
_smartConfigStarted = true;
|
||||
_smartConfigDone = false;
|
||||
@ -734,6 +739,7 @@ const char * sc_type_strings[] = {
|
||||
#endif
|
||||
|
||||
void WiFiSTAClass::_smartConfigCallback(uint32_t st, void* result) {
|
||||
#ifndef ESP_IDF_VERSION_MAJOR //todo
|
||||
smartconfig_status_t status = (smartconfig_status_t) st;
|
||||
log_d("Status: %s", sc_status_strings[st % 5]);
|
||||
if (status == SC_STATUS_GETTING_SSID_PSWD) {
|
||||
@ -757,4 +763,5 @@ void WiFiSTAClass::_smartConfigCallback(uint32_t st, void* result) {
|
||||
}
|
||||
WiFi.stopSmartConfig();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user