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

Enhanced connection management for esp32 network driver #1181

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 21, 2024

  1. 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 atomvm#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]>
    UncleGrumpy committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    d772200 View commit details
    Browse the repository at this point in the history
  2. Updated "Network Programmers Guide" documentation

    Adds descriptions of new configuration options and connect/0,1
    and disconnect/0 functions.
    
    Signed-off-by: Winford <[email protected]>
    UncleGrumpy committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    be980c2 View commit details
    Browse the repository at this point in the history