move UDP packet callback binding to sACN constructor

This commit is contained in:
Kevin Matz 2020-12-04 14:42:41 -05:00
parent 7f1bd834cc
commit f599b899e5

View File

@ -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;
}