-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement async Wi-Fi scan and enhance list item
- Loading branch information
Showing
4 changed files
with
94 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
#pragma once | ||
|
||
#include <set> | ||
#include <string> | ||
#include <vector> | ||
|
||
enum class SecurityType { | ||
OPEN, | ||
WPA, | ||
UNSUPPORTED | ||
}; | ||
|
||
struct Network { | ||
bool connected; | ||
std::string ssid; | ||
bool connected; | ||
int strength; | ||
SecurityType security_type; | ||
}; | ||
|
||
std::vector<Network> list_wifi_networks(); | ||
bool connect_to_wifi(const std::string& ssid, const std::string& password); | ||
bool forget_wifi(const std::string& ssid); | ||
namespace wifi { | ||
std::vector<Network> scan_networks(); | ||
std::set<std::string> saved_networks(); | ||
bool connect(const std::string& ssid, const std::string& password); | ||
bool forget(const std::string& ssid); | ||
} // namespace wifi |
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