MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / init

Method init

ESP32_AP-Flasher/src/udp.cpp:34–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void UDPcomm::init() {
35 if (config.discovery == 0) {
36 if (udp.listenMulticast(UDPIP, UDPPORT)) {
37 udp.onPacket([this](AsyncUDPPacket packet) {
38 if (packet.remoteIP() != wm.localIP()) {
39 this->processPacket(packet);
40 }
41 });
42 }
43 } else {
44 if (udp.listen(UDPPORT)) {
45 udp.onPacket([this](AsyncUDPPacket packet) {
46 if (packet.isBroadcast() && packet.remoteIP() != wm.localIP()) {
47 this->processPacket(packet);
48 }
49 });
50 }
51 }
52 setAPchannel();
53}
54
55void UDPcomm::processPacket(AsyncUDPPacket packet) {
56 if (config.runStatus == RUNSTATUS_STOP) {

Callers 4

init_udpFunction · 0.45
processFlasherCommandFunction · 0.45
yellow_ap_display_initFunction · 0.45
loadFlashFunction · 0.45

Calls 3

processPacketMethod · 0.95
setAPchannelFunction · 0.85
localIPMethod · 0.80

Tested by

no test coverage detected