-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWiFiManager.h
More file actions
29 lines (24 loc) · 912 Bytes
/
Copy pathWiFiManager.h
File metadata and controls
29 lines (24 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef WiFiManager_h
#define WiFiManager_h
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiMulti.h>
#include "Config.h"
// ============================================================
// WiFiManager — wraps WiFiMulti to connect to the strongest
// known AP. Networks are provisioned in Config.h.
// ============================================================
class WiFiManager {
public:
WiFiManager();
bool begin(); // register provisioned networks with WiFiMulti
bool connect(); // bring up the best available known network
bool disconnect(); // drop the link (call before recording starts)
bool isConnected() const { return WiFi.status() == WL_CONNECTED; }
String currentSSID() const { return WiFi.SSID(); }
String localIP() const { return WiFi.localIP().toString(); }
private:
WiFiMulti _wifiMulti;
bool _begun;
};
#endif