Browse Source

Added getSignalQuality for ESP8266

v_master
SRGDamia1 7 years ago
parent
commit
a129331e42
2 changed files with 18 additions and 1 deletions
  1. +17
    -0
      TinyGsmClientESP8266.h
  2. +1
    -1
      TinyGsmClientXBee.h

+ 17
- 0
TinyGsmClientESP8266.h View File

@ -203,6 +203,20 @@ public:
return autoBaud();
}
/*
* SIM card & Network Operator functions
*/
int getSignalQuality() {
sendAT(GF("+CWLAP=\""), _ssid, GF("\""));
String res1 = stream.readStringUntil(':');
DBG(GSM_NL, res1, ':');
String res2 = stream.readStringUntil(',');
DBG(res2);
waitResponse();
return res2.toInt();
}
bool waitForNetwork(unsigned long timeout = 60000L) {
for (unsigned long start = millis(); millis() - start < timeout; ) {
sendAT(GF("+CIPSTATUS"));
@ -224,6 +238,8 @@ public:
*/
bool networkConnect(const char* ssid, const char* pwd) {
_ssid = ssid;
sendAT(GF("+CIPMUX=1"));
if (waitResponse() != 1) {
return false;
@ -418,6 +434,7 @@ private:
private:
Stream& stream;
GsmClient* sockets[5];
const char* _ssid;
};
typedef TinyGsm::GsmClient TinyGsmClient;


+ 1
- 1
TinyGsmClientXBee.h View File

@ -219,7 +219,7 @@ public:
}
/*
* SIM card & Networ Operator functions
* SIM card & Network Operator functions
*/
bool simUnlock(const char *pin) { // Not supported


Loading…
Cancel
Save