ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
udp_packet_interface.h
Go to the documentation of this file.
1#pragma once
2
4
5// udp_component.h declares nothing without USE_NETWORK
6#ifdef USE_NETWORK
7#include <span>
8
10#include "../udp_component.h"
11
12namespace esphome::udp {
13
21 public:
23 UdpPacketInterface(UDPComponent *udp_component, std::span<uint8_t> tx_buffer)
24 : packet_interface::PacketInterface(tx_buffer.size()), parent_(udp_component), tx_buffer_(tx_buffer) {}
25
26 void setup() override;
28 const packet_interface::PacketMetaData &meta_data) override;
29
30 protected:
31 void receive_(std::span<const uint8_t> data);
32
34 const std::span<uint8_t> tx_buffer_;
35};
36} // namespace esphome::udp
37#endif
A buffer class that efficiently represents a composite buffer with three sections:
A class that will transport data to and from an abstract channel.
A struct to hold metadata about a packet.
A packet interface link over UDP: each packet is one datagram, sent to every address of the UDP compo...
void receive_(std::span< const uint8_t > data)
UdpPacketInterface(UDPComponent *udp_component, std::span< uint8_t > tx_buffer)
const std::span< uint8_t > tx_buffer_
bool send_to_interface(const packet_interface::PacketBuffer &data, const packet_interface::PacketMetaData &meta_data) override
uint16_t size
Definition helpers.cpp:34