diff --git a/Software/src/devboard/wifi/wifi.cpp b/Software/src/devboard/wifi/wifi.cpp index 92346553..fe5d2591 100644 --- a/Software/src/devboard/wifi/wifi.cpp +++ b/Software/src/devboard/wifi/wifi.cpp @@ -76,10 +76,6 @@ void init_wireless(void) { xTaskCreate(wifi_taskfunction, "Wifi task", 1024 * 8, NULL, 1, NULL); } -bool wifi_is_connected(void) { - return WiFi.status() == WL_CONNECTED; -} - void wifi_taskfunction(void* pvParameters) { init_wifi(); init_webserver(); @@ -87,8 +83,10 @@ void wifi_taskfunction(void* pvParameters) { while (true) { wifi_reconnect(); - webserver_loop(); - mqtt_loop(); + if(WiFi.status() == WL_CONNECTED) { + webserver_loop(); + mqtt_loop(); + } delay(1); } } diff --git a/Software/src/devboard/wifi/wifi.h b/Software/src/devboard/wifi/wifi.h index 0eaf7110..5f2072f1 100644 --- a/Software/src/devboard/wifi/wifi.h +++ b/Software/src/devboard/wifi/wifi.h @@ -15,15 +15,6 @@ extern const char* passwordAP; */ void init_wireless(void); -/** - * @brief Returns the WiFi connections status - * - * @param[in] void - * - * @return bool: true = connected, false = disconnected - */ -bool wifi_is_connected(void); - /** * @brief FreeRTOS taskfunction *