Skip to content

Commit 1b5db72

Browse files
committed
Added end function implementation
Former-commit-id: f16b845
1 parent ea17475 commit 1b5db72

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

libraries/WiFiS3/examples/AP_SimpleWebServer/AP_SimpleWebServer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ void setup() {
8181
void loop() {
8282

8383
// compare the previous status to the current status
84-
if (1/*status != WiFi.status()*/) {
84+
if (status != WiFi.status()) {
8585
// it has changed update the variable
86-
/*status = WiFi.status()*/
86+
status = WiFi.status();
8787

8888
if (status == WL_AP_CONNECTED) {
8989
// a device has connected to the AP
90-
//Serial.println("Device connected to AP");
90+
Serial.println("Device connected to AP");
9191
} else {
9292
// a device has disconnected from the AP, and we are back in listening mode
93-
//Serial.println("Device disconnected from AP");
93+
Serial.println("Device disconnected from AP");
9494
}
9595
}
9696

libraries/WiFiS3/src/WiFi.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ uint8_t CWifi::beginAP(const char *ssid, const char* passphrase, uint8_t channel
101101
/* -------------------------------------------------------------------------- */
102102
void CWifi::config(IPAddress local_ip) {
103103
/* -------------------------------------------------------------------------- */
104-
105104
IPAddress _gw(local_ip[0],local_ip[1], local_ip[2], 1);
106105
IPAddress _sm(255,255,255,0);
107106
IPAddress dns(0,0,0,0);
@@ -209,7 +208,10 @@ int CWifi::disconnect() {
209208
/* -------------------------------------------------------------------------- */
210209
void CWifi::end(void) {
211210
/* -------------------------------------------------------------------------- */
211+
string res = "";
212+
modem.begin();
212213

214+
modem.write(string(PROMPT(_SOFTRESETWIFI)),res, "%s" , CMD(_SOFTRESETWIFI));
213215
}
214216

215217

0 commit comments

Comments
 (0)