mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-13 10:46:31 +02:00
Add support of unified provisioning to Arduino
1. WiFiProv.ino sketch is added that allows arduino users to do provisioning via SoftAP or BLE. WiFi.beginProvision( ) API is designed for provisioning in Arduino. 2. In WiFiProv.h provisioning class is defined. 3. WiFiProv.cpp contains implementation for provisioning class. 4. README.md file is added which contains detail information for working.
This commit is contained in:
@ -27,10 +27,25 @@
|
||||
#include <esp_event_loop.h>
|
||||
#include <functional>
|
||||
#include "WiFiType.h"
|
||||
#include "IPAddress.h"
|
||||
#include <wifi_provisioning/manager.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wifi_prov_cb_event_t event;
|
||||
void *event_data;
|
||||
}wifi_prov_event_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wifi_prov_event_t *prov_event;
|
||||
system_event_t *sys_event;
|
||||
}system_prov_event_t;
|
||||
|
||||
typedef void (*WiFiEventCb)(system_event_id_t event);
|
||||
typedef std::function<void(system_event_id_t event, system_event_info_t info)> WiFiEventFuncCb;
|
||||
typedef void (*WiFiEventSysCb)(system_event_t *event);
|
||||
typedef void (*WiFiProvEventCb)(system_event_t *sys_event, wifi_prov_event_t *prov_event);
|
||||
|
||||
typedef size_t wifi_event_id_t;
|
||||
|
||||
@ -73,6 +88,7 @@ class WiFiGenericClass
|
||||
wifi_event_id_t onEvent(WiFiEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
wifi_event_id_t onEvent(WiFiEventFuncCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
wifi_event_id_t onEvent(WiFiEventSysCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
wifi_event_id_t onEvent(WiFiProvEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
void removeEvent(WiFiEventCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
void removeEvent(WiFiEventSysCb cbEvent, system_event_id_t event = SYSTEM_EVENT_MAX);
|
||||
void removeEvent(wifi_event_id_t id);
|
||||
@ -97,7 +113,7 @@ class WiFiGenericClass
|
||||
bool setTxPower(wifi_power_t power);
|
||||
wifi_power_t getTxPower();
|
||||
|
||||
static esp_err_t _eventCallback(void *arg, system_event_t *event);
|
||||
static esp_err_t _eventCallback(void *arg, system_event_t *event, wifi_prov_event_t *prov_event);
|
||||
|
||||
protected:
|
||||
static bool _persistent;
|
||||
|
Reference in New Issue
Block a user