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

@@ -169,9 +169,9 @@ public:
String remoteIP() TINY_GSM_ATTR_NOT_IMPLEMENTED;
private:
TinyGsmXBee* at;
uint8_t mux;
bool sock_connected;
TinyGsmXBee* at;
uint8_t mux;
bool sock_connected;
};
//============================================================================//
@@ -430,18 +430,6 @@ public:
return SIM_READY; // unsupported
}
String getOperator() {
if (!commandMode()) return ""; // Return immediately
sendAT(GF("MN"));
String res = readResponse();
exitCommand();
return res;
}
/*
* Generic network functions
*/
RegStatus getRegistrationStatus() {
if (!commandMode()) return REG_UNKNOWN; // Return immediately
@@ -514,6 +502,17 @@ public:
exitCommand();
return stat;
}
String getOperator() {
if (!commandMode()) return ""; // Return immediately
sendAT(GF("MN"));
String res = readResponse();
exitCommand();
return res;
}
/*
* Generic network functions
*/
int getSignalQuality() {
if (!commandMode()) return 0; // Return immediately
@@ -543,21 +542,6 @@ public:
return false;
}
String getLocalIP() {
if (!commandMode()) return ""; // Return immediately
sendAT(GF("MY"));
String IPaddr; IPaddr.reserve(16);
// wait for the response - this response can be very slow
IPaddr = readResponse(30000);
exitCommand();
IPaddr.trim();
return IPaddr;
}
IPAddress localIP() {
return TinyGsmIpFromString(getLocalIP());
}
/*
* WiFi functions
*/
@@ -593,6 +577,21 @@ fail:
return res;
}
String getLocalIP() {
if (!commandMode()) return ""; // Return immediately
sendAT(GF("MY"));
String IPaddr; IPaddr.reserve(16);
// wait for the response - this response can be very slow
IPaddr = readResponse(30000);
exitCommand();
IPaddr.trim();
return IPaddr;
}
IPAddress localIP() {
return TinyGsmIpFromString(getLocalIP());
}
/*
* GPRS functions
*/