Removed everything but cleaning up the debugging

This commit is contained in:
SRGDamia1
2017-05-04 15:54:15 -04:00
parent 7b0c0217d5
commit d06031a89c
4 changed files with 12 additions and 21 deletions

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;

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),

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),

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("DE"), String(port, HEX));
sendAT(GF("DL"), host); // Set the "Destination Address Low"
waitResponse();
sendAT(GF("DE"), String(port, HEX)); // Set the destination port
int rsp = waitResponse();
return rsp;
}