diff --git a/wiflash_esp32/sacn.cpp b/wiflash_esp32/sacn.cpp index 8b880eb..d00002f 100644 --- a/wiflash_esp32/sacn.cpp +++ b/wiflash_esp32/sacn.cpp @@ -26,6 +26,9 @@ ESPAsyncE131::ESPAsyncE131(uint8_t buffers) { stats.num_packets = 0; stats.packet_errors = 0; _handler = NULL; + + udp.onPacket(std::bind(&ESPAsyncE131::parsePacket, this, + std::placeholders::_1)); } bool ESPAsyncE131::subscribe(uint16_t universe, e131_listen_t type) { @@ -43,9 +46,7 @@ bool ESPAsyncE131::subscribe(uint16_t universe, e131_listen_t type) { default: return false; } - - udp.onPacket(std::bind(&ESPAsyncE131::parsePacket, this, - std::placeholders::_1)); + return success; }