-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Async WiFi: connect/disconnect/scan/wait_for_event (#129)
* Add async scan_n() * WifiFuture and async connect - Don't compile the blocking `WifiStack` when using the embassy-net feature - Improve WifiEventFuture to have a waker for each WifiEvent - Stub out async versions of embedded-svc trait * Add async start/stop/connect - All works first time - Fails on reconnect, but this is a bug in the svc implementation - Implements `IntoFuture` for `WifiEvent` - Is it possible to await the event in two seperate futures? or will one overwrite the other? * Async connect/disconnect - Now working in fully async fashion - Improved embedded-svc `Wifi` trait impl - is_started etc still needs work - spotted memory leak when not transmitting anything * Fix async start Can now succesfully reconnect to a network * Fix `is_started` Closes #126 * link state waker * Only wake the transmit waker if we have something to send * Correct WifiEventFuture Instead of relying on the current state, it now tracks events and clears the event before trying to listen. * wifi: split into device and controller - Split the wifi into two parts, the device part which is used within the network stack and the controller, which handles the wifi connection parts - Remove the uneeded `Wifi` impl now that the two parts are separate * undo cfg of blocking stack * small fixups * controller: add `wait_for_event` - This solves the waker overwrite issue, as the function takes `&mut self`, meaning its only possible to await for the same event once. - Sadly this means we have to remove the really clean `into_future` impl :(, but atleast we don't have to bump MSRV. * Fix examples * fmt * make globals pub(crate) * make all events awaitable - Add wakers for all events - Add some docs - Make WifiEventFuture pub(crate) * fix esp-now
- Loading branch information
Showing
11 changed files
with
601 additions
and
396 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
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
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
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.