#ifndef WIFI_CONNECTION_H #define WIFI_CONNECTION_H #include #include struct WifiConnectionInfo { bool shieldAvailable; bool connected; IPAddress ipAddress; }; class WifiConnection { public: WifiConnection(); void begin(unsigned long now); void update(unsigned long now); WifiConnectionInfo info() const; bool consumeDirty(); private: void connect(unsigned long now); void recordStatus(); unsigned long nextAttempt_; bool shieldAvailable_; bool connected_; IPAddress ipAddress_; bool dirty_; }; #endif