ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
udp_transport.cpp
Go to the documentation of this file.
1#include "esphome/core/log.h"
4#include "udp_transport.h"
5
6namespace esphome::udp {
7
8static const char *const TAG = "udp_transport";
9
12 PacketTransport::setup();
13 if (!this->providers_.empty() || this->is_encrypted_()) {
14 this->parent_->add_listener([this](std::span<const uint8_t> data) { this->process_(data); });
15 }
16}
17
18void UDPTransport::send_packet(const std::vector<uint8_t> &buf) const { this->parent_->send_packet(buf); }
19} // namespace esphome::udp
void process_(std::span< const uint8_t > data)
Process a received packet.
void send_packet(const std::vector< uint8_t > &buf) const override
ESPHOME_ALWAYS_INLINE bool is_connected()
Return whether the node is connected to the network (through wifi, eth, ...)
Definition util.h:27
const char *const TAG
Definition spi.cpp:7