ESPHome 2026.1.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 {
7namespace udp {
8
9static const char *const TAG = "udp_transport";
10
13 PacketTransport::setup();
14 if (!this->providers_.empty() || this->is_encrypted_()) {
15 this->parent_->add_listener([this](std::vector<uint8_t> &buf) { this->process_(buf); });
16 }
17}
18
19void UDPTransport::send_packet(const std::vector<uint8_t> &buf) const { this->parent_->send_packet(buf); }
20} // namespace udp
21} // namespace esphome
void process_(const std::vector< uint8_t > &data)
Process a received packet.
std::map< std::string, Provider > providers_
void send_packet(const std::vector< uint8_t > &buf) const override
bool is_connected()
Return whether the node is connected to the network (through wifi, eth, ...)
Definition util.cpp:26
const char *const TAG
Definition spi.cpp:7
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7