ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
espnow
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.
11
namespace
esphome::espnow::platform
{
12
13
// Bring up the station interface when no wifi component owns the radio
14
void
init_radio
();
15
void
set_channel
(uint8_t channel);
16
uint8_t
get_channel
();
17
void
read_mac
(uint8_t *mac);
18
19
// Start the driver and route its callbacks to the component
20
esp_err_t
init
();
21
esp_err_t
deinit
();
22
uint32_t
get_version
();
// 0 where the SDK has no version call
23
24
bool
peer_exists
(
const
uint8_t *mac);
25
esp_err_t
add_peer
(
const
uint8_t *mac);
26
esp_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
28
void
rebind_peers
();
29
30
esp_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
espnow_types.h
esphome::espnow::platform
Definition
espnow_platform.h:11
esphome::espnow::platform::init_radio
void init_radio()
Definition
espnow_platform_esp32.cpp:30
esphome::espnow::platform::del_peer
esp_err_t del_peer(const uint8_t *mac)
Definition
espnow_platform_esp32.cpp:87
esphome::espnow::platform::deinit
esp_err_t deinit()
Definition
espnow_platform_esp32.cpp:66
esphome::espnow::platform::send
esp_err_t send(const uint8_t *mac, const uint8_t *data, uint16_t size)
Definition
espnow_platform_esp32.cpp:92
esphome::espnow::platform::get_channel
uint8_t get_channel()
Definition
espnow_platform_esp32.cpp:46
esphome::espnow::platform::read_mac
void read_mac(uint8_t *mac)
Definition
espnow_platform_esp32.cpp:53
esphome::espnow::platform::rebind_peers
void rebind_peers()
Definition
espnow_platform_esp32.cpp:90
esphome::espnow::platform::set_channel
void set_channel(uint8_t channel)
Definition
espnow_platform_esp32.cpp:40
esphome::espnow::platform::peer_exists
bool peer_exists(const uint8_t *mac)
Definition
espnow_platform_esp32.cpp:78
esphome::espnow::platform::add_peer
esp_err_t add_peer(const uint8_t *mac)
Definition
espnow_platform_esp32.cpp:80
esphome::espnow::platform::init
esp_err_t init()
Definition
espnow_platform_esp32.cpp:55
esphome::espnow::platform::get_version
uint32_t get_version()
Definition
espnow_platform_esp32.cpp:72
esphome::espnow::esp_err_t
int32_t esp_err_t
Definition
espnow_types.h:43
esphome::size
uint16_t size
Definition
helpers.cpp:34
uint32_t
static void uint32_t
Definition
crash_handler.cpp:153
Generated by
1.12.0