Moved stream write and stream skip into common
This commit is contained in:
@@ -736,29 +736,6 @@ public:
|
||||
Utilities
|
||||
*/
|
||||
|
||||
template<typename T>
|
||||
void streamWrite(T last) {
|
||||
stream.print(last);
|
||||
}
|
||||
|
||||
template<typename T, typename... Args>
|
||||
void streamWrite(T head, Args... tail) {
|
||||
stream.print(head);
|
||||
streamWrite(tail...);
|
||||
}
|
||||
|
||||
bool streamSkipUntil(char c, const unsigned long timeout = 1000L) {
|
||||
unsigned long startMillis = millis();
|
||||
while (millis() - startMillis < timeout) {
|
||||
while (millis() - startMillis < timeout && !stream.available()) {
|
||||
TINY_GSM_YIELD();
|
||||
}
|
||||
if (stream.read() == c)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void sendAT(Args... cmd) {
|
||||
streamWrite("AT", cmd..., GSM_NL);
|
||||
|
Reference in New Issue
Block a user