Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add virtual beginMulticast(...) stub to UDP class #8969

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

lmartorella
Copy link
Contributor

Hi,
It seems that (at least) the Arduino core and the ESP32 core both has the base beginMulticast virtual definition in the base UDP class:

     virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; }  // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure

In order to be compatible with libraries like arduino-libraries/ArduinoMDNS, I've added the same base virtual function at UDP level here too.

With these changes, the above library works on a ESP8266 like a charm.

I'm not sure if the different already existing signature of the WiFiUDP::beginMulticast should be left here or not. To be backward compatible, I've added both signatures, but not sure if the one with the different signature should be tagged as deprecated or not.

Thanks!
L

libraries/ESP8266WiFi/src/WiFiUdp.cpp Outdated Show resolved Hide resolved
libraries/ESP8266WiFi/src/WiFiUdp.h Outdated Show resolved Hide resolved
@mcspr mcspr merged commit 1a4663f into esp8266:master Aug 15, 2023
28 checks passed
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
* - Same UDP API of ESP32 core

* - PR review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants