diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index d45d7f365de625..e405201395f065 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -99,6 +99,10 @@ if (CONFIG_OPENTHREAD_ENABLED) chip_gn_arg_append("chip_enable_openthread" "true") endif() +if (CONFIG_OPENTHREAD_FTD) + chip_gn_arg_append("chip_openthread_ftd" "true") +endif() + if (CONFIG_ENABLE_OTA_REQUESTOR) chip_gn_arg_append("chip_enable_ota_requestor" "true") endif() diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 4852fefa702fe2..4f9ce318cba0df 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -193,6 +193,7 @@ chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) chip_gn_arg_bool ("chip_logging" CONFIG_LOG) chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) chip_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 384e66ace0bc90..97a48df76807df 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -194,6 +194,7 @@ chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONF chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}") chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) +chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) diff --git a/examples/lighting-app/efr32/BUILD.gn b/examples/lighting-app/efr32/BUILD.gn index 82f8ac26266806..a248836a3f7efa 100644 --- a/examples/lighting-app/efr32/BUILD.gn +++ b/examples/lighting-app/efr32/BUILD.gn @@ -22,6 +22,8 @@ import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -99,11 +101,21 @@ efr32_executable("lighting_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "include" ] defines = [] diff --git a/examples/lighting-app/efr32/args.gni b/examples/lighting-app/efr32/args.gni index 3061e39359d252..1b73ad66dcea58 100644 --- a/examples/lighting-app/efr32/args.gni +++ b/examples/lighting-app/efr32/args.gni @@ -21,3 +21,4 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" chip_enable_openthread = true +chip_openthread_ftd = true diff --git a/examples/lighting-app/efr32/with_pw_rpc.gni b/examples/lighting-app/efr32/with_pw_rpc.gni index 3922567d5b071a..d0a8f2c0485f06 100644 --- a/examples/lighting-app/efr32/with_pw_rpc.gni +++ b/examples/lighting-app/efr32/with_pw_rpc.gni @@ -23,5 +23,6 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true +chip_openthread_ftd = true cpp_standard = "gnu++17" diff --git a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn index 0b19d3f0f21e88..b6592b564d8745 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lighting-app/nxp/k32w/k32w0/BUILD.gn @@ -20,6 +20,7 @@ import("${k32w0_sdk_build_root}/k32w0_executable.gni") import("${k32w0_sdk_build_root}/k32w0_sdk.gni") import("${chip_root}/src/crypto/crypto.gni") +import("${chip_root}/src/platform/device.gni") assert(current_os == "freertos") @@ -79,10 +80,20 @@ k32w0_executable("light_app") { "${chip_root}/src/lib", "${chip_root}/third_party/mbedtls:mbedtls", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", - "${openthread_root}:libopenthread-cli-ftd", - "${openthread_root}:libopenthread-ftd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] ldscript = "${k32w0_platform_dir}/app/ldscripts/chip-k32w061-linker.ld" diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 1b2c6b7ab7fb06..b19eec5b3cc5f9 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni") import("//build_overrides/qpg_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") assert(current_os == "freertos") @@ -55,10 +56,20 @@ qpg_executable("lighting_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] include_dirs = [ diff --git a/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn index 61bb6c5e89705d..fe6c006de15aeb 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/lock-app/cc13x2x7_26x2x7/BUILD.gn @@ -19,6 +19,8 @@ import("//build_overrides/ti_simplelink_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") + import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") @@ -90,9 +92,14 @@ ti_simplelink_executable("lock_app") { ":sysconfig", "${chip_root}/examples/lock-app/lock-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-ftd", ] + if (chip_openthread_ftd) { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } + include_dirs = [ "${project_dir}", "${project_dir}/main", diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index d422b6cd6219d8..bb795925df36bf 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -49,13 +49,6 @@ #endif // BUILD_RELEASE -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 1 - /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID * diff --git a/examples/lock-app/efr32/BUILD.gn b/examples/lock-app/efr32/BUILD.gn index f36729cd64920b..534ce5343e2dde 100644 --- a/examples/lock-app/efr32/BUILD.gn +++ b/examples/lock-app/efr32/BUILD.gn @@ -17,10 +17,13 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${build_root}/config/defaults.gni") + import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") + if (chip_enable_pw_rpc) { import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") @@ -96,11 +99,21 @@ efr32_executable("lock_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "include" ] defines = [] diff --git a/examples/lock-app/efr32/args.gni b/examples/lock-app/efr32/args.gni index 5e298bdae486b6..3ea3fd22b6bd13 100644 --- a/examples/lock-app/efr32/args.gni +++ b/examples/lock-app/efr32/args.gni @@ -19,5 +19,6 @@ import("${chip_root}/src/platform/EFR32/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = true +chip_openthread_ftd = true pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" diff --git a/examples/lock-app/efr32/with_pw_rpc.gni b/examples/lock-app/efr32/with_pw_rpc.gni index f9f11473f56d43..eddb9ae4278054 100644 --- a/examples/lock-app/efr32/with_pw_rpc.gni +++ b/examples/lock-app/efr32/with_pw_rpc.gni @@ -24,5 +24,6 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_pw_rpc = true chip_enable_openthread = true +chip_openthread_ftd = true cpp_standard = "gnu++17" diff --git a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn index 83cdf7f186bd3d..54fb8e0017490a 100644 --- a/examples/lock-app/nxp/k32w/k32w0/BUILD.gn +++ b/examples/lock-app/nxp/k32w/k32w0/BUILD.gn @@ -15,6 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/k32w0_sdk.gni") import("//build_overrides/openthread.gni") +import("${chip_root}/src/platform/device.gni") import("${chip_root}/third_party/simw-top-mini/simw_config.gni") import("${k32w0_sdk_build_root}/k32w0_executable.gni") @@ -75,10 +76,20 @@ k32w0_executable("lock_app") { "${chip_root}/third_party/mbedtls:mbedtls", "${chip_root}/third_party/simw-top-mini:se05x", "${k32w0_platform_dir}/app/support:freertos_mbedtls_utils", - "${openthread_root}:libopenthread-cli-mtd", - "${openthread_root}:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + cflags = [ "-Wconversion" ] output_dir = root_out_dir diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index cdd81ca7412820..7b2b57139300a0 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -160,13 +160,6 @@ #define CONFIG_CHIP_NFC_COMMISSIONING 1 #define CHIP_DEVICE_CONFIG_ENABLE_NFC 1 -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * E-Lock Demo Application is a Thread SED (Sleepy End Device) - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 - /** * @def CHIP_CONFIG_MAX_DEVICE_ADMINS * diff --git a/examples/lock-app/qpg/BUILD.gn b/examples/lock-app/qpg/BUILD.gn index bbbf67aa5a6569..08d4f5730ddf58 100644 --- a/examples/lock-app/qpg/BUILD.gn +++ b/examples/lock-app/qpg/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni") import("//build_overrides/qpg_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${qpg_sdk_build_root}/qpg_executable.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") @@ -55,10 +56,20 @@ qpg_executable("lock_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "${qpg_project_dir}/include", "${examples_plat_dir}", diff --git a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index 27f3ee9a0268ec..2be53a5b773f9c 100644 --- a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -61,13 +61,6 @@ #endif // BUILD_RELEASE -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 1 - /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID * diff --git a/examples/platform/cc13x2_26x2/args.gni b/examples/platform/cc13x2_26x2/args.gni index 7d18cc869d4831..b7df0e17eafb6c 100644 --- a/examples/platform/cc13x2_26x2/args.gni +++ b/examples/platform/cc13x2_26x2/args.gni @@ -16,6 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/src/platform/cc13x2_26x2/args.gni") +chip_openthread_ftd = true openthread_config_file = "" openthread_core_config_deps = [] diff --git a/examples/platform/nxp/k32w/k32w0/args.gni b/examples/platform/nxp/k32w/k32w0/args.gni index 1f82e886978c89..747d22ba2ad90e 100644 --- a/examples/platform/nxp/k32w/k32w0/args.gni +++ b/examples/platform/nxp/k32w/k32w0/args.gni @@ -20,6 +20,7 @@ arm_float_abi = "soft" arm_cpu = "cortex-m4" arm_arch = "armv7e-m" +chip_openthread_ftd = false openthread_core_config_deps = [] openthread_core_config_deps = [ "${chip_root}/examples/platform/nxp/k32w/k32w0:openthread_core_config_k32w0_chip_examples" ] diff --git a/examples/platform/qpg/args.gni b/examples/platform/qpg/args.gni index 9f1b2b2607d092..9af1be4fc3b97e 100644 --- a/examples/platform/qpg/args.gni +++ b/examples/platform/qpg/args.gni @@ -16,6 +16,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/src/platform/qpg/args.gni") +chip_openthread_ftd = false openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [] openthread_core_config_deps = [ diff --git a/examples/platform/qpg/project_include/CHIPProjectConfig.h b/examples/platform/qpg/project_include/CHIPProjectConfig.h index 86fda64698b92c..749c47b148169f 100644 --- a/examples/platform/qpg/project_include/CHIPProjectConfig.h +++ b/examples/platform/qpg/project_include/CHIPProjectConfig.h @@ -108,13 +108,6 @@ */ #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 - /** * CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI * diff --git a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn index b71f123d1cfdbf..d623d0f5c3c996 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/openthread.gni") import("//build_overrides/ti_simplelink_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") @@ -90,9 +91,14 @@ ti_simplelink_executable("pump_app") { ":sysconfig", "${chip_root}/examples/pump-app/pump-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-ftd", ] + if (chip_openthread_ftd) { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd" ] + } else { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd" ] + } + include_dirs = [ "${project_dir}", "${project_dir}/main", diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 6620df3ce102ea..e28bec47f5bda7 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -53,13 +53,6 @@ #endif // BUILD_RELEASE -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 1 - /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID * diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn index 438b87ef8c58cc..445fddb705eaa2 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn @@ -19,6 +19,8 @@ import("//build_overrides/ti_simplelink_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") + import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") @@ -90,9 +92,14 @@ ti_simplelink_executable("pump_controller_app") { ":sysconfig", "${chip_root}/examples/pump-controller-app/pump-controller-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-ftd", ] + if (chip_openthread_ftd) { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } + include_dirs = [ "${project_dir}", "${project_dir}/main", diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 6620df3ce102ea..e28bec47f5bda7 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -53,13 +53,6 @@ #endif // BUILD_RELEASE -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Disable Full Thread Device features - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 1 - /** * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID * diff --git a/examples/shell/efr32/BUILD.gn b/examples/shell/efr32/BUILD.gn index a18df44f8f9989..64e73d4cfbb981 100644 --- a/examples/shell/efr32/BUILD.gn +++ b/examples/shell/efr32/BUILD.gn @@ -17,6 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") @@ -69,7 +70,6 @@ efr32_executable("shell_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", "${examples_plat_dir}:efr-matter-shell", ] diff --git a/examples/shell/efr32/args.gni b/examples/shell/efr32/args.gni index 3061e39359d252..1b73ad66dcea58 100644 --- a/examples/shell/efr32/args.gni +++ b/examples/shell/efr32/args.gni @@ -21,3 +21,4 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" chip_enable_openthread = true +chip_openthread_ftd = true diff --git a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 52a4e1ad0fab2e..3790ed574daaf2 100644 --- a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -167,13 +167,6 @@ #define CONFIG_CHIP_NFC_COMMISSIONING 0 #define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 -/** - * CHIP_DEVICE_CONFIG_THREAD_FTD - * - * Shell Demo Application is a Thread SED (Sleepy End Device) - */ -#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 - /** * @def CHIP_CONFIG_MAX_DEVICE_ADMINS * diff --git a/examples/shell/shell_common/BUILD.gn b/examples/shell/shell_common/BUILD.gn index e2d95419545fab..c0b372eb87d1cb 100644 --- a/examples/shell/shell_common/BUILD.gn +++ b/examples/shell/shell_common/BUILD.gn @@ -48,10 +48,17 @@ static_library("shell_common") { if (chip_enable_openthread && (current_os == "freertos" || current_os == "zephyr")) { - public_deps += [ - "${openthread_root}:libopenthread-cli-ftd", - "${openthread_root}:libopenthread-ftd", - ] + if (chip_openthread_ftd) { + public_deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + public_deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } } public_configs = [ ":shell_common_config" ] diff --git a/examples/window-app/efr32/BUILD.gn b/examples/window-app/efr32/BUILD.gn index b2b6cb7a48eda7..40bf9abe5f4545 100644 --- a/examples/window-app/efr32/BUILD.gn +++ b/examples/window-app/efr32/BUILD.gn @@ -18,6 +18,7 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") @@ -86,11 +87,21 @@ efr32_executable("window_app") { "${chip_root}/src/setup_payload", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", "${examples_plat_dir}:efr-matter-shell", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + include_dirs = [ "include", "${project_dir}/common/include", diff --git a/examples/window-app/efr32/args.gni b/examples/window-app/efr32/args.gni index 3061e39359d252..1b73ad66dcea58 100644 --- a/examples/window-app/efr32/args.gni +++ b/examples/window-app/efr32/args.gni @@ -21,3 +21,4 @@ efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" pw_assert_BACKEND = "$dir_pw_assert_log" chip_enable_openthread = true +chip_openthread_ftd = true diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 0e28a2b5cf3480..1dd684ec06e330 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -47,6 +47,9 @@ if (chip_device_platform != "none") { # Time the firmware was built. chip_device_config_firmware_build_time = "" + # Use OpenThread ftd or mtd library + chip_device_config_thread_ftd = chip_openthread_ftd + # By pass provision and secure session chip_bypass_rendezvous = false @@ -95,6 +98,7 @@ if (chip_device_platform != "none") { defines = [ "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}", "CHIP_ENABLE_OPENTHREAD=${chip_enable_openthread}", + "CHIP_DEVICE_CONFIG_THREAD_FTD=${chip_device_config_thread_ftd}", "CHIP_WITH_GIO=${chip_with_gio}", "OPENTHREAD_CONFIG_ENABLE_TOBLE=false", "CHIP_DEVICE_CONFIG_ENABLE_DNSSD=${chip_device_config_enable_dnssd}", diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index b0ebb9bbf3ebef..94d18ef9d83ba6 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -70,7 +70,13 @@ static_library("EFR32") { ] if (chip_enable_openthread) { - public_deps += [ "${openthread_root}:libopenthread-ftd" ] + if (chip_openthread_ftd) { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] + } sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/platform/cc13x2_26x2/BUILD.gn b/src/platform/cc13x2_26x2/BUILD.gn index 5eb53855aa2244..e77d1e99170467 100644 --- a/src/platform/cc13x2_26x2/BUILD.gn +++ b/src/platform/cc13x2_26x2/BUILD.gn @@ -73,10 +73,12 @@ static_library("cc13x2_26x2") { "${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sysconfig", ] - if (ti_simplelink_device_family == "cc13x2_26x2") { - public_deps += [ "${openthread_root}:libopenthread-mtd" ] - } else if (ti_simplelink_device_family == "cc13x2x7_26x2x7") { - public_deps += [ "${openthread_root}:libopenthread-ftd" ] + if (chip_openthread_ftd) { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] + } else { + public_deps += + [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] } sources += [ diff --git a/src/platform/device.gni b/src/platform/device.gni index a6a66f67eddc45..7fac9867fe2632 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -46,6 +46,10 @@ declare_args() { chip_enable_openthread = chip_device_platform == "linux" || chip_device_platform == "qpg" || chip_device_platform == "cc13x2_26x2" || chip_device_platform == "k32w0" +} + +declare_args() { + chip_openthread_ftd = chip_enable_openthread # Enable wifi support. chip_enable_wifi = diff --git a/src/platform/mbed/CHIPDevicePlatformConfig.h b/src/platform/mbed/CHIPDevicePlatformConfig.h index ab3dced8197f5d..ce972c8e504944 100644 --- a/src/platform/mbed/CHIPDevicePlatformConfig.h +++ b/src/platform/mbed/CHIPDevicePlatformConfig.h @@ -26,7 +26,6 @@ // ==================== Platform Adaptations ==================== #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 0 -#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index cccce5f8461db1..70e2179206b138 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -31,7 +31,6 @@ #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD -#define CHIP_DEVICE_CONFIG_THREAD_FTD CONFIG_OPENTHREAD_FTD #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT diff --git a/src/platform/qpg/BUILD.gn b/src/platform/qpg/BUILD.gn index e5d6d35f2e068c..54596a15ea5f09 100644 --- a/src/platform/qpg/BUILD.gn +++ b/src/platform/qpg/BUILD.gn @@ -61,7 +61,11 @@ static_library("qpg") { ] if (chip_enable_openthread) { - public_deps += [ "${openthread_root}:libopenthread-mtd" ] + if (chip_openthread_ftd) { + public_deps += [ "${openthread_root}:libopenthread-ftd" ] + } else { + public_deps += [ "${openthread_root}:libopenthread-mtd" ] + } public_configs += [ "${chip_root}/third_party/openthread/platforms/qpg:openthread_qpg_config", diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index 18c5a336135be6..d80369615ca696 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -31,7 +31,6 @@ #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD -#define CHIP_DEVICE_CONFIG_THREAD_FTD CONFIG_OPENTHREAD_FTD #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index d43ed2aaf74382..ea4feada715cef 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -22,6 +22,7 @@ import("${efr32_sdk_build_root}/efr32_executable.gni") import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") import("$dir_pw_build/python.gni") import("$dir_pw_protobuf_compiler/proto.gni") @@ -82,12 +83,22 @@ efr32_executable("efr32_device_tests") { "${chip_root}/src/lib", "${chip_root}/third_party/openthread/platforms:libopenthread-platform", "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", "${nlunit_test_root}:nlunit-test", ] + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + deps += pw_build_LINK_DEPS include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ] diff --git a/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index 2b52b3a1297aec..e617862aca0dfe 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -24,4 +24,5 @@ chip_enable_pw_rpc = true cpp_standard = "gnu++17" chip_build_tests = true chip_enable_openthread = true +chip_openthread_ftd = true chip_monolithic_tests = true