pfodParser 3.61.0 The pfodParser library is handles commands sent from the Android pfodApp, pfodApp supports WiFi, BLE, Bluetooth and SMS connections

pfodWaitForUtils.h
Go to the documentation of this file.
1 #ifndef pfodWaitForUtils_h
2 #define pfodWaitForUtils_h
3 /*
4 * (c)2014-2017 Forward Computing and Control Pty. Ltd.
5 * NSW Australia, www.forward.com.au
6 * This code is not warranted to be fit for any purpose. You may only use it at your own risk.
7 * This code may be freely used for both private and commercial use
8 * Provide this copyright is maintained.
9 */
10
11 #include "Arduino.h"
12
13 #include "pfodStream.h"
14
15 #define _pfodWaitForUtils_waitForTimeout 3000
16 class pfodWaitForUtils {
17 public:
18 static boolean waitFor(const __FlashStringHelper *ifsh, Stream* input, Stream* output = NULL);
19 static boolean waitFor(const __FlashStringHelper *ifsh, unsigned long timeout, Stream* input, Stream* output = NULL);
20 static boolean waitForOK(Stream* input, Stream* output = NULL);
21 static boolean waitForOK(unsigned long timeout, Stream* input, Stream* output = NULL);
22 static boolean waitFor(const char* str, Stream* input, Stream* output = NULL);
23 static boolean waitFor(const char* str, unsigned long timeout, Stream* input, Stream* output = NULL);
24 //static boolean waitFor2(const char* str1, const char* str2, unsigned long timeout, Stream* input, Stream* output = NULL );
25 static int waitFor(const char* str1, const char* str2, Stream* input, Stream* output = NULL, unsigned long timeout = 0);
26 static int waitFor(const char* str1, const char* str2, const char* str3, Stream* input, Stream* output, unsigned long _timeout );
27 static size_t captureReply(char* buffer, size_t maxLen, Stream* input, Stream* output = NULL, unsigned long timeout = 100);
28 static void dumpReply(Stream* input, Stream* output = NULL, unsigned long timeout = 100);
29 static void setWaitForTimeout(unsigned long _timeout);
30 private:
31 static unsigned long timeout;// = 3000; _pfodWaitForUtils_waitForTimeout
32 };
33 #endif // pfodWaitForUtils_h
34
pfodWaitForUtils
Definition: pfodWaitForUtils.h:16
pfodWaitForUtils::waitFor
static boolean waitFor(const char *str, Stream *input, Stream *output=NULL)
pfodWaitForUtils::dumpReply
static void dumpReply(Stream *input, Stream *output=NULL, unsigned long timeout=100)
pfodWaitForUtils::waitForOK
static boolean waitForOK(Stream *input, Stream *output=NULL)
pfodWaitForUtils::waitFor
static boolean waitFor(const __FlashStringHelper *ifsh, unsigned long timeout, Stream *input, Stream *output=NULL)
pfodWaitForUtils::setWaitForTimeout
static void setWaitForTimeout(unsigned long _timeout)
pfodWaitForUtils::waitFor
static int waitFor(const char *str1, const char *str2, Stream *input, Stream *output=NULL, unsigned long timeout=0)
pfodWaitForUtils::waitFor
static boolean waitFor(const char *str, unsigned long timeout, Stream *input, Stream *output=NULL)
pfodWaitForUtils::waitFor
static int waitFor(const char *str1, const char *str2, const char *str3, Stream *input, Stream *output, unsigned long _timeout)
pfodWaitForUtils::waitFor
static boolean waitFor(const __FlashStringHelper *ifsh, Stream *input, Stream *output=NULL)
pfodWaitForUtils::waitForOK
static boolean waitForOK(unsigned long timeout, Stream *input, Stream *output=NULL)
pfodWaitForUtils::captureReply
static size_t captureReply(char *buffer, size_t maxLen, Stream *input, Stream *output=NULL, unsigned long timeout=100)
pfodStream.h