mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
added comment for refactor reminder
This commit is contained in:
@@ -26,7 +26,6 @@ void NetworkSettingsService::begin() {
|
|||||||
// WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); // default is FAST_SCAN, connect issues in 2.0.14
|
// WiFi.setScanMethod(WIFI_ALL_CHANNEL_SCAN); // default is FAST_SCAN, connect issues in 2.0.14
|
||||||
// WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL); // is default, no need to set
|
// WiFi.setSortMethod(WIFI_CONNECT_AP_BY_SIGNAL); // is default, no need to set
|
||||||
|
|
||||||
|
|
||||||
_fsPersistence.readFromFS();
|
_fsPersistence.readFromFS();
|
||||||
// reconfigureWiFiConnection();
|
// reconfigureWiFiConnection();
|
||||||
}
|
}
|
||||||
@@ -36,6 +35,7 @@ void NetworkSettingsService::reconfigureWiFiConnection() {
|
|||||||
if (WiFi.isConnected() && _state.ssid.length() == 0) {
|
if (WiFi.isConnected() && _state.ssid.length() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// disconnect and de-configure wifi
|
// disconnect and de-configure wifi
|
||||||
if (WiFi.disconnect(true)) {
|
if (WiFi.disconnect(true)) {
|
||||||
_stopping = true;
|
_stopping = true;
|
||||||
@@ -84,15 +84,16 @@ void NetworkSettingsService::manageSTA() {
|
|||||||
WiFi.begin(_state.ssid.c_str(), _state.password.c_str());
|
WiFi.begin(_state.ssid.c_str(), _state.password.c_str());
|
||||||
}
|
}
|
||||||
// set power after wifi is startet, fixed value for C3_V1
|
// set power after wifi is startet, fixed value for C3_V1
|
||||||
if (WiFi.isConnected()) {
|
// if (WiFi.isConnected()) {
|
||||||
#ifdef BOARD_C3_MINI_V1
|
#ifdef BOARD_C3_MINI_V1
|
||||||
// v1 needs this value, see https://github.com/emsesp/EMS-ESP32/pull/620#discussion_r993173979
|
// v1 needs this value, see https://github.com/emsesp/EMS-ESP32/pull/620#discussion_r993173979
|
||||||
WiFi.setTxPower(WIFI_POWER_8_5dBm); // https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
WiFi.setTxPower(WIFI_POWER_8_5dBm); // https://www.wemos.cc/en/latest/c3/c3_mini_1_0_0.html#about-wifi
|
||||||
#else
|
#else
|
||||||
// esp_wifi_set_max_tx_power(_state.tx_power * 4);
|
// esp_wifi_set_max_tx_power(_state.tx_power * 4);
|
||||||
WiFi.setTxPower((wifi_power_t)(_state.tx_power * 4));
|
// TODO make it dynamic
|
||||||
|
WiFi.setTxPower((wifi_power_t)(_state.tx_power * 4));
|
||||||
#endif
|
#endif
|
||||||
}
|
// }
|
||||||
} else { // not connected but STA-mode active => disconnect
|
} else { // not connected but STA-mode active => disconnect
|
||||||
reconfigureWiFiConnection();
|
reconfigureWiFiConnection();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user