ESPHome 2025.5.0
Loading...
Searching...
No Matches
udp_transport.h
Go to the documentation of this file.
1#pragma once
2
3#include "../udp_component.h"
4#ifdef USE_NETWORK
7#include <vector>
8
9namespace esphome {
10namespace udp {
11
12class UDPTransport : public packet_transport::PacketTransport, public Parented<UDPComponent> {
13 public:
14 void setup() override;
15 void update() override;
16
17 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
18
19 protected:
20 void send_packet(const std::vector<uint8_t> &buf) const override;
21 bool should_send() override;
22 bool should_broadcast_{false};
23 size_t get_max_packet_size() override { return MAX_PACKET_SIZE; }
24};
25
26} // namespace udp
27} // namespace esphome
28#endif
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
void send_packet(const std::vector< uint8_t > &buf) const override
size_t get_max_packet_size() override
float get_setup_priority() const override
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