Minor realignment with vshymanskyy

This commit is contained in:
SRGDamia1
2018-05-15 17:25:34 -04:00
parent 407f141119
commit cdcdd15a80
10 changed files with 301 additions and 306 deletions

View File

@@ -9,7 +9,7 @@
#ifndef TinyGsmClientESP8266_h
#define TinyGsmClientESP8266_h
// #define TINY_GSM_DEBUG Serial
//#define TINY_GSM_DEBUG Serial
#if !defined(TINY_GSM_RX_BUFFER)
#define TINY_GSM_RX_BUFFER 512
@@ -286,7 +286,9 @@ public:
return res;
}
bool hasSSL() { return true; }
bool hasSSL() {
return true;
}
/*
* Power functions
@@ -317,11 +319,6 @@ public:
* SIM card functions
*/
/*
* Generic network functions
*/
RegStatus getRegistrationStatus() {
sendAT(GF("+CIPSTATUS"));
if (waitResponse(3000, GF("STATUS:")) != 1) return REG_UNKNOWN;
@@ -330,6 +327,10 @@ public:
return (RegStatus)status;
}
/*
* Generic network functions
*/
int getSignalQuality() {
sendAT(GF("+CWJAP_CUR?"));
int res1 = waitResponse(GF("No AP"), GF("+CWJAP_CUR:"));
@@ -366,6 +367,25 @@ public:
return false;
}
/*
* WiFi functions
*/
bool networkConnect(const char* ssid, const char* pwd) {
sendAT(GF("+CWJAP_CUR=\""), ssid, GF("\",\""), pwd, GF("\""));
if (waitResponse(30000L, GFP(GSM_OK), GF(GSM_NL "FAIL" GSM_NL)) != 1) {
return false;
}
return true;
}
bool networkDisconnect() {
sendAT(GF("+CWQAP"));
bool retVal = waitResponse(10000L) == 1;
waitResponse(GF("WIFI DISCONNECT"));
return retVal;
}
String getLocalIP() {
sendAT(GF("+CIPSTA_CUR??"));
int res1 = waitResponse(GF("ERROR"), GF("+CWJAP_CUR:"));
@@ -381,24 +401,6 @@ public:
return TinyGsmIpFromString(getLocalIP());
}
/*
* WiFi functions
*/
bool networkConnect(const char* ssid, const char* pwd) {
sendAT(GF("+CWJAP_CUR=\""), ssid, GF("\",\""), pwd, GF("\""));
if (waitResponse(30000L, GFP(GSM_OK), GF(GSM_NL "FAIL" GSM_NL)) != 1) {
return false;
}
return true;
}
bool networkDisconnect() {
sendAT(GF("+CWQAP"));
bool retVal = waitResponse(10000L) == 1;
waitResponse(GF("WIFI DISCONNECT"));
return retVal;
}
/*
* GPRS functions
*/