Browse Source

Small fixes

v_master
Volodymyr Shymanskyy 8 years ago
parent
commit
14f21d7d02
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      TinyGsmClient.h

+ 2
- 2
TinyGsmClient.h View File

@ -536,11 +536,11 @@ private:
} }
int streamRead() { return stream.read(); } int streamRead() { return stream.read(); }
void streamReadAll() { while(stream.available()) { stream.read(); } }
template<typename... Args> template<typename... Args>
void sendAT(Args... cmd) { void sendAT(Args... cmd) {
streamWrite("AT", cmd..., GSM_NL); streamWrite("AT", cmd..., GSM_NL);
stream.flush();
//DBG("### AT:", cmd...); //DBG("### AT:", cmd...);
} }
@ -555,7 +555,7 @@ private:
for (unsigned long start = millis(); millis() - start < timeout; ) { for (unsigned long start = millis(); millis() - start < timeout; ) {
while (stream.available() > 0) { while (stream.available() > 0) {
int a = streamRead(); int a = streamRead();
if (a <= 0) continue;
if (a <= 0) continue; // Skip 0x00 bytes, just in case
data += (char)a; data += (char)a;
if (r1 && data.indexOf(r1) >= 0) { if (r1 && data.indexOf(r1) >= 0) {
index = 1; index = 1;


Loading…
Cancel
Save