tinyhttp
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tinyhttp::ExtensionStream Class Reference

Extension which implements the Arduino Stream functionality. Instead of writing to Serial you can write to a ExtensionStream object and look at the streamed output in your web browser. The data is managed with the help of a simple ring buffer. More...

#include <ExtensionStream.h>

Inheritance diagram for tinyhttp::ExtensionStream:
tinyhttp::Stream tinyhttp::Extension tinyhttp::ExtensionLoggingStream

Public Member Functions

 ExtensionStream (const char *url, const char *mime, Stream &source)
 Alternative way to provide data by reading from another stream.
 
 ExtensionStream (const char *url, TinyMethodID action, const char *mime, const char *startHtml=nullptr, const char *endHtml=nullptr, int bufferSize=256, int historySize=1024)
 Default Constructor.
 
int available ()
 
int availableForWrite ()
 
void flush ()
 
virtual bool isOpen ()
 Checks if we have any open clients.
 
virtual void open (HttpServer *server)
 
int peek ()
 
size_t print (const char str[])
 
size_t println (const char str[])
 
int read ()
 
int read (char *str, int len)
 
void setReplyHeader (Str &header)
 Defines a standard reply header - which can be binary data.
 
size_t write (uint8_t *str, int len)
 
size_t write (uint8_t chr)
 
- Public Member Functions inherited from tinyhttp::Stream
virtual void print (const char *str="")=0
 
virtual void println (const char *str="")=0
 
virtual void write (const char *str, int len)=0
 

Protected Member Functions

void copyFromAltSource ()
 
virtual void doLoop () override
 

Protected Attributes

int bufferSize
 
ExtensionStreamBasicext =nullptr
 
bool is_open =false
 
HttpStreamedMultiOutputout =nullptr
 
StreampAltSource =nullptr
 
RingBufferringBuffer =nullptr
 

Detailed Description

Extension which implements the Arduino Stream functionality. Instead of writing to Serial you can write to a ExtensionStream object and look at the streamed output in your web browser. The data is managed with the help of a simple ring buffer.


The documentation for this class was generated from the following file: