mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
Totally different attempt
This commit is contained in:
@@ -476,13 +476,11 @@ public:
|
||||
while (!stream.available()) {}
|
||||
sockets[mux]->rx.put(stream.read());
|
||||
}
|
||||
data = "";
|
||||
return index;
|
||||
} else if (data.endsWith(GF("+TCPCLOSED:"))) {
|
||||
int mux = streamReadUntil(',').toInt();
|
||||
streamReadUntil('\n');
|
||||
sockets[mux]->sock_connected = false;
|
||||
data = "";
|
||||
}
|
||||
}
|
||||
} while (millis() - startMillis < timeout);
|
||||
@@ -492,7 +490,6 @@ public:
|
||||
if (data.length()) {
|
||||
DBG("### Unhandled:", data);
|
||||
}
|
||||
data = "";
|
||||
}
|
||||
else {
|
||||
data.trim();
|
||||
@@ -501,7 +498,6 @@ public:
|
||||
if (data.length()) {
|
||||
DBG(GSM_NL, "<<< ", data);
|
||||
}
|
||||
data = "";
|
||||
}
|
||||
return index;
|
||||
}
|
||||
@@ -521,8 +517,10 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
int modemConnect(const char* host, uint16_t port, uint8_t* mux) {
|
||||
int modemConnect(const char* host, uint16_t port, uint8_t* mux, bool isUDP=false) {
|
||||
sendAT(GF("+CIPSTART="), GF("\"TCP"), GF("\",\""), host, GF("\","), port);
|
||||
if (isUDP) sendAT(GF("+CIPSTART="), GF("\"UDP"), GF("\",\""), host, GF("\","), port);
|
||||
else sendAT(GF("+CIPSTART="), GF("\"TCP"), GF("\",\""), host, GF("\","), port);
|
||||
|
||||
if (waitResponse(75000L, GF(GSM_NL "+CIPNUM:")) != 1) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user