added wifi connection and menu showing connection details
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#ifndef WIFI_CONNECTION_H
|
||||
#define WIFI_CONNECTION_H
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <IPAddress.h>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user