mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[PR #181] [CLOSED] F/non blocking api #1589
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1589
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/tzapu/WiFiManager/pull/181
Author: @mrbig
Created: 6/2/2016
Status: ❌ Closed
Base:
master← Head:f/non_blocking_api📝 Commits (8)
07e2ff5configPortal works in non blocking modeb9a2094Non blocking autoConnect method66b6991Config portal uses noblocking connect mode23b7f1dAdd default connect timeoutf089ccc_apName and _apPassword are now copied to our space1499672Blocking mode for backward compatibilityd1421e2Added example for non blocking modef3cb59cUpdated examples to fix travis build📊 Changes
3 files changed (+223 additions, -70 deletions)
View changed files
📝
WiFiManager.cpp(+152 -67)📝
WiFiManager.h(+32 -3)➕
examples/AutoConnectNonBlocking/AutoConnectNonBlocking.ino(+39 -0)📄 Description
Hello,
this update introduces a non-blocking mode for the WiFiManager.
My devices use wifi merely to pull updates, and the don't even have connectivity every time they turn on. So blocking for several minutes with the config portal is not an option: I wanted to have my application run parallel with the config portal.
In this change I've broke down the main blocking functions (connect, portal event handling, portal connection) into smaller ones, and introduced an internal state maching (_currentState attribute) to keep track of the state.
Default is still the blocking mode, to provide backward compatibility with the original implementation. But in the internals it will do the non-blocking style, but wait before returning.
I've tried to keep the changeset minimal, unfortunately I had modify several functions.
There are still some small blocking events like the scan process, yet I believe they usually don't take more than a few seconds.
There's an example included to show how non-blocking mode can be used.
Any comments and suggestions are welcome.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.