Removed extra check for connection in available.
This commit is contained in:
		@@ -112,7 +112,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size();
 | 
					    return rx.size();
 | 
				
			||||||
@@ -191,7 +191,7 @@ public:
 | 
				
			|||||||
    if (waitResponse() != 1) {
 | 
					    if (waitResponse() != 1) {
 | 
				
			||||||
      return false;
 | 
					      return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    sendAT(GF("+CMEE=0"));  // Turn of verbose errors
 | 
					    sendAT(GF("+CMEE=0"));  // Turn off verbose errors
 | 
				
			||||||
    waitResponse();
 | 
					    waitResponse();
 | 
				
			||||||
    sendAT(GF("+CMER=3,0,0,2"));  // Set unsolicited result code output destination
 | 
					    sendAT(GF("+CMER=3,0,0,2"));  // Set unsolicited result code output destination
 | 
				
			||||||
    waitResponse();
 | 
					    waitResponse();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,7 +112,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size() + sock_available;
 | 
					    return rx.size() + sock_available;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,7 +109,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size();
 | 
					    return rx.size();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,7 +112,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size() + sock_available;
 | 
					    return rx.size() + sock_available;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -116,7 +116,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size() + sock_available;
 | 
					    return rx.size() + sock_available;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -118,11 +118,11 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      // Workaround: sometimes SIM800 forgets to notify about data arrival.
 | 
					      // Workaround: sometimes SIM800 forgets to notify about data arrival.
 | 
				
			||||||
      // TODO: Currently we ping the module periodically,
 | 
					      // TODO: Currently we ping the module periodically,
 | 
				
			||||||
      // but maybe there's a better indicator that we need to poll
 | 
					      // but maybe there's a better indicator that we need to poll
 | 
				
			||||||
      if (millis() - prev_check > 500) {
 | 
					      if (millis() - prev_check > 250) {
 | 
				
			||||||
        got_data = true;
 | 
					        got_data = true;
 | 
				
			||||||
        prev_check = millis();
 | 
					        prev_check = millis();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -147,7 +147,7 @@ public:
 | 
				
			|||||||
      // Workaround: sometimes SIM800 forgets to notify about data arrival.
 | 
					      // Workaround: sometimes SIM800 forgets to notify about data arrival.
 | 
				
			||||||
      // TODO: Currently we ping the module periodically,
 | 
					      // TODO: Currently we ping the module periodically,
 | 
				
			||||||
      // but maybe there's a better indicator that we need to poll
 | 
					      // but maybe there's a better indicator that we need to poll
 | 
				
			||||||
      if (millis() - prev_check > 500)  {
 | 
					      if (millis() - prev_check > 250)  {
 | 
				
			||||||
        got_data = true;
 | 
					        got_data = true;
 | 
				
			||||||
        prev_check = millis();
 | 
					        prev_check = millis();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -110,7 +110,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int available() {
 | 
					  virtual int available() {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    if (!rx.size() && sock_connected) {
 | 
					    if (!rx.size()) {
 | 
				
			||||||
      at->maintain();
 | 
					      at->maintain();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return rx.size() + sock_available;
 | 
					    return rx.size() + sock_available;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user