WiFi fixes and improvements (#100)

This commit is contained in:
Ken Van Hoeylandt
2024-12-02 22:16:08 +01:00
committed by GitHub
parent 33bb742dfb
commit e9c02ab58e
18 changed files with 506 additions and 443 deletions
+22 -12
View File
@@ -1,24 +1,34 @@
#pragma once
#include "Mutex.h"
#include "WifiManageView.h"
#include "View.h"
#include "State.h"
#include "service/wifi/Wifi.h"
namespace tt::app::wifimanage {
typedef struct {
PubSubSubscription* wifi_subscription;
Mutex* mutex;
WifiManageState state;
WifiManageView view;
bool view_enabled;
WifiManageBindings bindings;
} WifiManage;
class WifiManage {
void lock(WifiManage* wifi);
PubSubSubscription* wifiSubscription = nullptr;
Mutex mutex;
tt::app::wifimanage::State state;
tt::app::wifimanage::View view;
Bindings bindings = { };
bool isViewEnabled = false;
void unlock(WifiManage* wifi);
public:
void request_view_update(WifiManage* wifi);
WifiManage();
void lock();
void unlock();
void onShow(App& app, lv_obj_t* parent);
void onHide(App& app);
State& getState() { return state; }
void requestViewUpdate();
};
} // namespace