From fc5f3d06c97f6a5cd89fe0ad0ba031b62822b57b Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Thu, 12 May 2022 13:10:55 +0200 Subject: [PATCH] [nrfconnect] Added kconfig option to enable extended discovery There is no kconfig that would allow to easily enable and disable extended discovery from config file. Added kconfig enabling extended discovery. --- .../nrfconnect/chip-module/Kconfig.defaults | 5 ++++ config/zephyr/Kconfig | 26 ++++++++++++------- .../main/include/CHIPProjectConfig.h | 2 -- examples/chef/nrfconnect/CHIPProjectConfig.h | 2 -- .../main/include/CHIPProjectConfig.h | 1 - .../main/include/CHIPProjectConfig.h | 2 -- .../main/include/CHIPProjectConfig.h | 2 -- .../main/include/CHIPProjectConfig.h | 2 -- .../main/include/CHIPProjectConfig.h | 2 -- .../nrfconnect/CHIPDevicePlatformConfig.h | 4 +++ 10 files changed, 25 insertions(+), 23 deletions(-) diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index 8d587a795608fa..5101175e18f73f 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -185,6 +185,11 @@ config CHIP_QSPI_NOR bool default y +# Enable extended discovery +config CHIP_EXTENDED_DISCOVERY + bool + default y + # Enable OpenThread config NET_L2_OPENTHREAD diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index b47aa808439ea2..36ecaaadfc2e03 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -1,17 +1,17 @@ # -# Copyright (c) 2021 Project CHIP Authors +#Copyright(c) 2021 Project CHIP Authors # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +#Licensed under the Apache License, Version 2.0(the "License"); +#you may not use this file except in compliance with the License. +#You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +#http: // www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +#See the License for the specific language governing permissions and +#limitations under the License. # menuconfig CHIP @@ -244,6 +244,12 @@ config CHIP_OTA_IMAGE_INCLUDE_MCUBOOT endif +config CHIP_EXTENDED_DISCOVERY + bool "Enable extended discovery" + help + Enables the device to advertise commissionable service when not in the + commissioning mode. + module = MATTER module-str = Matter source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" diff --git a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h index 59863c6a38949e..7a2941f28621df 100644 --- a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -31,5 +31,3 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 #define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/chef/nrfconnect/CHIPProjectConfig.h b/examples/chef/nrfconnect/CHIPProjectConfig.h index 58bb5cb20597c4..2bd41247a382f9 100644 --- a/examples/chef/nrfconnect/CHIPProjectConfig.h +++ b/examples/chef/nrfconnect/CHIPProjectConfig.h @@ -35,5 +35,3 @@ #define CHIP_CONFIG_ENABLE_ARG_PARSER 1 #define CHIP_DEVICE_CONFIG_DISABLE_SHELL_PING 1 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h index 3360f4cb60d62e..5361319e42ecfe 100644 --- a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -31,4 +31,3 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 #define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h index b410dbd0a77827..7f6a313e145f87 100644 --- a/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,5 +30,3 @@ // Use a default pairing code if one hasn't been provisioned in flash. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h index 1eb34c2c8eb0bb..3a6d7ab9f27f28 100644 --- a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -32,5 +32,3 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 #define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h index b410dbd0a77827..7f6a313e145f87 100644 --- a/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,5 +30,3 @@ // Use a default pairing code if one hasn't been provisioned in flash. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h index b410dbd0a77827..7f6a313e145f87 100644 --- a/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,5 +30,3 @@ // Use a default pairing code if one hasn't been provisioned in flash. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 0861f7ebc79527..b487b0fa876543 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -126,3 +126,7 @@ #ifdef CONFIG_CHIP_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE #endif // CONFIG_CHIP_DEVICE_TYPE + +#ifdef CONFIG_CHIP_EXTENDED_DISCOVERY +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 +#endif // CONFIG_CHIP_EXTENDED_DISCOVERY