added an overlay to the WebUI and some ConnectionHandling
This commit is contained in:
@@ -797,8 +797,9 @@ void SystemShutdown(bool restart)
|
||||
// Check if the shutdown delay has elapsed
|
||||
if (shutdown_delay < millis())
|
||||
{
|
||||
// Store configuration and persistence data to EEPROM
|
||||
StoreConfig_EEPROM();
|
||||
Webserver_Shutdown();
|
||||
|
||||
// Store persistence data to EEPROM
|
||||
StorePersistence_EEPROM();
|
||||
|
||||
// Perform restart if requested, otherwise enter an indefinite loop
|
||||
|
@@ -118,6 +118,26 @@ void Webserver_Process()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Shuts down the web server functionality for the ChainLube application.
|
||||
*
|
||||
* This function closes all WebSocket connections and terminates the web server. It is intended
|
||||
* to be called when the application is being shut down or when there is a need to deactivate the
|
||||
* web server.
|
||||
*
|
||||
* @details This function ensures a graceful shutdown of the web server by closing all active
|
||||
* WebSocket connections and ending the web server instance.
|
||||
*
|
||||
* @note This function should be called before shutting down the application to properly
|
||||
* deactivate the web server.
|
||||
*/
|
||||
void Webserver_Shutdown()
|
||||
{
|
||||
if (webSocket.count() > 0)
|
||||
webSocket.closeAll();
|
||||
webServer.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback function for handling HTTP 404 (Not Found) errors on the web server.
|
||||
*
|
||||
@@ -757,7 +777,7 @@ void parseWebsocketString(char *data, char *identifierBuffer, size_t identifierB
|
||||
* @param searchString The string to search for in the array.
|
||||
* @param array The array of strings to search within.
|
||||
* @param arraySize The size of the array.
|
||||
*
|
||||
*
|
||||
* @return The index of the first occurrence of the string in the array,
|
||||
* or -1 if the string is not found.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user