Skip to content

rework WiFi #1323

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

Merged
merged 22 commits into from
Dec 30, 2015
Merged

rework WiFi #1323

merged 22 commits into from
Dec 30, 2015

Conversation

Links2004
Copy link
Collaborator

rework WiFi class

  • move docu to cpp and make it doxygen compatible
  • rework mode management
  • reduce memory footprint (less static variables inside functions)
  • split code in several files for better overview (API access not changed)
  • improve error handling and return values
  • many small changes
  • new functions
    • Generic
      • hook WiFi events
      • force Sleep Mode
      • set Output Power
    • STA
      • reconnect
      • setAutoConnect
      • getAutoConnect
      • setAutoReconnect
      • isConnected
    • AP
      • softAPgetStationNum

@Links2004
Copy link
Collaborator Author

@sticilface see: Links2004@640d0bb

@sticilface
Copy link
Contributor

Whoops, good work! sorry still working my way through a lot of changes:)

@asetyde
Copy link

asetyde commented Dec 29, 2015

👍

@Links2004
Copy link
Collaborator Author

@sticilface the IP is not stored by the SDK or the WiFi class.
currently: if needed the user need to store the info itself.
if we want to change this we need a new memory segment for storing core internal infos.
for the moment I dont want to create a segment like this.

@sticilface
Copy link
Contributor

Agree. :)

@Links2004
Copy link
Collaborator Author

rework done for now.
will keep the pull request open until tomorrow evening.
some review / testings are welcome its a big change ;)

@Links2004
Copy link
Collaborator Author

@drmpf
Copy link

drmpf commented Dec 29, 2015

Any chance of adding support for client.isSendWaiting() to these changes
see the bottom of Request Event Driven (non-blocking) WiFi API #922 for the small number of changes needed to support this.

@Links2004
Copy link
Collaborator Author

i currently not rework the TCP / UDP stuff.
only the WiFi handling itself.

will take a look later.

@tzapu
Copy link
Contributor

tzapu commented Dec 30, 2015

test results for the auto connect modifications

WiFi.setAutoConnect(false); & WiFi.begin("SSID", "password", 0, NULL, false);
does not connect
WiFi.setAutoConnect(false); & WiFi.begin("SSID", "password", 0, NULL, true);
does not connect 
WiFi.setAutoConnect(true); & WiFi.begin("SSID", "password", 0, NULL, false);
connects 
WiFi.setAutoConnect(true); & WiFi.begin("SSID", "password", 0, NULL, true);
connects
just WiFi.setAutoConnect(false); 
does not connect
just WiFi.setAutoConnect(true); 
connects

test code

  WiFi.mode(WIFI_STA);
  WiFi.setAutoConnect(true);
  WiFi.begin("SSID", "password", 0, NULL, false);
  int connRes = WiFi.waitForConnectResult();

It all seems OK, thank you very much. Maybe a bit confusing when setting connect to false and it still connects.

@Links2004
Copy link
Collaborator Author

@tzapu is the ESP may already connected when you call begin?
the SDK connects to the latest config, without any code in setup or loop.
can you test it with a WiFi.disconnect(true); delay(1000); before your test code?

add isConnected function for easier usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants