arduino-audio-tools
|
ESPNow as Arduino Stream. More...
#include <ESPNowStream.h>
Public Member Functions | |
bool | addPeer (const char *address) |
Adds a peer to which we can send info or from which we can receive info. | |
bool | addPeer (esp_now_peer_info_t &peer) |
Adds a peer to which we can send info or from which we can receive info. | |
template<size_t size> | |
bool | addPeers (const char *(&array)[size]) |
Adds an array of. | |
int | available () override |
int | availableForWrite () override |
bool | begin () |
Initialization of ESPNow. | |
bool | begin (ESPNowStreamConfig cfg) |
Initialization of ESPNow incl WIFI. | |
ESPNowStreamConfig | defaultConfig () |
void | end () |
DeInitialization. | |
virtual void | flush () override |
float | getBufferPercent () |
provides how much the receive buffer is filled (in percent) | |
const char * | macAddress () |
Returns the mac address of the current ESP32. | |
operator bool () | |
size_t | readBytes (uint8_t *data, size_t len) override |
Reeds the data from the peers. | |
void | setReceiveCallback (esp_now_recv_cb_t cb) |
void | setSendCallback (esp_now_send_cb_t cb) |
Defines an alternative send callback. | |
size_t | write (const uint8_t *data, size_t len) override |
Writes the data - sends it to all the peers. | |
virtual size_t | write (uint8_t ch) override |
Protected Member Functions | |
wifi_interface_t | getInterface () |
bool | isEncrypted () |
const char * | mac2str (const uint8_t *array) |
void | refillReadBuffer () |
void | resetAvailableToWrite () |
bool | setup () |
Initialization. | |
void | setupReceiveBuffer () |
void | setupSemaphore () |
bool | str2mac (const char *mac, uint8_t *values) |
Static Protected Member Functions | |
static int | bufferAvailableForWrite () |
static void | default_recv_cb (const esp_now_recv_info *info, const uint8_t *data, int data_len) |
static void | default_send_cb (const uint8_t *mac_addr, esp_now_send_status_t status) |
Protected Attributes | |
int | _timeout = 10 |
volatile size_t | available_to_write = 0 |
BufferRTOS< uint8_t > | buffer {0} |
ESPNowStreamConfig | cfg |
bool | is_init = false |
esp_now_recv_cb_t | receive = default_recv_cb |
esp_now_send_cb_t | send = default_send_cb |
RingBuffer< uint8_t > | tmp_in {0} |
RingBuffer< uint8_t > | tmp_out {0} |
SemaphoreHandle_t | xSemaphore = nullptr |
ESPNow as Arduino Stream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlineoverridevirtual |
Reimplemented from BaseStream.
|
inlinevirtual |
Initialization of ESPNow.
Reimplemented from BaseStream.
|
inlinevirtual |
DeInitialization.
Reimplemented from BaseStream.
Reimplemented from Print.
Reimplemented in ResampleStream, BufferedTaskStream, and BufferedStream.
Reeds the data from the peers.
Implements BaseStream.
|
inline |
Defines the Receive Callback - Deactivates the readBytes and available() methods!
Writes the data - sends it to all the peers.
Implements BaseStream.
Reimplemented in BufferedTaskStream, and BufferedStream.