|
arduino-audio-tools
|
URLStream using the ESP32 IDF API. More...
#include <URLStreamESP32.h>
Public Member Functions | |
| URLStreamESP32 () | |
| URLStreamESP32 (const char *ssid, const char *pwd) | |
| ~URLStreamESP32 () | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| void | addRequestHeader (const char *key, const char *value) override |
| Adds/Updates a request header. | |
| virtual AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| virtual int | available () override |
| int | availableForWrite () override |
| Writes are not supported. | |
| virtual bool | begin () |
| virtual bool | begin (const char *urlStr, const char *acceptMime="", MethodID action=GET, const char *reqMime="", const char *reqData="") |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| int | contentLength () override |
| Provides the reported data size from the http reply. | |
| virtual void | end () override |
| virtual void | flush () override |
| const char * | getReplyHeader (const char *key) override |
| Provides a header entry. | |
| HttpRequest & | httpRequest () override |
| Used for request and reply header parameters. | |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| const char * | mime () override |
| Provides the MIME type for the current stream. | |
| virtual | operator bool () |
| size_t | readBytes (uint8_t *data, size_t len) override |
| virtual size_t | readSilence (uint8_t *buffer, size_t length) |
| Source to generate silence: just sets the buffer to 0. | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| virtual void | setAudioInfo (AudioInfo newInfo) override |
| Defines the input AudioInfo. | |
| void | setCACert (const char *cert) override |
| void | setCACert (esp_err_t(*cb)(void *conf)) |
| void | setClient (Client &client) override |
| Does nothing. | |
| void | setConnectionClose (bool flag) override |
| Not used. | |
| virtual bool | setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len)) |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| virtual void | setPassword (const char *password) |
| Sets the password that will be used for logging in (when calling begin) | |
| virtual void | setPowerSave (bool ps) |
| Sets the power save mode (default false)! | |
| void | setReadBufferSize (int size) |
| Defines the read buffer size. | |
| virtual void | setSSID (const char *ssid) |
| Sets the ssid that will be used for logging in (when calling begin) | |
| void | setWriteBufferSize (int size) |
| size_t | totalRead () override |
| Total amout of data that was consumed so far. | |
| const char * | urlStr () override |
| Provides the url as string. | |
| virtual bool | waitForData (int timeout) override |
| Not used. | |
| size_t | write (const uint8_t *data, size_t len) override |
| virtual size_t | write (uint8_t ch) override |
| virtual void | writeSilence (size_t len) |
| Writes len bytes of silence (=0). | |
Protected Member Functions | |
| virtual int | not_supported (int out, const char *msg="") |
| void | notifyAudioChange (AudioInfo info) |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
| void | setCACert (const uint8_t *cert, int len) |
Static Protected Member Functions | |
| static esp_err_t | http_event_handler (esp_http_client_event_t *evt) |
Protected Attributes | |
| int | _timeout = 10 |
| int | buffer_size = DEFAULT_BUFFER_SIZE |
| esp_http_client_handle_t | client_handle = nullptr |
| int | content_length = 0 |
| esp_err_t(* | crt_bundle_attach )(void *conf) = nullptr |
| int | id = 0 |
| AudioInfo | info |
| bool | is_notify_active = true |
| bool | is_power_save = false |
| Vector< AudioInfoSupport * > | notify_vector |
| const char * | password = nullptr |
| const uint8_t * | pem_cert = nullptr |
| int | pem_cert_len = 0 |
| HttpRequest | request |
| const char * | ssid = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| size_t | total_read = 0 |
| const char * | url_str = nullptr |
| int | write_buffer_size = MAX_SINGLE_CHARS |
URLStream using the ESP32 IDF API.
For Https you need to provide the certificate. Execute: openssl s_client -showcerts -connect www.howsmyssl.com:443 </dev/null
To completely disable the certificate check, you will need to go to ESP-TLS in menuconfig, enable "Allow potentially insecure options" and then enable "Skip server certificate verification by default" (accepting risks).
This is unfortunately not an option when using Arduino!
|
inline |
|
inline |
|
inline |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
Adds/Updates a request header.
Implements AbstractURLStream.
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in JupyterAudioT< T >, MozziStream, TimerCallbackAudioStream, EncodedAudioStream, PureDataStream, AdapterAudioOutputToAudioStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and InputMerge< T >.
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
Reimplemented from Stream.
Reimplemented in AudioKitStream, AudioLoRa, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, VBANStream, AudioStreamWrapper, LoRaStream, FaustStream< DSP >, AudioFFTBase, AudioMP34DT05, I2SCodecStream, MiniAudioStream, StdioStream, TfLiteAudioStream, A2DPStream, ESPNowStream, HammingFEC< bytecount, block_t >, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, BufferedTaskStream, ReedSolomonFEC< bytecount, additional_bytes >, SPIAudioSlave, UDPStream, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, ReformatBaseStream, TimedStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, BufferedStream, ConverterStream< T >, MeasuringStream, ProgressStream, Throttle, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, FadeStream, FrequencyDetectorAutoCorrelation, FrequencyDetectorZeroCrossing, Pipeline, Pipeline::ModifyingStreamAdapter, VolumeStream, FileLoopT< FileType >, FileLoopT< File >, AudioBLEClient, AudioBLEClient, AudioBLEServer, and AudioBLEServer.
|
inlineoverridevirtual |
Writes are not supported.
Reimplemented from AbstractURLStream.
Reimplemented in AudioOutputWithCallback, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, VBANStream, AudioEffectStreamT< T >, Equalizer3Bands, Equalizer3BandsPerChannel, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FrequencyDetectorAutoCorrelation, GoertzelStream, ResampleStreamT< TInterpolator >, FileLoopT< FileType >, FileLoopT< File >, LoRaStream, EncodedAudioStream, AudioBoardStream, AudioFFTBase, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, HLSStreamT< URLStream >, AnalogAudioArduino, AnalogAudioStream, AdapterAudioOutputToAudioStream, TimedStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, MeasuringStream, ProgressStream, Throttle, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, VolumeMeter, AudioInputMonitor, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, Pipeline, Pipeline::ModifyingStreamAdapter, ResampleStream, VolumeStream, and EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >.
|
inlinevirtual |
Implements AbstractURLStream.
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineoverridevirtual |
Provides the reported data size from the http reply.
Implements AbstractURLStream.
Implements AbstractURLStream.
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, ReformatBaseStream, AudioStreamWrapper, ResampleStream, EncodedAudioStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
Provides a header entry.
Implements AbstractURLStream.
|
inlinestaticprotected |
|
inlineoverridevirtual |
Used for request and reply header parameters.
Implements AbstractURLStream.
Provides the MIME type for the current stream.
Implements MimeSource.
Reimplemented from AudioStream.
Source to generate silence: just sets the buffer to 0.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Defines the input AudioInfo.
Implements AudioInfoSupport.
Reimplemented in VS1053Stream, WM8960Stream, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, VolumeStream, MiniAudioStream, PortAudioStream, I2SCodecStream, MozziStream, SPDIFOutput, AudioLoRa, AnalogAudioStream, I2SStream, TimerCallbackAudioStream, AudioBLEStream, LoRaStream, AudioFFTBase, AudioKitStream, SPIAudioSlave, VBANStream, AnalogAudioArduino, Equalizer3Bands, Equalizer3BandsPerChannel, AdapterAudioOutputToAudioStream, TimedStream, MeasuringStream, ProgressStream, CallbackStream, VolumeMeter, AudioInputMonitor, FormatConverterStream, FadeStream, GoertzelStream, Pipeline::ModifyingStreamAdapter, MDFEchoCancellationStream< Allocator >, EncodedAudioStream, PureDataStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
Define the Root PEM Certificate for SSL: Method compatible with Arduino WiFiClientSecure API
Implements AbstractURLStream.
Define the Root PEM Certificate for SSL: the last byte must be null, the len is including the ending null
Attach and enable use of a bundle for certificate verification e.g. esp_crt_bundle_attach or arduino_esp_crt_bundle_attach
Does nothing.
Implements AbstractURLStream.
Not used.
Implements AbstractURLStream.
|
inlinevirtualinherited |
Reimplemented in ICYStreamBuffered, and ICYStreamT< T >.
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
Sets the password that will be used for logging in (when calling begin)
Implements AbstractURLStream.
Sets the power save mode (default false)!
Implements AbstractURLStream.
Sets the ssid that will be used for logging in (when calling begin)
Implements AbstractURLStream.
|
inlineoverridevirtual |
Total amout of data that was consumed so far.
Implements AbstractURLStream.
Provides the url as string.
Implements AbstractURLStream.
Not used.
Implements AbstractURLStream.
Reimplemented from AudioStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protectedinherited |