Added pin sleep, removed FIFO
This commit is contained in:
		@@ -50,7 +50,6 @@ public:
 | 
				
			|||||||
class GsmClient : public Client
 | 
					class GsmClient : public Client
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  friend class TinyGsm;
 | 
					  friend class TinyGsm;
 | 
				
			||||||
  typedef TinyGsmFifo<uint8_t, TINY_GSM_RX_BUFFER> RxFifo;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
  GsmClient() {}
 | 
					  GsmClient() {}
 | 
				
			||||||
@@ -72,7 +71,6 @@ public:
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
  virtual int connect(const char *host, uint16_t port) {
 | 
					  virtual int connect(const char *host, uint16_t port) {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    rx.clear();
 | 
					 | 
				
			||||||
    at->commandMode();
 | 
					    at->commandMode();
 | 
				
			||||||
    sock_connected = at->modemConnect(host, port, mux);
 | 
					    sock_connected = at->modemConnect(host, port, mux);
 | 
				
			||||||
    at->writeChanges();
 | 
					    at->writeChanges();
 | 
				
			||||||
@@ -82,7 +80,6 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  virtual int connect(IPAddress ip, uint16_t port) {
 | 
					  virtual int connect(IPAddress ip, uint16_t port) {
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    rx.clear();
 | 
					 | 
				
			||||||
    at->commandMode();
 | 
					    at->commandMode();
 | 
				
			||||||
    sock_connected = at->modemConnect(ip, port, mux);
 | 
					    sock_connected = at->modemConnect(ip, port, mux);
 | 
				
			||||||
    at->writeChanges();
 | 
					    at->writeChanges();
 | 
				
			||||||
@@ -132,7 +129,6 @@ private:
 | 
				
			|||||||
  TinyGsm*      at;
 | 
					  TinyGsm*      at;
 | 
				
			||||||
  uint8_t       mux;
 | 
					  uint8_t       mux;
 | 
				
			||||||
  bool          sock_connected;
 | 
					  bool          sock_connected;
 | 
				
			||||||
  RxFifo        rx;
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
@@ -149,11 +145,11 @@ public:
 | 
				
			|||||||
    commandMode();
 | 
					    commandMode();
 | 
				
			||||||
    sendAT(GF("AP0"));  // Put in transparent mode
 | 
					    sendAT(GF("AP0"));  // Put in transparent mode
 | 
				
			||||||
    waitResponse();
 | 
					    waitResponse();
 | 
				
			||||||
    sendAT(GF("GTFA")); // shorten the guard time to 250ms
 | 
					    sendAT(GF("GTC8")); // shorten the guard time to 200ms
 | 
				
			||||||
    waitResponse();
 | 
					    waitResponse();
 | 
				
			||||||
    writeChanges();
 | 
					    writeChanges();
 | 
				
			||||||
    exitCommand();
 | 
					    exitCommand();
 | 
				
			||||||
    guardTime = 300;
 | 
					    guardTime = 225;
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -197,6 +193,16 @@ public:
 | 
				
			|||||||
    return false;;
 | 
					    return false;;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void setupPinSleep() {
 | 
				
			||||||
 | 
					    commandMode();
 | 
				
			||||||
 | 
					    sendAT(GF("SM"),1);
 | 
				
			||||||
 | 
					    waitResponse();
 | 
				
			||||||
 | 
					    sendAT(GF("SO"),200);
 | 
				
			||||||
 | 
					    waitResponse();
 | 
				
			||||||
 | 
					    writeChanges();
 | 
				
			||||||
 | 
					    exitCommand();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /*
 | 
					  /*
 | 
				
			||||||
   * SIM card & Networ Operator functions
 | 
					   * SIM card & Networ Operator functions
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user