From 5822f40797c7ebde7a64c8f6082614251c1a5dc2 Mon Sep 17 00:00:00 2001 From: Alex Kolosov Date: Mon, 14 Feb 2022 14:49:32 +0200 Subject: [PATCH] [Telink]: Fix mDNS error occurs on commissioning window opening --- config/telink/chip-module/CMakeLists.txt | 6 ++---- src/platform/telink/BUILD.gn | 1 + src/platform/telink/CHIPDevicePlatformConfig.h | 11 +++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index ca4597c03586f4..228adf39283ce3 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -204,10 +204,8 @@ chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TE chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -if (BOARD STREQUAL "native_posix") - chip_gn_arg_string("target_cpu" "x86") -elseif (BOARD STREQUAL "native_posix_64") - chip_gn_arg_string("target_cpu" "x64") +if (CONFIG_CHIP_ENABLE_DNSSD_SRP) + chip_gn_arg_string("chip_mdns" "platform") endif() file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/args.gn CONTENT ${CHIP_GN_ARGS}) diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index 3f489400c49848..4a201db7565075 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -51,6 +51,7 @@ static_library("telink") { public_deps = [ "${chip_root}/src/platform:platform_base" ] + if (chip_enable_openthread) { sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index 11c3e839afa35f..ba8d6e8257e25d 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -72,3 +72,14 @@ #ifdef CONFIG_CHIP_ENABLE_RENDEZVOUS_BYPASS #define CHIP_BYPASS_RENDEZVOUS CONFIG_CHIP_ENABLE_RENDEZVOUS_BYPASS #endif // CONFIG_CHIP_ENABLE_RENDEZVOUS_BYPASS + +#ifdef CONFIG_CHIP_ENABLE_DNSSD_SRP +#define CHIP_DEVICE_CONFIG_ENABLE_MDNS 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 +#ifdef CONFIG_CHIP_ENABLE_DNS_CLIENT +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 +#endif // CONFIG_CHIP_ENABLE_DNS_CLIENT +#endif // CONFIG_CHIP_ENABLE_DNSSD_SRP \ No newline at end of file