Check websocket connection

This commit is contained in:
Christoph Hagen
2023-11-03 14:33:22 +01:00
parent 5fc450ee63
commit 684df16eb1
5 changed files with 10 additions and 12 deletions

View File

@ -52,7 +52,7 @@ constexpr uint32_t wifiReconnectInterval = 10000;
/* Local server */
// The port for the local server to directly receive messages over WiFi
constexpr uint16_t localWebServerPort = 80;
constexpr uint16_t localPort = 80;
/* Server */

View File

@ -55,6 +55,8 @@ public:
void connect();
void disconnect();
void loop();
/**
@ -66,16 +68,13 @@ public:
void sendResponse(uint8_t* buffer, uint16_t length);
bool isSocketConnected() {
return socketIsConnected;
return webSocket.isConnected();
}
private:
ServerConfiguration configuration;
// Indicator that the socket is connected.
bool socketIsConnected = false;
ServerConnectionCallbacks* controller = NULL;
// WebSocket to connect to the control server