-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add connect and disconnect functions to ESP32 network driver
For more fine grained connection management in applications the driver can now be started, without perfoming an inital connection, by the use of the key `managed` in the STA configuration. Adds network:sta_connect/0,1 to allow connecting to an access point after the driver has been started in STA or STA+AP mode. If the function is used without parameters a connection to the last configured access point will be started. Adds network:sta_disconnect/0 to disconnect a station from an access point. The station mode disconnected callback now maintains the default behavior of reconnecting to the last access point if the connection is lost, but if the user defines a custom callback the automatic re-connection will not happen, allowing for users to take advantage of scan results or some other means to determine when and which access point to associate with. The combination of the use of a disconnected callback and `managed` mode allow for the use of `network:wifi_scan/0,1` (PR #1165), since the wifi must not be connected to a station when perfoming a scan and the current implementation always starts a connection immediatly and always reconnects when disconnected. Signed-off-by: Winford <[email protected]>
- Loading branch information
1 parent
1cddf54
commit a922992
Showing
3 changed files
with
324 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.