ESPHome 2025.5.0
Loading...
Searching...
No Matches
wake_on_lan.h
Go to the documentation of this file.
1#pragma once
3#ifdef USE_NETWORK
6#if defined(USE_SOCKET_IMPL_BSD_SOCKETS) || defined(USE_SOCKET_IMPL_LWIP_SOCKETS)
8#else
9#include "WiFiUdp.h"
10#endif
11
12namespace esphome {
13namespace wake_on_lan {
14
16 public:
17 void set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f);
18
19 void dump_config() override;
20 void setup() override;
21 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
22
23 protected:
24#if defined(USE_SOCKET_IMPL_BSD_SOCKETS) || defined(USE_SOCKET_IMPL_LWIP_SOCKETS)
25 std::unique_ptr<socket::Socket> broadcast_socket_{};
26#else
27 WiFiUDP udp_client_{};
28#endif
29 void press_action() override;
30 uint16_t port_{9};
31 uint8_t macaddr_[6];
32};
33
34} // namespace wake_on_lan
35} // namespace esphome
36#endif
Base class for all buttons.
Definition button.h:29
void set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f)
float get_setup_priority() const override
Definition wake_on_lan.h:21
std::unique_ptr< socket::Socket > broadcast_socket_
Definition wake_on_lan.h:25
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.cpp:26
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7