#include "Dtypes.h" #include "MessageCodes.h" #include "SwimTrackerConfig.h" #include #include class WifiManager; class WifiAPI { public: WifiAPI(WifiManager &wifiManager) : wifiManager_(wifiManager), restartScheduled_(false) { } void onClientConnect(websockets::WebsocketsClient &client) {} bool handleMessage(websockets::WebsocketsClient &client, MessageCode code, const char *payload, size_t size); template void iteration(TServer &server) { if (restartScheduled_) { Serial.print("Restart triggered by WifiAPI"); ESP.restart(); } } private: WifiManager &wifiManager_; bool restartScheduled_; };