Hiding debugging again
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -21,3 +21,9 @@
|
|||||||
# Extras
|
# Extras
|
||||||
extras/docs/*
|
extras/docs/*
|
||||||
|
|
||||||
|
.pioenvs
|
||||||
|
.piolibdeps
|
||||||
|
.clang_complete
|
||||||
|
.gcc-flags.json
|
||||||
|
platformio.ini
|
||||||
|
lib/readme.txt
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
#ifndef TinyGsmClientSIM800_h
|
#ifndef TinyGsmClientSIM800_h
|
||||||
#define TinyGsmClientSIM800_h
|
#define TinyGsmClientSIM800_h
|
||||||
|
|
||||||
#define TINY_GSM_DEBUG Serial
|
// #define TINY_GSM_DEBUG Serial
|
||||||
//#define TINY_GSM_USE_HEX
|
// #define TINY_GSM_USE_HEX
|
||||||
|
|
||||||
#if !defined(TINY_GSM_RX_BUFFER)
|
#if !defined(TINY_GSM_RX_BUFFER)
|
||||||
#define TINY_GSM_RX_BUFFER 64
|
#define TINY_GSM_RX_BUFFER 64
|
||||||
@@ -568,12 +568,12 @@ private:
|
|||||||
#ifdef TINY_GSM_USE_HEX
|
#ifdef TINY_GSM_USE_HEX
|
||||||
while (stream.available() < 2) {}
|
while (stream.available() < 2) {}
|
||||||
char buf[4] = { 0, };
|
char buf[4] = { 0, };
|
||||||
buf[0] = streamRead(); DBG(buf[0]);
|
buf[0] = streamRead();
|
||||||
buf[1] = streamRead(); DBG(buf[1]);
|
buf[1] = streamRead();
|
||||||
char c = strtol(buf, NULL, 16);
|
char c = strtol(buf, NULL, 16);
|
||||||
#else
|
#else
|
||||||
while (!stream.available()) {}
|
while (!stream.available()) {}
|
||||||
char c = streamRead(); DBG(c);
|
char c = streamRead(); // DBG(c);
|
||||||
#endif
|
#endif
|
||||||
sockets[mux]->rx.put(c);
|
sockets[mux]->rx.put(c);
|
||||||
}
|
}
|
||||||
@@ -615,21 +615,14 @@ private:
|
|||||||
streamWrite(tail...);
|
streamWrite(tail...);
|
||||||
}
|
}
|
||||||
|
|
||||||
int streamRead() {
|
int streamRead() { return stream.read(); }
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
String streamReadUntil(char c) {
|
String streamReadUntil(char c) {
|
||||||
String return_string = stream.readStringUntil(c);
|
String return_string = stream.readStringUntil(c);
|
||||||
return_string.trim();
|
return_string.trim();
|
||||||
if (String(c) == GSM_NL || String(c) == "\n"){
|
// if (String(c) == GSM_NL || String(c) == "\n"){
|
||||||
DBG(return_string, c, " ");
|
// DBG(return_string, c, " ");
|
||||||
} else DBG(return_string, c);
|
// } else DBG(return_string, c);
|
||||||
return return_string;
|
return return_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,9 +630,9 @@ private:
|
|||||||
String skipped = stream.readStringUntil(c);
|
String skipped = stream.readStringUntil(c);
|
||||||
skipped.trim();
|
skipped.trim();
|
||||||
if (skipped.length()) {
|
if (skipped.length()) {
|
||||||
if (String(c) == GSM_NL || String(c) == "\n"){
|
// if (String(c) == GSM_NL || String(c) == "\n"){
|
||||||
DBG(skipped, c, " ");
|
// DBG(skipped, c, " ");
|
||||||
} else DBG(skipped, c);
|
// } else DBG(skipped, c);
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
@@ -717,15 +710,15 @@ private:
|
|||||||
}
|
}
|
||||||
data = "";
|
data = "";
|
||||||
}
|
}
|
||||||
else {
|
// else {
|
||||||
data.trim();
|
// data.trim();
|
||||||
data.replace(GSM_NL GSM_NL, GSM_NL);
|
// data.replace(GSM_NL GSM_NL, GSM_NL);
|
||||||
data.replace(GSM_NL, GSM_NL " ");
|
// data.replace(GSM_NL, GSM_NL " ");
|
||||||
if (data.length()) {
|
// if (data.length()) {
|
||||||
DBG(GSM_NL, "<<< ", data);
|
// DBG(GSM_NL, "<<< ", data);
|
||||||
}
|
// }
|
||||||
data = "";
|
// data = "";
|
||||||
}
|
// }
|
||||||
if (gotData) {
|
if (gotData) {
|
||||||
sockets[mux]->sock_available = modemGetAvailable(mux);
|
sockets[mux]->sock_available = modemGetAvailable(mux);
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
#include <TinyGsmFifo.h>
|
#include <TinyGsmFifo.h>
|
||||||
|
|
||||||
#ifndef TINY_GSM_YIELD
|
#ifndef TINY_GSM_YIELD
|
||||||
#define TINY_GSM_YIELD() { delay(2); }
|
#define TINY_GSM_YIELD() { delay(0); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__AVR__)
|
#if defined(__AVR__)
|
||||||
|
Reference in New Issue
Block a user