ESPNow as Arduino Stream. When use_send_ack is true we prevent any buffer overflows by blocking writes until the previous packet has been confirmed. When no acknowledgments are used, you might need to throttle the send speed to prevent any buffer overflow on the receiver side.
More...
|
|
ESPNowStreamConfig | defaultConfig () |
| |
|
const char * | macAddress () |
| | Returns the mac address of the current ESP32.
|
| |
|
void | setSendCallback (esp_now_send_cb_t cb) |
| | Defines an alternative send callback.
|
| |
| void | setReceiveCallback (esp_now_recv_cb_t cb) |
| |
| bool | begin () |
| | Initialization of ESPNow.
|
| |
|
virtual bool | begin (ESPNowStreamConfig cfg) |
| | Initialization of ESPNow incl WIFI.
|
| |
| virtual void | end () |
| | DeInitialization.
|
| |
|
void | setChannel (uint8_t ch) |
| | Defines the WiFi Channel.
|
| |
|
uint8_t | getChannel () |
| | Provies the WiFi Channel.
|
| |
|
bool | addPeer (esp_now_peer_info_t &peer) |
| | Adds a peer to which we can send info or from which we can receive info.
|
| |
|
bool | addPeer (const uint8_t *address) |
| | Adds a peer to which we can send info or from which we can receive info.
|
| |
|
bool | addPeer (const char *address) |
| | 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 peers.
|
| |
|
template<size_t N> |
| bool | addPeers (const uint8_t(&array)[N][6]) |
| | Adds an array of peers.
|
| |
| bool | addBroadcastPeer () |
| |
|
bool | clearPeers () |
| | Deletes all registered peers.
|
| |
| size_t | write (const uint8_t *data, size_t len) override |
| | Writes the data - sends it to all registered peers.
|
| |
|
size_t | write (const char *peer, const uint8_t *data, size_t len) |
| | Writes the data - sends it to all the indicated peer mac address string.
|
| |
|
size_t | write (const uint8_t *peer, const uint8_t *data, size_t len) |
| | Writes the data - sends it to all the peers.
|
| |
| size_t | readBytes (uint8_t *data, size_t len) override |
| | Reeds the data from the peers.
|
| |
| int | available () override |
| |
| int | availableForWrite () override |
| |
|
float | getBufferPercent () |
| | provides how much the receive buffer is filled (in percent)
|
| |
|
BufferRTOS< uint8_t > & | getBuffer () |
| | provides access to the receive buffer
|
| |
|
uint32_t | getLastIoSuccessTime () const |
| | time when we were able to send or receive the last packet successfully
|
| |
|
| BaseStream (BaseStream &)=default |
| |
|
BaseStream & | operator= (BaseStream &)=default |
| |
| virtual bool | begin () |
| |
| virtual void | end () |
| |
| virtual size_t | readBytes (uint8_t *data, size_t len) STREAM_READ_OVERRIDE=0 |
| |
| virtual size_t | write (const uint8_t *data, size_t len) override=0 |
| |
|
virtual size_t | write (uint8_t ch) override |
| |
| virtual int | available () |
| |
| virtual int | availableForWrite () |
| |
|
virtual void | flush () override |
| |
|
virtual size_t | readBytes (char *data, size_t len) STREAM_READCHAR_OVERRIDE |
| |
|
virtual int | read () override |
| |
|
virtual int | peek () override |
| |
|
void | setWriteBufferSize (int size) |
| |
|
|
bool | setupMAC () |
| |
|
bool | setupWiFi () |
| |
|
void | setupSemaphore () |
| |
|
void | setupReceiveBuffer () |
| |
|
void | resetAvailableToWrite () |
| |
|
virtual bool | sendPacket (const uint8_t *data, size_t len, int &retry_count, const uint8_t *destination=nullptr) |
| | Sends a single packet with retry logic.
|
| |
|
bool | handleTransmissionResult (int &retry_count) |
| | Handles the result of packet transmission (after queuing)
|
| |
|
bool | handleQueueError (esp_err_t rc, int &retry_count) |
| | Handles errors when queuing packets.
|
| |
|
bool | isEncrypted () |
| |
|
wifi_interface_t | getInterface () |
| |
|
bool | setup () |
| | Initialization.
|
| |
|
bool | str2mac (const char *mac, uint8_t *values) |
| |
|
const char * | mac2str (const uint8_t *array) |
| |
|
virtual void | handle_recv_cb (const uint8_t *mac_addr, const uint8_t *data, int data_len, bool broadcast, uint8_t rssi) |
| |
|
virtual void | handle_send_cb (const uint8_t *mac_addr, esp_now_send_status_t status) |
| |
|
void | refillReadBuffer () |
| |
ESPNow as Arduino Stream. When use_send_ack is true we prevent any buffer overflows by blocking writes until the previous packet has been confirmed. When no acknowledgments are used, you might need to throttle the send speed to prevent any buffer overflow on the receiver side.
- Note
- If multiple receivers are in range, only the first one which sends an acknowledgment will be used as coordinator.
- Author
- Phil Schatzmann