Skip to content

Commit

Permalink
Hiding debugging again
Browse files Browse the repository at this point in the history
  • Loading branch information
SRGDamia1 committed Apr 6, 2017
1 parent ed6fb6d commit 468f49c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@
# Extras
extras/docs/*

.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json
platformio.ini
lib/readme.txt
49 changes: 21 additions & 28 deletions TinyGsmClientSIM800.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef TinyGsmClientSIM800_h
#define TinyGsmClientSIM800_h

#define TINY_GSM_DEBUG Serial
//#define TINY_GSM_USE_HEX
// #define TINY_GSM_DEBUG Serial
// #define TINY_GSM_USE_HEX

#if !defined(TINY_GSM_RX_BUFFER)
#define TINY_GSM_RX_BUFFER 64
Expand Down Expand Up @@ -568,12 +568,12 @@ class GsmClient : public Client
#ifdef TINY_GSM_USE_HEX
while (stream.available() < 2) {}
char buf[4] = { 0, };
buf[0] = streamRead(); DBG(buf[0]);
buf[1] = streamRead(); DBG(buf[1]);
buf[0] = streamRead();
buf[1] = streamRead();
char c = strtol(buf, NULL, 16);
#else
while (!stream.available()) {}
char c = streamRead(); DBG(c);
char c = streamRead(); // DBG(c);
#endif
sockets[mux]->rx.put(c);
}
Expand Down Expand Up @@ -615,31 +615,24 @@ class GsmClient : public Client
streamWrite(tail...);
}

int streamRead() {
// int r = stream.read();
// if (String((char)r) == GSM_NL || String((char)r) == "\n"){
// DBG((char)r, " ");
// } else DBG((char)r);
// return r;
return stream.read();
}
int streamRead() { return stream.read(); }

String streamReadUntil(char c) {
String return_string = stream.readStringUntil(c);
return_string.trim();
if (String(c) == GSM_NL || String(c) == "\n"){
DBG(return_string, c, " ");
} else DBG(return_string, c);
// if (String(c) == GSM_NL || String(c) == "\n"){
// DBG(return_string, c, " ");
// } else DBG(return_string, c);
return return_string;
}

bool streamSkipUntil(char c) { //TODO: timeout
String skipped = stream.readStringUntil(c);
skipped.trim();
if (skipped.length()) {
if (String(c) == GSM_NL || String(c) == "\n"){
DBG(skipped, c, " ");
} else DBG(skipped, c);
// if (String(c) == GSM_NL || String(c) == "\n"){
// DBG(skipped, c, " ");
// } else DBG(skipped, c);
return true;
} else return false;
}
Expand Down Expand Up @@ -717,15 +710,15 @@ class GsmClient : public Client
}
data = "";
}
else {
data.trim();
data.replace(GSM_NL GSM_NL, GSM_NL);
data.replace(GSM_NL, GSM_NL " ");
if (data.length()) {
DBG(GSM_NL, "<<< ", data);
}
data = "";
}
// else {
// data.trim();
// data.replace(GSM_NL GSM_NL, GSM_NL);
// data.replace(GSM_NL, GSM_NL " ");
// if (data.length()) {
// DBG(GSM_NL, "<<< ", data);
// }
// data = "";
// }
if (gotData) {
sockets[mux]->sock_available = modemGetAvailable(mux);
}
Expand Down
2 changes: 1 addition & 1 deletion TinyGsmCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <TinyGsmFifo.h>

#ifndef TINY_GSM_YIELD
#define TINY_GSM_YIELD() { delay(2); }
#define TINY_GSM_YIELD() { delay(0); }
#endif

#if defined(__AVR__)
Expand Down

0 comments on commit 468f49c

Please sign in to comment.