mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-02-24 20:53:07 +01:00
Fix for GwWifi
This commit is contained in:
@@ -131,33 +131,20 @@ void GwWifi::loop(){
|
||||
if (lastConnectStart > now || (lastConnectStart + RETRY_MILLIS) < now)
|
||||
{
|
||||
LOG_DEBUG(GwLog::LOG,"wifiClient: retry connect to %s", wifiSSID->asCString());
|
||||
<<<<<<< HEAD
|
||||
|
||||
// CRITICAL SECTION: WiFi-Operationen müssen serialisiert werden
|
||||
if (acquireMutex()){
|
||||
WiFi.disconnect();
|
||||
WiFi.disconnect(true);
|
||||
delay(300);
|
||||
esp_wifi_stop();
|
||||
delay(100);
|
||||
esp_wifi_start();
|
||||
releaseMutex();
|
||||
connectInternal();
|
||||
}
|
||||
else{
|
||||
LOG_DEBUG(GwLog::ERROR,"GwWifi: mutex timeout in loop");
|
||||
}
|
||||
=======
|
||||
|
||||
//+++++++++ Old part +++++++++++++++++++++
|
||||
// WiFi.disconnect();
|
||||
// connectInternal();
|
||||
//++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
//+++++++++ New part +++++++++++++++++++++
|
||||
WiFi.disconnect(true);
|
||||
delay(300);
|
||||
esp_wifi_stop();
|
||||
delay(100);
|
||||
esp_wifi_start();
|
||||
connectInternal();
|
||||
//++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
>>>>>>> autopilot2
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -178,6 +165,7 @@ void GwWifi::loop(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool GwWifi::clientConnected(){
|
||||
// CRITICAL SECTION: WiFi.status() muss geschützt werden
|
||||
if (!acquireMutex()){
|
||||
@@ -188,6 +176,7 @@ bool GwWifi::clientConnected(){
|
||||
releaseMutex();
|
||||
return result;
|
||||
};
|
||||
|
||||
bool GwWifi::connectClient(){
|
||||
// CRITICAL SECTION: Disconnect und Connect müssen atomar sein
|
||||
if (!acquireMutex()){
|
||||
|
||||
Reference in New Issue
Block a user