ESPHome 2025.5.0
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 <set>
11#include <vector>
12
13namespace esphome {
14namespace e131 {
15
16class E131AddressableLightEffect;
17
19
21
26
28 public:
31
32 void setup() override;
33 void loop() override;
34 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
35
36 void add_effect(E131AddressableLightEffect *light_effect);
37 void remove_effect(E131AddressableLightEffect *light_effect);
38
39 void set_method(E131ListenMethod listen_method) { this->listen_method_ = listen_method; }
40
41 protected:
42 bool packet_(const std::vector<uint8_t> &data, int &universe, E131Packet &packet);
43 bool process_(int universe, const E131Packet &packet);
44 bool join_igmp_groups_();
45 void join_(int universe);
46 void leave_(int universe);
47
49 std::unique_ptr<socket::Socket> socket_;
50 std::set<E131AddressableLightEffect *> light_effects_;
51 std::map<int, int> universe_consumers_;
52 std::map<int, E131Packet> universe_packets_;
53};
54
55} // namespace e131
56} // namespace esphome
57#endif
void loop() override
Definition e131.cpp:55
void leave_(int universe)
void add_effect(E131AddressableLightEffect *light_effect)
Definition e131.cpp:78
std::map< int, E131Packet > universe_packets_
Definition e131.h:52
E131ListenMethod listen_method_
Definition e131.h:48
void remove_effect(E131AddressableLightEffect *light_effect)
Definition e131.cpp:93
bool process_(int universe, const E131Packet &packet)
Definition e131.cpp:108
std::unique_ptr< socket::Socket > socket_
Definition e131.h:49
void setup() override
Definition e131.cpp:20
std::set< E131AddressableLightEffect * > light_effects_
Definition e131.h:50
std::map< int, int > universe_consumers_
Definition e131.h:51
void set_method(E131ListenMethod listen_method)
Definition e131.h:39
float get_setup_priority() const override
Definition e131.h:34
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:20
E131ListenMethod
Definition e131.h:18
@ E131_UNICAST
Definition e131.h:18
@ E131_MULTICAST
Definition e131.h:18
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
uint8_t values[E131_MAX_PROPERTY_VALUES_COUNT]
Definition e131.h:24