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

WiFiServer - operator bool() and method end() #8995

Merged
merged 2 commits into from
Nov 4, 2023

Conversation

JAndrassy
Copy link
Contributor

I did a research how different Arduino networking libraries implement the Arduino networking API.
https://github.com/JAndrassy/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#server-class

For most libraries it is simpler to implement operator bool() than the method status() with its return value constants. So this PR adds bool operator for WiFiServer in the ESP8266Wifi library.

In the research I find out that end() is the most popular name for the function to stop the server and Arduino now used it too in the new WiFiS3 library.

@earlephilhower
Copy link
Collaborator

earlephilhower commented Sep 24, 2023

That's a darn odd failure in CI. I have no idea what's going on there w/host builds and don't think it's related to this at all.

That said, maybe add those methods to wired Ethernet too? https://github.com/esp8266/Arduino/blob/master/cores/esp8266/LwipIntfDev.h My bad, not related.

Would you also like to do the same PR for https://github.com/earlephilhower/arduino-pico ? I could add the add'l functions, but since you've identified the problem I don't want to steal your thunder. We now have wired and WiFi support there, stolen borrowed from here. 😆

@JAndrassy
Copy link
Contributor Author

@earlephilhower I already do to many PR and write issues as a result of the research. Most of the [PR] and [issue] links in the document are my PR and issues. Please do the changes in the Pico core.

btw I didn't include the libraries from pico core in the research since the WiFi is only for Pico W and the libraries for wired Ethernet were not ready when I started :-)

Copy link
Collaborator

@mcspr mcspr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same q as above, don't we want this in Server base?
Otherwise, same thing must be copied to Lwip server implementations

libraries/ESP8266WiFi/src/WiFiServer.h Outdated Show resolved Hide resolved
libraries/ESP8266WiFi/src/WiFiServer.h Outdated Show resolved Hide resolved
@d-a-v d-a-v merged commit 30c6df4 into esp8266:master Nov 4, 2023
28 checks passed
@JAndrassy JAndrassy deleted the wifi_server_op_bool branch November 5, 2023 07:56
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
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.

4 participants