|
|
@@ -33,7 +33,7 @@ typedef struct softap_config {
|
|
|
static const char *TAG = "wifi_prov_scheme_softap";
|
|
|
|
|
|
extern const wifi_prov_scheme_t wifi_prov_scheme_softap;
|
|
|
-
|
|
|
+static void *scheme_softap_prov_httpd_handle;
|
|
|
static esp_err_t start_wifi_ap(const char *ssid, const char *pass)
|
|
|
{
|
|
|
/* Build Wi-Fi configuration for AP mode */
|
|
|
@@ -85,6 +85,11 @@ static esp_err_t prov_start(protocomm_t *pc, void *config)
|
|
|
|
|
|
protocomm_httpd_config_t *httpd_config = &softap_config->httpd_config;
|
|
|
|
|
|
+ if (scheme_softap_prov_httpd_handle) {
|
|
|
+ httpd_config->ext_handle_provided = true;
|
|
|
+ httpd_config->data.handle = scheme_softap_prov_httpd_handle;
|
|
|
+ }
|
|
|
+
|
|
|
/* Start protocomm server on top of HTTP */
|
|
|
esp_err_t err = protocomm_httpd_start(pc, httpd_config);
|
|
|
if (err != ESP_OK) {
|
|
|
@@ -186,6 +191,11 @@ static esp_err_t set_config_endpoint(void *config, const char *endpoint_name, ui
|
|
|
return ESP_OK;
|
|
|
}
|
|
|
|
|
|
+void wifi_prov_scheme_softap_set_httpd_handle(void *handle)
|
|
|
+{
|
|
|
+ scheme_softap_prov_httpd_handle = handle;
|
|
|
+}
|
|
|
+
|
|
|
const wifi_prov_scheme_t wifi_prov_scheme_softap = {
|
|
|
.prov_start = prov_start,
|
|
|
.prov_stop = prov_stop,
|