31
31
#include < wifi_provisioning/scheme_softap.h>
32
32
#include < wifi_provisioning/manager.h>
33
33
#undef IPADDR_NONE
34
- #include " WiFi.h"
34
+ #include " WiFiProv.h"
35
+ #include " SimpleBLE.h"
35
36
36
37
extern esp_err_t postToSysQueue (system_prov_event_t *);
37
38
@@ -42,13 +43,6 @@ static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f,
42
43
43
44
#define SERV_NAME_PREFIX_PROV " PROV_"
44
45
45
- bool WiFiProvClass::prov_enable = true ;
46
-
47
- bool WiFiProvClass::isProvEnabled ()
48
- {
49
- return prov_enable;
50
- }
51
-
52
46
void provSchemeBLE ()
53
47
{
54
48
prov_scheme = WIFI_PROV_SCHEME_BLE;
@@ -109,7 +103,7 @@ static void get_device_service_name(char *service_name, size_t max)
109
103
110
104
void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handler_t scheme_event_handler, wifi_prov_security_t security, const char * pop, const char *service_name, const char *service_key, uint8_t * uuid)
111
105
{
112
- prov_enable = true ;
106
+ WiFi. enableProv ( true ) ;
113
107
bool provisioned = false ;
114
108
scheme_cb ();
115
109
config.scheme_event_handler = scheme_event_handler;
@@ -152,7 +146,7 @@ void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handle
152
146
} else {
153
147
wifi_prov_mgr_deinit ();
154
148
WiFi.mode (WIFI_MODE_STA);
155
- log_i (" Aleardy Provisioned, starting Wi-Fi STA" );
149
+ log_i (" Already Provisioned, starting Wi-Fi STA" );
156
150
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO
157
151
wifi_config_t conf;
158
152
esp_wifi_get_config (WIFI_IF_STA,&conf);
@@ -162,4 +156,4 @@ void WiFiProvClass :: beginProvision(void (*scheme_cb)(), wifi_prov_event_handle
162
156
WiFi.begin ();
163
157
}
164
158
}
165
-
159
+ WiFiProvClass WiFiProv;
0 commit comments