-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[SSDP] add schema(Print &) const
#6798
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
Conversation
Supercedes esp8266#2806 Make SSDP::schema(WiFiClient&) use a by-ref (reduce stack use) Add a SSDP::schema(Print&) From @Palatis' original PR: useful when using AsyncWebServer.
@d-a-v, for the SSDP patch, I'm just the messenger. However, maybe it makes sense to use just export |
Err, @devyte I meant to ping! |
Exactly why I asked. I suggest picking which of the two bodies looks best and keeping that one with Print arg. |
Because WiFiClient inherits a Print interface, replace the ::schema(WiFiClient&) with ::schema(Print&) which is source compatible with existing code and allows the functionality requested in the initial PR. Use ip.toString() in the templates instead of breaking up the octets of the address.
Both comments addressed. SSDP will now use ip.toString() instead of octet extraction, and will export only the schema(Print&) which should work for any existing code as WiFiClient has a Print interface.. |
Well, I guess C++ can't convert silently from a WiFiClient to Print for us. Multiple inheritance C++ classes might have such limitations (not like Java where there's a first-class interface type). Any ideas?
|
Might be running into the 1-step implicit casting rule. I'll take a look at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glad to see the crazy forwarder idea worked :)
Supercedes #2806
Make SSDP::schema(WiFiClient&) use a by-ref (reduce stack use)
Add a SSDP::schema(Print&)
From @Palatis' original PR:
useful when using AsyncWebServer.