ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
espnow_platform.h
Go to the documentation of this file.
1#pragma once
2
3#if defined(USE_ESP32) || defined(USE_ESP8266)
4
5#include "espnow_types.h"
6
7#include <cstdint>
8
9// The radio and ESP-NOW driver calls that differ between ESP-IDF and the ESP8266 NONOS SDK. Each platform
10// implements the whole set in its own source file, so the component itself carries no platform checks.
12
13// Bring up the station interface when no wifi component owns the radio
14void init_radio();
15void set_channel(uint8_t channel);
16uint8_t get_channel();
17void read_mac(uint8_t *mac);
18
19// Start the driver and route its callbacks to the component
22uint32_t get_version(); // 0 where the SDK has no version call
23
24bool peer_exists(const uint8_t *mac);
25esp_err_t add_peer(const uint8_t *mac);
26esp_err_t del_peer(const uint8_t *mac);
27// Move the registered peers to the radio's current channel; only the NONOS SDK binds peers to a channel
28void rebind_peers();
29
30esp_err_t send(const uint8_t *mac, const uint8_t *data, uint16_t size);
31
32} // namespace esphome::espnow::platform
33
34#endif // USE_ESP32 || USE_ESP8266
esp_err_t del_peer(const uint8_t *mac)
esp_err_t send(const uint8_t *mac, const uint8_t *data, uint16_t size)
void set_channel(uint8_t channel)
bool peer_exists(const uint8_t *mac)
esp_err_t add_peer(const uint8_t *mac)
uint16_t size
Definition helpers.cpp:34
static void uint32_t