27 #ifndef __SPARK_WIRING_STREAM_H 28 #define __SPARK_WIRING_STREAM_H 30 #include "spark_wiring_string.h" 32 #include "system_tick_hal.h" 52 #ifndef DOXYGEN_DO_NOT_DOCUMENT 53 system_tick_t _timeout;
54 system_tick_t _startMillis;
73 virtual int read() = 0;
82 virtual int peek() = 0;
87 virtual void flush() = 0;
89 #ifndef DOXYGEN_DO_NOT_DOCUMENT 109 bool find(
char *target);
120 bool find(
char *target,
size_t length);
130 bool findUntil(
char *target,
char *terminator);
145 bool findUntil(
char *target,
size_t targetLen,
char *terminate,
size_t termLen);
173 size_t readBytes(
char *buffer,
size_t length);
185 size_t readBytesUntil(
char terminator,
char *buffer,
size_t length);
202 #ifndef DOXYGEN_DO_NOT_DOCUMENT String readStringUntil(char terminator)
Reads the remainder of the file into a string or until terminator is found.
Arduino/Wiring Stream Class.
Definition: spark_wiring_stream.h:49
size_t readBytesUntil(char terminator, char *buffer, size_t length)
Read chars from stream into buffer until the character terminator is found.
long parseInt()
returns the first valid (long) integer value from the current position
String readString()
Reads the remainder of the file into a string.
virtual void flush()=0
For output streams, writes any unwritten buffered data.
bool find(char *target)
Reads data from the stream until the target string is found.
size_t readBytes(char *buffer, size_t length)
Read chars from stream into buffer.
bool findUntil(char *target, char *terminator)
Reads data from the stream until the target string is found or the terminator string is found...
Class for printing to a stream or file.
Definition: spark_wiring_print.h:50
float parseFloat()
returns the first valid float value from the current position
void setTimeout(system_tick_t timeout)
Sets the read timeout (default: 1000 milliseconds)
Header for spark_wiring_print.c module.
virtual int read()=0
Read a byte from the stream.
virtual int peek()=0
Read a byte from the stream but do not remove it so read will return the same byte next time...
virtual int available()=0
Returns the number of a bytes available to read right now.