-
Notifications
You must be signed in to change notification settings - Fork 0
/
rz_wifi.h
68 lines (52 loc) · 1.37 KB
/
rz_wifi.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
TITLE:
rz_wifi.h
BRIEF:
library
DESC:
Arduino library for ESP32 for etablsihing WiFi network
SOURCE:
https://github.com/Zheng-Bote/ESP32_libs
SYNTAX:
#include "ESP32/rz_wifi.h"
RZ_WiFi *wifi = new RZ_WiFi(char *ssid, char *password);
bool wifi->startWiFi();
IPAddress wifi->getIpAddr();
bool wifi->startMDNS(std::string hostId);
RETURN:
void
HISTORY:
Version | Date | Developer | Comments
------- | ---------- | ---------------- | ---------------------------------------------------------------
0.1.0 | 2019-10-27 | RZheng | created
0.3.0 | 2022-02-26 | RZheng | modified
1.0.0 | 2022-02-27 | RZheng | finalized
1.1.0 | 2022-03-19 | RZheng | Constructor for manual WiFi or WiFiManager
*/
#ifndef rz_wifi_h
#define rz_wifi_h
#include "Arduino.h"
class RZ_WiFi {
public:
// for WiFiMananger
RZ_WiFi();
// for manual WiFi
RZ_WiFi(char *ssid, char *password);
bool startWiFi();
IPAddress getIpAddr();
bool startMDNS(std::string hostId);
private:
char *_ssid;
char *_pwd;
int _counter;
IPAddress _ipAddr;
std::string _mdnsHost;
~RZ_WiFi() {
}
};
#endif
/*
WL_CONNECTION_LOST: assigned when the connection is lost;
WL_DISCONNECTED: assigned when disconnected from a network;
https://www.arduino.cc/en/Reference/WiFiClientAvailable
*/