@@ -57,14 +57,18 @@ class Stream : public Print
57
57
void setTimeout (unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
58
58
59
59
bool find (char *target); // reads data from the stream until the target string is found
60
+ bool find (uint8_t *target) { return find ((char *)target); }
60
61
// returns true if target string is found, false if timed out (see setTimeout)
61
62
62
63
bool find (char *target, size_t length); // reads data from the stream until the target string of given length is found
64
+ bool find (uint8_t *target, size_t length) { return find ((char *)target, length); }
63
65
// returns true if target string is found, false if timed out
64
66
65
67
bool findUntil (char *target, char *terminator); // as find but search ends if the terminator string is found
68
+ bool findUntil (uint8_t *target, char *terminator) { return findUntil ((char *)target, terminator); }
66
69
67
70
bool findUntil (char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found
71
+ bool findUntil (uint8_t *target, size_t targetLen, char *terminate, size_t termLen) {return findUntil ((char *)target, targetLen, terminate, termLen); }
68
72
69
73
70
74
long parseInt (); // returns the first valid (long) integer value from the current position.
@@ -74,10 +78,12 @@ class Stream : public Print
74
78
float parseFloat (); // float version of parseInt
75
79
76
80
size_t readBytes ( char *buffer, size_t length); // read chars from stream into buffer
81
+ size_t readBytes ( uint8_t *buffer, size_t length) { return readBytes ((char *)buffer, length); }
77
82
// terminates if length characters have been read or timeout (see setTimeout)
78
83
// returns the number of characters placed in the buffer (0 means no valid data found)
79
84
80
85
size_t readBytesUntil ( char terminator, char *buffer, size_t length); // as readBytes with terminator character
86
+ size_t readBytesUntil ( char terminator, uint8_t *buffer, size_t length) { return readBytesUntil (terminator, (char *)buffer, length); }
81
87
// terminates if length characters have been read, timeout, or if the terminator character detected
82
88
// returns the number of characters placed in the buffer (0 means no valid data found)
83
89
0 commit comments