@@ -52,12 +52,25 @@ typedef enum {
52
52
} WiFiSleepType_t;
53
53
54
54
class ESP8266WiFiClass {
55
+
56
+ // ----------------------------------------------------------------------------------------------
57
+ // -------------------------------------- ESP8266WiFiClass --------------------------------------
58
+ // ----------------------------------------------------------------------------------------------
59
+
55
60
public:
61
+
56
62
ESP8266WiFiClass ();
57
63
64
+ protected:
65
+
66
+ static void _eventCallback (void *event);
67
+
58
68
// ----------------------------------------------------------------------------------------------
59
69
// ---------------------------------------- STA function ----------------------------------------
60
70
// ----------------------------------------------------------------------------------------------
71
+
72
+ public:
73
+
61
74
int begin (const char * ssid, const char *passphrase = NULL , int32_t channel = 0 , const uint8_t * bssid = NULL );
62
75
int begin (char * ssid, char *passphrase = NULL , int32_t channel = 0 , const uint8_t * bssid = NULL );
63
76
int begin ();
@@ -94,9 +107,16 @@ class ESP8266WiFiClass {
94
107
95
108
int32_t RSSI ();
96
109
110
+ protected:
111
+
112
+ bool _useStaticIp;
113
+
97
114
// ----------------------------------------------------------------------------------------------
98
115
// ----------------------------------------- AP function ----------------------------------------
99
116
// ----------------------------------------------------------------------------------------------
117
+
118
+ public:
119
+
100
120
void softAP (const char * ssid, const char * passphrase = NULL , int channel = 1 , int ssid_hidden = 0 );
101
121
void softAPConfig (IPAddress local_ip, IPAddress gateway, IPAddress subnet);
102
122
int softAPdisconnect (bool wifioff = false );
@@ -106,10 +126,14 @@ class ESP8266WiFiClass {
106
126
uint8_t * softAPmacAddress (uint8_t * mac);
107
127
String softAPmacAddress (void );
108
128
129
+ protected:
130
+
109
131
// ----------------------------------------------------------------------------------------------
110
132
// ----------------------------------------- scan function --------------------------------------
111
133
// ----------------------------------------------------------------------------------------------
112
134
135
+ public:
136
+
113
137
int8_t scanNetworks (bool async = false , bool show_hidden = false );
114
138
115
139
int8_t scanComplete ();
@@ -126,10 +150,24 @@ class ESP8266WiFiClass {
126
150
int32_t channel (uint8_t networkItem);
127
151
bool isHidden (uint8_t networkItem);
128
152
153
+ protected:
154
+
155
+ static bool _scanAsync;
156
+ static bool _scanStarted;
157
+ static bool _scanComplete;
158
+
159
+ static size_t _scanCount;
160
+ static void * _scanResult;
161
+
162
+ static void _scanDone (void * result, int status);
163
+ void * _getScanInfoByIndex (int i);
164
+
129
165
// ----------------------------------------------------------------------------------------------
130
166
// -------------------------------------- Generic WiFi function ---------------------------------
131
167
// ----------------------------------------------------------------------------------------------
132
168
169
+ public:
170
+
133
171
int32_t channel (void );
134
172
135
173
bool setSleepMode (WiFiSleepType_t type);
@@ -142,49 +180,51 @@ class ESP8266WiFiClass {
142
180
void mode (WiFiMode);
143
181
WiFiMode getMode ();
144
182
183
+ protected:
184
+ bool _useApMode;
185
+ bool _useClientMode;
186
+ bool _persistent;
187
+ void _mode (WiFiMode);
188
+
145
189
// ----------------------------------------------------------------------------------------------
146
190
// ------------------------------------ Generic Network function --------------------------------
147
191
// ----------------------------------------------------------------------------------------------
148
192
193
+ public:
194
+
149
195
int hostByName (const char * aHostname, IPAddress& aResult);
150
196
197
+ protected:
151
198
152
199
// ----------------------------------------------------------------------------------------------
153
200
// ------------------------------------ STA remote configure -----------------------------------
154
201
// ----------------------------------------------------------------------------------------------
155
202
203
+ public:
204
+
156
205
bool beginWPSConfig (void );
157
206
158
207
void beginSmartConfig ();
159
208
bool smartConfigDone ();
160
209
void stopSmartConfig ();
161
210
211
+ protected:
212
+
213
+ bool _smartConfigStarted;
214
+ bool _smartConfigDone;
215
+ static void _smartConfigCallback (uint32_t status, void * result);
162
216
163
217
// ----------------------------------------------------------------------------------------------
164
218
// ------------------------------------------- Debug --------------------------------------------
165
219
// ----------------------------------------------------------------------------------------------
166
220
221
+ public:
222
+
167
223
void printDiag (Print& dest);
168
224
169
225
friend class WiFiClient ;
170
226
friend class WiFiServer ;
171
227
172
- protected:
173
- void _mode (WiFiMode);
174
- static void _scanDone (void * result, int status);
175
- void * _getScanInfoByIndex (int i);
176
- static void _smartConfigCallback (uint32_t status, void * result);
177
- static void _eventCallback (void *event);bool _smartConfigStarted;bool _smartConfigDone;
178
-
179
- bool _useApMode;bool _useClientMode;bool _useStaticIp;bool _persistent;
180
-
181
- static bool _scanAsync;
182
- static bool _scanStarted;
183
- static bool _scanComplete;
184
-
185
- static size_t _scanCount;
186
- static void * _scanResult;
187
-
188
228
};
189
229
190
230
extern ESP8266WiFiClass WiFi;
0 commit comments