WiFi improvements (#102)
This commit is contained in:
committed by
GitHub
parent
505befef42
commit
c7314546fe
@@ -1,21 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "Bindings.h"
|
||||
#include "State.h"
|
||||
#include "View.h"
|
||||
|
||||
#include "Mutex.h"
|
||||
#include "WifiConnectBindings.h"
|
||||
#include "WifiConnectState.h"
|
||||
#include "WifiConnectView.h"
|
||||
#include "service/wifi/Wifi.h"
|
||||
|
||||
namespace tt::app::wificonnect {
|
||||
|
||||
typedef struct {
|
||||
PubSubSubscription* wifi_subscription;
|
||||
Mutex* mutex;
|
||||
WifiConnectState state;
|
||||
WifiConnectView view;
|
||||
bool view_enabled;
|
||||
WifiConnectBindings bindings;
|
||||
} WifiConnect;
|
||||
class WifiConnect {
|
||||
PubSubSubscription* wifiSubscription;
|
||||
Mutex mutex;
|
||||
State state;
|
||||
View view;
|
||||
bool view_enabled = false;
|
||||
Bindings bindings = {
|
||||
.onConnectSsid = nullptr,
|
||||
.onConnectSsidContext = nullptr
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
WifiConnect();
|
||||
~WifiConnect();
|
||||
|
||||
void lock();
|
||||
void unlock();
|
||||
|
||||
void onShow(App& app, lv_obj_t* parent);
|
||||
void onHide(App& app);
|
||||
|
||||
State& getState() { return state; }
|
||||
Bindings& getBindings() { return bindings; }
|
||||
View& getView() { return view; }
|
||||
|
||||
|
||||
void requestViewUpdate();
|
||||
};
|
||||
|
||||
void lock(WifiConnect* wifi);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user