mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	Added getSignalQuality for ESP8266
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -219,7 +219,7 @@ public:
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * SIM card & Networ Operator functions
 | 
			
		||||
   * SIM card & Network Operator functions
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  bool simUnlock(const char *pin) {  // Not supported
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user