1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 11:20:19 +00:00

Changes to support keeping multiple Browser Clients in sync

This commit is contained in:
MartinMueller2003
2023-11-09 11:06:44 -05:00
parent 85ccff0ee0
commit 00841ce32d
8 changed files with 81 additions and 86 deletions

View File

@ -193,7 +193,7 @@ public:
void jsonDom(uint16_t startidx, AsyncWebSocketClient* client = nullptr, bool Updating = false);
Verbosity verbosity = Verbosity::Quiet;
uint32_t GetNextControlChangeId();
// emulate former extended callback API by using an intermediate lambda (no deprecation)
uint16_t addControl(ControlType type, const char* label, const String& value, ControlColor color, uint16_t parentControl, std::function<void(Control*, int, void*)> callback, void* userData)
{
@ -255,12 +255,12 @@ protected:
#define ClientUpdateType_t ESPUIclient::ClientUpdateType_t
void NotifyClients(ClientUpdateType_t newState);
void NotifyClient(uint32_t WsClientId, ClientUpdateType_t newState);
void ClearControlUpdateFlags();
bool SendJsonDocToWebSocket(ArduinoJson::DynamicJsonDocument& document, uint16_t clientId);
std::map<uint32_t, ESPUIclient*> MapOfClients;
uint32_t ControlChangeID = 0;
};
extern ESPUIClass ESPUI;