Fixed const getter which should be non const to access client api

This commit is contained in:
Mathieu Carbou
2024-10-01 10:55:14 +02:00
parent 3971bbd442
commit a0ff86e76d
2 changed files with 5 additions and 1 deletions

View File

@@ -463,6 +463,10 @@ void loop() {
}
if (now - lastWS >= deltaWS) {
ws.printfAll("kp%.4f", (10.0 / 3.0));
// ws.getClients
for (auto& client : ws.getClients()) {
client.text("kp%.4f", (10.0 / 3.0));
}
lastWS = millis();
}
}

View File

@@ -351,7 +351,7 @@ class AsyncWebSocket : public AsyncWebHandler {
AsyncWebSocketMessageBuffer* makeBuffer(size_t size = 0);
AsyncWebSocketMessageBuffer* makeBuffer(const uint8_t* data, size_t size);
const std::list<AsyncWebSocketClient>& getClients() const { return _clients; }
std::list<AsyncWebSocketClient>& getClients() { return _clients; }
};
// WebServer response to authenticate the socket and detach the tcp client from the web server request