Small fixes
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user