arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::AudioServer Class Reference

A simple Arduino Webserver which streams the result This class is based on the WiFiServer class. All you need to do is to provide the data with a callback method or from an Arduino Stream: in -copy> client. More...

#include <AudioServer.h>

Inheritance diagram for audio_tools::AudioServer:
audio_tools::AudioEncoderServer audio_tools::AudioWAVServer

Public Member Functions

 AudioServer (const char *network, const char *password, int port=80)
 Construct a new Audio W A V Server object. More...
 
 AudioServer (int port=80)
 Construct a new Audio W A V Server object We assume that the WiFi is already connected.
 
void begin (AudioServerDataCallback cb, const char *contentType)
 Start the server. The data must be provided by a callback method. More...
 
void begin (Stream &in, const char *contentType)
 Start the server. You need to be connected to WiFI before calling this method. More...
 
bool copy ()
 Add this method to your loop Returns true while the client is connected. (The same functionality like doLoop()) More...
 
bool doLoop ()
 Add this method to your loop Returns true while the client is connected.
 
Streamout ()
 
Streamout_ptr ()
 
void setConverter (BaseConverter< int16_t > *c)
 

Protected Member Functions

void connectWiFi ()
 
void processClient ()
 
virtual void sendReplyContent ()
 
virtual void sendReplyHeader ()
 
void setupServer (int port)
 

Protected Attributes

AudioServerDataCallback callback = nullptr
 
WiFiClient client_obj
 
const char * content_type =nullptr
 
BaseConverter< int16_t > * converter_ptr = nullptr
 
StreamCopy copier
 
Streamin = nullptr
 
char * network = nullptr
 
char * password = nullptr
 
WiFiServer server {80}
 

Detailed Description

A simple Arduino Webserver which streams the result This class is based on the WiFiServer class. All you need to do is to provide the data with a callback method or from an Arduino Stream: in -copy> client.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ AudioServer()

audio_tools::AudioServer::AudioServer ( const char *  network,
const char *  password,
int  port = 80 
)
inline

Construct a new Audio W A V Server object.

Parameters
network
password

Member Function Documentation

◆ begin() [1/2]

void audio_tools::AudioServer::begin ( AudioServerDataCallback  cb,
const char *  contentType 
)
inline

Start the server. The data must be provided by a callback method.

Parameters
cb
contentTypeMime Type of result

◆ begin() [2/2]

void audio_tools::AudioServer::begin ( Stream in,
const char *  contentType 
)
inline

Start the server. You need to be connected to WiFI before calling this method.

Parameters
in
contentTypeMime Type of result

◆ copy()

bool audio_tools::AudioServer::copy ( )
inline

Add this method to your loop Returns true while the client is connected. (The same functionality like doLoop())

Returns
true
false

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