|
arduino-audio-tools
|
A UDP class which makes sure that we can use UDP as AudioSource and AudioSink. By default the WiFiUDP object is used and we login to wifi if the ssid and password is provided and we are not already connected. More...
#include <UDPStream.h>
Public Member Functions | |
| UDPStream ()=default | |
| Default Constructor. | |
| UDPStream (const char *ssid, const char *password) | |
| Convinience constructor which defines the optional ssid and password. | |
| UDPStream (UDP &udp) | |
| Constructor which defines an alternative UDP object. By default we use WiFiUDP. | |
| int | available () override |
| int | availableForWrite () |
| virtual bool | begin () |
| bool | begin (IPAddress a, uint16_t port) |
| Starts to send data to the indicated address / port. | |
| bool | begin (uint16_t port, uint16_t port_ext=0) |
| Starts to receive data from/with the indicated port. | |
| bool | beginMulticast (IPAddress address, uint16_t port) |
| Starts to receive data in multicast from/with the indicated address / port. | |
| virtual void | end () |
| virtual void | flush () override |
| operator bool () | |
| size_t | readBytes (uint8_t *data, size_t len) override |
| Reads bytes using WiFi::readBytes. | |
| IPAddress | remoteIP () |
| We use the same remote ip as defined in begin for write. | |
| uint16_t | remotePort () |
| We use the same remote port as defined in begin for write. | |
| void | setPassword (const char *pwd) |
| void | setSSID (const char *ssid) |
| void | setUDP (UDP &udp) |
| Defines an alternative UDP object. By default we use WiFiUDP. | |
| void | setWriteBufferSize (int size) |
| size_t | write (const uint8_t *data, size_t len) override |
| Replys will be sent to the initial remote caller. | |
| virtual size_t | write (uint8_t ch) override |
Protected Member Functions | |
| void | connect () |
| connect to WIFI if necessary | |
| void | printIP () |
| void | refillReadBuffer () |
| Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read() | |
Protected Attributes | |
| int | _timeout = 10 |
| WiFiUDP | default_udp |
| UDP * | p_udp = &default_udp |
| const char * | password = nullptr |
| IPAddress | remote_address_ext |
| uint16_t | remote_port_ext = 0 |
| const char * | ssid = nullptr |
| RingBuffer< uint8_t > | tmp_in {0} |
| RingBuffer< uint8_t > | tmp_out {0} |
| int | write_buffer_size = MAX_SINGLE_CHARS |
A UDP class which makes sure that we can use UDP as AudioSource and AudioSink. By default the WiFiUDP object is used and we login to wifi if the ssid and password is provided and we are not already connected.
|
default |
Default Constructor.
Convinience constructor which defines the optional ssid and password.
| ssid | |
| password |
Constructor which defines an alternative UDP object. By default we use WiFiUDP.
| udp |
|
inlineoverridevirtual |
Provides the available size of the current package and if this is used up of the next package
Reimplemented from BaseStream.
|
inlinevirtual |
Always return 1492 (MTU 1500 - 8 byte header) as UDP packet available to write
Reimplemented from BaseStream.
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 >.
Starts to send data to the indicated address / port.
Starts to receive data from/with the indicated port.
Starts to receive data in multicast from/with the indicated address / port.
|
inlineprotected |
connect to WIFI if necessary
Reimplemented in FaustStream< DSP >, AudioMP34DT05, I2SCodecStream, MozziStream, PureDataStream, SPDIFOutput, VS1053Stream, WM8960Stream, AdaptiveResamplingStream, AudioLoRa, ESPNowStream, BufferedTaskStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, Equalizer3Bands, I2SStream, AudioStreamWrapper, TimerCallbackAudioStream, FormatConverterStream, GoertzelStream, FileLoopT< FileType >, FileLoopT< File >, EqualizerNBands< SampleT, AccT, NUM_TAPS, NUM_BANDS >, LoRaStream, EncodedAudioStream, AudioFFTBase, AudioKitStream, MiniAudioStream, PortAudioStream, StdioStream, A2DPStream, HLSStreamT< URLStream >, HttpRequest, ICYStreamT< T >, URLStream, URLStreamESP32, AnalogAudioArduino, AnalogAudioStream, AudioEffectStreamT< T >, Equalizer3BandsPerChannel, ReformatBaseStream, AdapterAudioOutputToAudioStream, MemoryStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, InputMixer< T >, InputMerge< T >, CallbackStream, FilteredStream< T, TF >, FilteredStream< int16_t, int16_t >, ChannelFormatConverterStream, NumberFormatConverterStream, CatStream, QueueStream< T >, QueueStream< uint8_t >, DynamicMemoryStream, Pipeline, Pipeline::ModifyingStreamAdapter, VolumeStream, AudioBLEClient, AudioBLEClient, AudioBLEServer, AudioBLEServer, AbstractURLStream, and AudioBLEStream.
Reimplemented from Print.
Reimplemented in PureDataStream, URLStreamBufferedT< T >, URLStreamBufferedT< ICYStream >, AudioStreamWrapper, ResampleStream, URLStream, BufferedTaskStream, I2SStream, MemoryStream, RingBufferStream, GeneratedSoundStream< T >, GeneratedSoundStream< int16_t >, and BufferedStream.
|
inlineprotected |
Reads bytes using WiFi::readBytes.
Implements BaseStream.
|
inlineprotectedinherited |
Refill small read buffer (e.g. 8 bytes) to avoid single byte reads when calling read()
|
inline |
We use the same remote ip as defined in begin for write.
|
inline |
We use the same remote port as defined in begin for write.
Defines an alternative UDP object. By default we use WiFiUDP.
| udp |
Replys will be sent to the initial remote caller.
Implements BaseStream.
Reimplemented in MemoryStream, AudioStreamWrapper, BufferedTaskStream, RingBufferStream, BufferedStream, and URLStream.
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |