Added WiFi kernel drivers and refactored Wifi service (#557)
+ other improvements
This commit is contained in:
committed by
GitHub
parent
dbb96a891c
commit
1c2806bddf
@@ -14,7 +14,7 @@ class State final {
|
||||
bool scanning = false;
|
||||
bool scannedAfterRadioOn = false;
|
||||
service::wifi::RadioState radioState;
|
||||
std::vector<service::wifi::ApRecord> apRecords;
|
||||
std::vector<WifiApRecord> apRecords;
|
||||
std::string connectSsid;
|
||||
|
||||
public:
|
||||
@@ -30,14 +30,14 @@ public:
|
||||
|
||||
void updateApRecords();
|
||||
|
||||
template <std::invocable<const std::vector<service::wifi::ApRecord>&> Func>
|
||||
template <std::invocable<const std::vector<WifiApRecord>&> Func>
|
||||
void withApRecords(Func&& onApRecords) const {
|
||||
mutex.withLock([&] {
|
||||
std::invoke(std::forward<Func>(onApRecords), apRecords);
|
||||
});
|
||||
}
|
||||
|
||||
std::vector<service::wifi::ApRecord> getApRecords() const {
|
||||
std::vector<WifiApRecord> getApRecords() const {
|
||||
auto lock = mutex.asScopedLock();
|
||||
lock.lock();
|
||||
return apRecords;
|
||||
|
||||
@@ -27,7 +27,7 @@ class View final {
|
||||
void updateScanning();
|
||||
void updateNetworkList();
|
||||
void updateConnectToHidden();
|
||||
void createSsidListItem(const service::wifi::ApRecord& record, bool isConnecting, size_t index);
|
||||
void createSsidListItem(const WifiApRecord& record, bool isConnecting, size_t index);
|
||||
|
||||
static void showDetails(lv_event_t* event);
|
||||
static void connect(lv_event_t* event);
|
||||
|
||||
Reference in New Issue
Block a user