Browse Source

Clear buffer on stop(). Fix #119

v_master
Volodymyr Shymanskyy 7 years ago
parent
commit
c8d71b3b8b
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/TinyGsmClientSIM800.h

+ 3
- 0
src/TinyGsmClientSIM800.h View File

@ -72,6 +72,7 @@ public:
public:
virtual int connect(const char *host, uint16_t port) {
stop();
TINY_GSM_YIELD();
rx.clear();
sock_connected = at->modemConnect(host, port, mux);
@ -95,6 +96,7 @@ public:
at->sendAT(GF("+CIPCLOSE="), mux);
sock_connected = false;
at->waitResponse();
rx.clear();
}
virtual size_t write(const uint8_t *buf, size_t size) {
@ -191,6 +193,7 @@ public:
public:
virtual int connect(const char *host, uint16_t port) {
stop();
TINY_GSM_YIELD();
rx.clear();
sock_connected = at->modemConnect(host, port, mux, true);


Loading…
Cancel
Save