mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/remove_mdns_dependency_from_wifi_prov' into 'master'
wifi_provisioning: Remove mdns dependency See merge request espressif/esp-idf!18006
This commit is contained in:
commit
e150c33695
@ -22,4 +22,4 @@ idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_INCLUDE_DIRS src proto-c ../protocomm/proto-c
|
||||
REQUIRES lwip protocomm
|
||||
PRIV_REQUIRES protobuf-c bt mdns json esp_timer)
|
||||
PRIV_REQUIRES protobuf-c bt json esp_timer)
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <esp_err.h>
|
||||
#include <esp_wifi.h>
|
||||
|
||||
#include <mdns.h>
|
||||
#include <protocomm.h>
|
||||
#include <protocomm_httpd.h>
|
||||
|
||||
@ -101,26 +100,6 @@ static esp_err_t prov_start(protocomm_t *pc, void *config)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Add mDNS service for allowing discovery of provisioning
|
||||
* service on the SoftAP network (Optional). Even though
|
||||
* this is an http service we identify it by _esp_wifi_prov so
|
||||
* that application is free to use _http without conflict */
|
||||
err = mdns_service_add("Wi-Fi Provisioning Service", "_esp_wifi_prov", "_tcp",
|
||||
softap_config->httpd_config.data.config.port, NULL, 0);
|
||||
if (err != ESP_OK) {
|
||||
/* mDNS is not mandatory for provisioning to work,
|
||||
* so print warning and return without failure */
|
||||
ESP_LOGW(TAG, "Error adding mDNS service! Check if mDNS is running");
|
||||
} else {
|
||||
/* Information to identify the roles of the various
|
||||
* protocomm endpoint URIs provided by the service */
|
||||
err |= mdns_service_txt_item_set("_esp_wifi_prov", "_tcp", "version_endpoint", "/proto-ver");
|
||||
err |= mdns_service_txt_item_set("_esp_wifi_prov", "_tcp", "session_endpoint", "/prov-session");
|
||||
err |= mdns_service_txt_item_set("_esp_wifi_prov", "_tcp", "config_endpoint", "/prov-config");
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Error adding mDNS service text item");
|
||||
}
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@ -131,7 +110,6 @@ static esp_err_t prov_stop(protocomm_t *pc)
|
||||
ESP_LOGW(TAG, "Error occurred while stopping protocomm_httpd");
|
||||
}
|
||||
|
||||
mdns_service_remove("_esp_wifi_prov", "_tcp");
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user