diff --git a/components/mdns/CMakeLists.txt b/components/mdns/CMakeLists.txt index 0933e300..fd592b53 100644 --- a/components/mdns/CMakeLists.txt +++ b/components/mdns/CMakeLists.txt @@ -1,6 +1,6 @@ -set(COMPONENT_SRCS "mdns.c" - "mdns_console.c" - "mdns_networking.c") +set(COMPONENT_SRCS "src/mdns.c" + "src/mdns_console.c" + "src/mdns_networking.c") set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_PRIV_INCLUDEDIRS "private_include") set(COMPONENT_REQUIRES lwip mbedtls console tcpip_adapter) diff --git a/components/mdns/Kconfig b/components/mdns/Kconfig index 321b0f65..3c55cd93 100644 --- a/components/mdns/Kconfig +++ b/components/mdns/Kconfig @@ -1,9 +1,17 @@ menu "mDNS" +config ENABLE_MDNS + bool "Enable mDNS" + default n + select LWIP_IPV6 + help + Enable this option and then mDNS is to be used. + config MDNS_MAX_SERVICES int "Max number of services" range 1 64 default 10 + depends on ENABLE_MDNS help Services take up a certain amount of memory, and allowing fewer services to be open at the same time conserves memory. Specify diff --git a/components/mdns/component.mk b/components/mdns/component.mk index 064cc060..df87e77c 100644 --- a/components/mdns/component.mk +++ b/components/mdns/component.mk @@ -1,2 +1,6 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_PRIV_INCLUDEDIRS := private_include + +ifdef CONFIG_ENABLE_MDNS +COMPONENT_SRCDIRS := src +endif diff --git a/components/mdns/mdns.c b/components/mdns/src/mdns.c similarity index 100% rename from components/mdns/mdns.c rename to components/mdns/src/mdns.c diff --git a/components/mdns/mdns_console.c b/components/mdns/src/mdns_console.c similarity index 100% rename from components/mdns/mdns_console.c rename to components/mdns/src/mdns_console.c diff --git a/components/mdns/mdns_networking.c b/components/mdns/src/mdns_networking.c similarity index 100% rename from components/mdns/mdns_networking.c rename to components/mdns/src/mdns_networking.c diff --git a/examples/protocols/mdns/sdkconfig.defaults b/examples/protocols/mdns/sdkconfig.defaults new file mode 100644 index 00000000..8a694b14 --- /dev/null +++ b/examples/protocols/mdns/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_ENABLE_MDNS=y \ No newline at end of file