mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-21 15:33:44 +02:00
Add support for AP and provisioned wifi networks
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <StateManager.hpp>
|
||||
#include <ProjectConfig.hpp>
|
||||
|
||||
#include "esp_event.h"
|
||||
#include "esp_wifi.h"
|
||||
@@ -19,10 +20,17 @@ static int s_retry_num = 0;
|
||||
static EventGroupHandle_t s_wifi_event_group;
|
||||
static const char *WIFI_MAMANGER_TAG = "[WIFI_MANAGER]";
|
||||
|
||||
namespace WiFiManagerHelpers
|
||||
{
|
||||
void event_handler(void *arg, esp_event_base_t event_base,
|
||||
int32_t event_id, void *event_data);
|
||||
}
|
||||
|
||||
class WiFiManager
|
||||
{
|
||||
private:
|
||||
uint8_t channel;
|
||||
ProjectConfig &deviceConfig;
|
||||
wifi_init_config_t _wifi_init_cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
wifi_config_t _wifi_cfg = {};
|
||||
|
||||
@@ -30,13 +38,14 @@ private:
|
||||
esp_event_handler_instance_t instance_got_ip;
|
||||
|
||||
int8_t power;
|
||||
bool _enable_adhoc;
|
||||
|
||||
// static void event_handler(void *arg, esp_event_base_t event_base,
|
||||
// int32_t event_id, void *event_data);
|
||||
void SetCredentials(const char *ssid, const char *password);
|
||||
void ConnectWithHardcodedCredentials();
|
||||
void ConnectWithStoredCredentials();
|
||||
void SetupAccessPoint();
|
||||
|
||||
public:
|
||||
void SetCredentials(const char *ssid, const char *password);
|
||||
WiFiManager(ProjectConfig &deviceConfig);
|
||||
void Begin();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user