mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-21 15:33:44 +02:00
Add proper state manager
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <StateManager.hpp>
|
||||
|
||||
#include "esp_event.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_log.h"
|
||||
@@ -19,20 +21,6 @@ static const char *WIFI_MAMANGER_TAG = "[WIFI_MANAGER]";
|
||||
|
||||
class WiFiManager
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum class state_e
|
||||
{
|
||||
NOT_INITIALIZED,
|
||||
INITIALIZED,
|
||||
READY_TO_CONNECT,
|
||||
CONNECTING,
|
||||
WAITING_FOR_IP,
|
||||
CONNECTED,
|
||||
DISCONNECTED,
|
||||
ERROR
|
||||
};
|
||||
|
||||
private:
|
||||
uint8_t channel;
|
||||
wifi_init_config_t _wifi_init_cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
@@ -41,8 +29,6 @@ private:
|
||||
esp_event_handler_instance_t instance_any_id;
|
||||
esp_event_handler_instance_t instance_got_ip;
|
||||
|
||||
static state_e _state;
|
||||
|
||||
int8_t power;
|
||||
bool _enable_adhoc;
|
||||
|
||||
@@ -51,7 +37,6 @@ private:
|
||||
|
||||
public:
|
||||
void SetCredentials(const char *ssid, const char *password);
|
||||
constexpr const state_e &GetState(void) { return _state; }
|
||||
void Begin();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user