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

URLStream implementation for all envionments except ESP32. More...

#include <URLStream.h>

Inheritance diagram for audio_tools::URLStream:
audio_tools::URLStreamDefault audio_tools::AbstractURLStream audio_tools::AbstractURLStream audio_tools::AudioStream audio_tools::AudioStream audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Print audio_tools::Print

Public Member Functions

 URLStream (Client &clientPar, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStream (Client &clientPar, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStream (const char *network, const char *password, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStream (const char *network, const char *password, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStream (int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStream (int readBufferSize=DEFAULT_BUFFER_SIZE)
 
virtual int available ()
 
bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="")
 
void end ()
 
virtual void flush ()
 
HttpRequesthttpRequest ()
 provides access to the HttpRequest More...
 
virtual int peek ()
 
virtual int read ()
 
virtual size_t readBytes (uint8_t *buffer, size_t length)
 
size_t write (const uint8_t *buffer, size_t size)
 
size_t write (uint8_t)
 
- Public Member Functions inherited from audio_tools::URLStreamDefault
 URLStreamDefault (Client &clientPar, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStreamDefault (const char *network, const char *password, int readBufferSize=DEFAULT_BUFFER_SIZE)
 
 URLStreamDefault (int readBufferSize=DEFAULT_BUFFER_SIZE)
 
virtual int available () override
 
virtual bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="") override
 
virtual void end () override
 
virtual void flush () override
 
virtual HttpRequesthttpRequest () override
 provides access to the HttpRequest More...
 
 operator bool ()
 
virtual int peek () override
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t length) override
 
void setPowerSave (bool ps)
 if set to true, it activates the power save mode which comes at the cost of porformance! - By default this is deactivated.
 
virtual void setTimeout (int ms)
 Defines the client timeout.
 
virtual size_t write (const uint8_t *, size_t) override
 
virtual size_t write (uint8_t) override
 
- Public Member Functions inherited from audio_tools::AbstractURLStream
int availableForWrite ()
 Writes are not supported. More...
 
virtual bool begin (const char *urlStr, const char *acceptMime=nullptr, MethodID action=GET, const char *reqMime="", const char *reqData="")=0
 
virtual void end ()=0
 
virtual HttpRequesthttpRequest ()=0
 provides access to the HttpRequest More...
 
virtual bool setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len))
 
- Public Member Functions inherited from audio_tools::AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual void end ()
 
virtual void flush () override
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual size_t readBytes (uint8_t *buffer, size_t length) STREAM_WRITE_OVERRIDE=0
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual StreamtoStreamPointer ()
 
virtual size_t write (const uint8_t *buffer, size_t size) override=0
 
- Public Member Functions inherited from audio_tools::Stream
virtual int available ()
 
virtual int peek ()
 
virtual int read ()
 
virtual size_t readBytes (uint8_t *buffer, size_t len)
 
virtual void setTimeout (size_t t)
 
- Public Member Functions inherited from audio_tools::Print
virtual int availableForWrite ()
 
virtual void flush ()
 
virtual int print (char c, PrintCharFmt spec)
 
virtual int print (const char *msg)
 
virtual int print (int number)
 
virtual int println (const char *msg="")
 
virtual size_t write (const char *buffer, size_t size)
 
virtual size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t ch)
 
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
 
virtual void setAudioInfo (AudioBaseInfo info)=0
 
virtual bool validate (AudioBaseInfo &info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Attributes

URLStreamDefaultp_urlStream =nullptr
 
BufferedTaskStream taskStream
 
- Protected Attributes inherited from audio_tools::URLStreamDefault
bool active = false
 
Clientclient =nullptr
 
WiFiClient * clientInsecure =nullptr
 
WiFiClientSecure * clientSecure =nullptr
 
int clientTimeout = URL_CLIENT_TIMEOUT
 
unsigned long handshakeTimeout = URL_HANDSHAKE_TIMEOUT
 
bool is_power_save = false
 
char * network =nullptr
 
char * password =nullptr
 
Vector< uint8_t > read_buffer {0}
 
uint16_t read_buffer_size
 
uint16_t read_pos
 
uint16_t read_size
 
HttpRequest request
 
long size
 
long total_read
 
Url url
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::URLStreamDefault
void fillBuffer ()
 
ClientgetClient (bool isSecure)
 Determines the client.
 
bool isEOS ()
 
void login ()
 
int process (MethodID action, Url &url, const char *reqMime, const char *reqData, int len=-1)
 Process the Http request and handle redirects.
 
void setTimeouts ()
 
virtual bool waitForData ()
 waits for some data - returns fals if the request has failed
 
- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 

Detailed Description

URLStream implementation for all envionments except ESP32.

URLStream implementation for the ESP32 based on a separate FreeRTOS task.

Author
Phil Schatzmann

Member Function Documentation

◆ available()

virtual int audio_tools::URLStream::available ( )
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ begin()

bool audio_tools::URLStream::begin ( const char *  urlStr,
const char *  acceptMime = nullptr,
MethodID  action = GET,
const char *  reqMime = "",
const char *  reqData = "" 
)
inlinevirtual

◆ end()

void audio_tools::URLStream::end ( )
inlinevirtual

◆ flush()

virtual void audio_tools::URLStream::flush ( )
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ httpRequest()

HttpRequest & audio_tools::URLStream::httpRequest ( )
inlinevirtual

provides access to the HttpRequest

Implements audio_tools::AbstractURLStream.

◆ peek()

virtual int audio_tools::URLStream::peek ( )
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ read()

virtual int audio_tools::URLStream::read ( )
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ readBytes()

virtual size_t audio_tools::URLStream::readBytes ( uint8_t *  buffer,
size_t  length 
)
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ write() [1/2]

size_t audio_tools::URLStream::write ( const uint8_t *  buffer,
size_t  size 
)
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.

◆ write() [2/2]

size_t audio_tools::URLStream::write ( uint8_t  )
inlinevirtual

Reimplemented from audio_tools::URLStreamDefault.


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