ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
e131.h
Go to the documentation of this file.
1#pragma once
3#ifdef USE_NETWORK
6
7#include <cinttypes>
8#include <map>
9#include <memory>
10#include <vector>
11
12namespace esphome {
13namespace e131 {
14
15class E131AddressableLightEffect;
16
18
20
25
27 public:
30
31 void setup() override;
32 void loop() override;
33 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
34
35 void add_effect(E131AddressableLightEffect *light_effect);
36 void remove_effect(E131AddressableLightEffect *light_effect);
37
38 void set_method(E131ListenMethod listen_method) { this->listen_method_ = listen_method; }
39
40 protected:
41 bool packet_(const std::vector<uint8_t> &data, int &universe, E131Packet &packet);
42 bool process_(int universe, const E131Packet &packet);
43 bool join_igmp_groups_();
44 void join_(int universe);
45 void leave_(int universe);
46
48 std::unique_ptr<socket::Socket> socket_;
49 std::vector<E131AddressableLightEffect *> light_effects_;
50 std::map<int, int> universe_consumers_;
51};
52
53} // namespace e131
54} // namespace esphome
55#endif
std::vector< E131AddressableLightEffect * > light_effects_
Definition e131.h:49
void loop() override
Definition e131.cpp:57
void add_effect(E131AddressableLightEffect *light_effect)
Definition e131.cpp:80
E131ListenMethod listen_method_
Definition e131.h:47
void remove_effect(E131AddressableLightEffect *light_effect)
Definition e131.cpp:95
bool process_(int universe, const E131Packet &packet)
Definition e131.cpp:113
std::unique_ptr< socket::Socket > socket_
Definition e131.h:48
void setup() override
Definition e131.cpp:22
std::map< int, int > universe_consumers_
Definition e131.h:50
void set_method(E131ListenMethod listen_method)
Definition e131.h:38
float get_setup_priority() const override
Definition e131.h:33
bool packet_(const std::vector< uint8_t > &data, int &universe, E131Packet &packet)
uint16_t universe
const int E131_MAX_PROPERTY_VALUES_COUNT
Definition e131.h:19
E131ListenMethod
Definition e131.h:17
@ E131_UNICAST
Definition e131.h:17
@ E131_MULTICAST
Definition e131.h:17
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.cpp:66
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint8_t values[E131_MAX_PROPERTY_VALUES_COUNT]
Definition e131.h:23