-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
WiFi.config handle Arduino parameters ordering and auto dns,gw,mask #9425
WiFi.config handle Arduino parameters ordering and auto dns,gw,mask #9425
Conversation
👋 Hello JAndrassy, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
7c42c0c
to
8bf5cb5
Compare
8bf5cb5
to
baedf26
Compare
repeat of #8892 rebased after networking refactoring.
In WiFi libraries by Arduino
config
has parametersip, dnsIP, gatewayIP, subnet
. only ip is not optional. for unspecified subnet default is 255.255.255.0 and unspecified gateway and dns are based on IP with last number changed to 1.the ESP8266WiFi library accepts the 'esp\ ordering ip, gw, subnet, dns and Arduino ordering ip, dns, gw, subnet. The detection is based on the position of the subnet mask which has 255 as first number.
This PR adds handling of Arduino ordering of parameters. Parameter subnet is on position of dns1 which is an optional parameter so default value is used if needed.
And this PR adds a second
config
with two parameters local_ip and dns IP. dns IP is optional. gateway IP is calculated, dns IP is calculated if not provided. then the otherconfig
is invoked.this allows
config
invocations as in Arduino libraryit also allows
WiFi.config(INADDR_NONE)
to return to DHCP as in other WiFi libraries.overview of WiFi object API in significant libraries:
https://github.com/JAndrassy/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#wifi-station-network-interface