Browse Source

Removed everything but cleaning up the debugging

v_master
SRGDamia1 7 years ago
parent
commit
d06031a89c
4 changed files with 12 additions and 21 deletions
  1. +1
    -3
      TinyGsmClientA6.h
  2. +2
    -3
      TinyGsmClientESP8266.h
  3. +2
    -3
      TinyGsmClientSIM800.h
  4. +7
    -12
      TinyGsmClientXBee.h

+ 1
- 3
TinyGsmClientA6.h View File

@ -539,10 +539,8 @@ public:
}
private:
int modemConnect(const char* host, uint16_t port, uint8_t* mux, bool isUDP=false) {
int modemConnect(const char* host, uint16_t port, uint8_t* mux) {
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;


+ 2
- 3
TinyGsmClientESP8266.h View File

@ -370,9 +370,8 @@ public:
}
private:
int modemConnect(const char* host, uint16_t port, uint8_t mux, bool isUDP=false) {
if (isUDP) sendAT(GF("+CIPSTART="), mux, ',', GF("\"UDP"), GF("\",\""), host, GF("\","), port, GF(",120"));
else sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port, GF(",120"));
int modemConnect(const char* host, uint16_t port, uint8_t mux) {
sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port, GF(",120"));
int rsp = waitResponse(75000L,
GFP(GSM_OK),
GFP(GSM_ERROR),


+ 2
- 3
TinyGsmClientSIM800.h View File

@ -636,9 +636,8 @@ public:
}
private:
int modemConnect(const char* host, uint16_t port, uint8_t mux, bool isUDP=false) {
if (isUDP) sendAT(GF("+CIPSTART="), mux, ',', GF("\"UDP"), GF("\",\""), host, GF("\","), port);
else sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port);
int modemConnect(const char* host, uint16_t port, uint8_t mux) {
sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port);
int rsp = waitResponse(75000L,
GF("CONNECT OK" GSM_NL),
GF("CONNECT FAIL" GSM_NL),


+ 7
- 12
TinyGsmClientXBee.h View File

@ -465,16 +465,16 @@ public:
}
private:
int modemConnect(const char* host, uint16_t port, uint8_t mux = 1, bool isUDP=false) {
int modemConnect(const char* host, uint16_t port, uint8_t mux = 1) {
sendAT(GF("LA"), host);
String ipadd; ipadd.reserve(16);
ipadd = streamReadUntil('\r');
IPAddress ip;
ip.fromString(ipadd);
return modemConnect(ip, port, mux, isUDP);
return modemConnect(ip, port);
}
int modemConnect(IPAddress ip, uint16_t port, uint8_t mux = 1, bool isUDP=false) {
int modemConnect(IPAddress ip, uint16_t port, uint8_t mux = 1) {
String host; host.reserve(16);
host += ip[0];
host += ".";
@ -483,16 +483,11 @@ private:
host += ip[2];
host += ".";
host += ip[3];
if (isUDP) {
sendAT(GF("IP"), 0); // Put in UDP mode
waitResponse();
} else {
sendAT(GF("IP"), 1); // Put in TCP mode
waitResponse();
}
sendAT(GF("DL"), host);
sendAT(GF("IP"), 1); // Put in TCP mode
waitResponse();
sendAT(GF("DL"), host); // Set the "Destination Address Low"
waitResponse();
sendAT(GF("DE"), String(port, HEX));
sendAT(GF("DE"), String(port, HEX)); // Set the destination port
int rsp = waitResponse();
return rsp;
}


Loading…
Cancel
Save