-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathConnectionManager.h
More file actions
50 lines (31 loc) · 997 Bytes
/
ConnectionManager.h
File metadata and controls
50 lines (31 loc) · 997 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
ConnectionManager.h - Handle basic configuration data
Saul bertuccio 11 feb 2017
Released into the public domain.
*/
#ifndef ConnectionManager_h
#define ConnectionManager_h
#include "ESP8266WiFi.h"
#include "WString.h"
#include "WifiNetworks.h"
const char AP_SSID[] PROGMEM = "esp8266_remote\0";
const char AP_PASS[] PROGMEM = "administrator\0";
const int CONN_ATTEMPT = 10;
class ConnectionManager {
public:
static void initConnection();
static boolean isApMode();
static IPAddress getStationIpAddress();
static IPAddress getIpAddress();
static String getSsid();
static String getPassword();
static WifiNetworks getNetworkList();
static String encryptionCodeToString(int code);
static boolean connectWifi(String ssid, String pass, bool force);
static boolean isIp(String str);
private:
ConnectionManager();
static void setupAp(String ssid, String pass);
static int waitForConnection(bool use_timeout);
};
#endif