diff --git a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h index 07e1a69a285da4..9babcb7d362d4a 100644 --- a/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -26,10 +26,6 @@ #pragma once -// 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 - // All clusters app has 3 group endpoints. This needs to defined here so that // CHIP_CONFIG_MAX_GROUPS_PER_FABRIC is properly configured. #define CHIP_CONFIG_MAX_GROUP_ENDPOINTS_PER_FABRIC 3 diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/all-clusters-minimal-app/nrfconnect/main/include/CHIPProjectConfig.h index 9fea28ec9fde12..b55e719c553a9b 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/all-clusters-minimal-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -25,7 +25,3 @@ */ #pragma once - -// 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 diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 3783596b04a1f2..4600bc02061e6d 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -683,7 +683,7 @@ def main() -> int: shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") - if options.build_target in "esp32 nrfconnect ameba telink".split(): + if options.build_target in "esp32 ameba telink".split(): with open("project_include.cmake", "w") as f: f.write(textwrap.dedent(f"""\ set(CONFIG_DEVICE_VENDOR_ID {options.vid}) @@ -713,8 +713,20 @@ def main() -> int: nrf_build_cmds = ["west build -b nrf52840dk_nrf52840"] if options.do_clean: nrf_build_cmds.append("-p always") + nrf_build_cmds.append("--") if options.do_rpc: - nrf_build_cmds.append("-- -DOVERLAY_CONFIG=rpc.overlay") + nrf_build_cmds.append("-DOVERLAY_CONFIG=rpc.overlay") + nrf_build_cmds.append( + f"-DCONFIG_CHIP_DEVICE_VENDOR_ID={options.vid}") + nrf_build_cmds.append( + f"-DCONFIG_CHIP_DEVICE_PRODUCT_ID={options.pid}") + nrf_build_cmds.append( + f"-DCONFIG_CHIP_DEVICE_PRODUCT_NAME='\"{options.pname}\"'") + nrf_build_cmds.append( + f"-DSAMPLE_NAME={options.sample_device_type_name}") + nrf_build_cmds.append( + f"-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING='\"{sw_ver_string}\"'") + shell.run_cmd(" ".join(nrf_build_cmds)) elif options.build_target == "silabs-thread": diff --git a/examples/chef/nrfconnect/CHIPProjectConfig.h b/examples/chef/nrfconnect/CHIPProjectConfig.h index 2bd41247a382f9..68b39c591ddfa0 100644 --- a/examples/chef/nrfconnect/CHIPProjectConfig.h +++ b/examples/chef/nrfconnect/CHIPProjectConfig.h @@ -27,10 +27,6 @@ #pragma once -// 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 - // Enable support functions for parsing command-line arguments #define CHIP_CONFIG_ENABLE_ARG_PARSER 1 diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 0f09001fdb5bef..8d7c9a27dcfbd4 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -20,25 +20,16 @@ get_filename_component(NRFCONNECT_COMMON ${CHIP_ROOT}/examples/platform/nrfconne get_filename_component(CHEF ${CMAKE_CURRENT_SOURCE_DIR}/../ REALPATH) include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake) -include(${CHEF}/project_include.cmake) get_filename_component(GEN_DIR ${CHEF}/out/${SAMPLE_NAME}/zap-generated REALPATH) set(CONF_FILE prj.conf) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID=${CONFIG_DEVICE_VENDOR_ID}") -set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=${CONFIG_DEVICE_PRODUCT_ID}") -if(NOT ${CONFIG_DEVICE_PRODUCT_NAME} STREQUAL "") - set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME=\"${CONFIG_DEVICE_PRODUCT_NAME}\"") -endif() -if(NOT ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING} STREQUAL "") - set(CHIP_CFLAGS "${CHIP_CFLAGS} -DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}\"") -endif() -message(STATUS "Vendor ID " ${CONFIG_DEVICE_VENDOR_ID}) -message(STATUS "Product ID " ${CONFIG_DEVICE_PRODUCT_ID}) -message(STATUS "Product Name " ${CONFIG_DEVICE_PRODUCT_NAME}) -message(STATUS "SW Version String" ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}) +message(STATUS "Vendor ID " ${CONFIG_CHIP_DEVICE_VENDOR_ID}) +message(STATUS "Product ID " ${CONFIG_CHIP_DEVICE_PRODUCT_ID}) +message(STATUS "Product Name " ${CONFIG_CHIP_DEVICE_PRODUCT_NAME}) +message(STATUS "SW Version String" ${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING}) # Set Kconfig root files that will be processed as a first Kconfig for used child images. set(mcuboot_KCONFIG_ROOT ${CHIP_ROOT}/config/nrfconnect/chip-module/Kconfig.mcuboot.root) @@ -107,11 +98,7 @@ chip_configure_data_model(app include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake) -if (CONFIG_ENABLE_PW_RPC) - -target_compile_options(app PRIVATE - "-DCONFIG_ENABLE_PW_RPC=1" -) +if (CONFIG_CHIP_PW_RPC) # Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags link_libraries($) @@ -231,4 +218,4 @@ target_link_libraries(app PRIVATE pw_sys_io ) -endif(CONFIG_ENABLE_PW_RPC) +endif(CONFIG_CHIP_PW_RPC) diff --git a/examples/chef/nrfconnect/main.cpp b/examples/chef/nrfconnect/main.cpp index c4157798567e5b..d132252ecd87b3 100644 --- a/examples/chef/nrfconnect/main.cpp +++ b/examples/chef/nrfconnect/main.cpp @@ -39,7 +39,7 @@ #include #endif -#ifdef CONFIG_ENABLE_PW_RPC +#ifdef CONFIG_CHIP_PW_RPC #include "Rpc.h" #endif @@ -57,7 +57,7 @@ int main() { CHIP_ERROR err = CHIP_NO_ERROR; -#ifdef CONFIG_ENABLE_PW_RPC +#ifdef CONFIG_CHIP_PW_RPC rpc::Init(); #endif diff --git a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h index f152bdb75be4d2..2a238cbfb1ab97 100644 --- a/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -28,6 +28,3 @@ #pragma once #define CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES 2 -/* 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 diff --git a/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h index 1e94e5a3995898..7e997d723549d2 100644 --- a/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -27,10 +27,6 @@ #pragma once -// 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 - // Switching from Thread child to router may cause a few second packet stall. // Until this is improved in OpenThread we need to increase the retransmission // interval to survive the stall. diff --git a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h index 7f6a313e145f87..4baa186190f638 100644 --- a/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -26,7 +26,3 @@ */ #pragma once - -// 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 diff --git a/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc b/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc index 7c9f3429d12727..1eaffe9ac8bcb6 100644 --- a/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc +++ b/examples/platform/nrfconnect/pw_sys_io/sys_io_nrfconnect.cc @@ -20,7 +20,7 @@ #include "pw_sys_io/sys_io.h" #include #include -#include +#include #ifdef CONFIG_USB #include diff --git a/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h index 7f6a313e145f87..4baa186190f638 100644 --- a/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -26,7 +26,3 @@ */ #pragma once - -// 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 diff --git a/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h index 7f6a313e145f87..4baa186190f638 100644 --- a/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -26,7 +26,3 @@ */ #pragma once - -// 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 diff --git a/examples/shell/nrfconnect/CHIPProjectConfig.h b/examples/shell/nrfconnect/CHIPProjectConfig.h index b372ea7f0fda73..e7641bf17df441 100644 --- a/examples/shell/nrfconnect/CHIPProjectConfig.h +++ b/examples/shell/nrfconnect/CHIPProjectConfig.h @@ -27,10 +27,6 @@ #pragma once -// 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 - // Enable support functions for parsing command-line arguments #define CHIP_CONFIG_ENABLE_ARG_PARSER 1 diff --git a/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h index 9fea28ec9fde12..b55e719c553a9b 100644 --- a/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -25,7 +25,3 @@ */ #pragma once - -// 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 diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 8407b1e6bcd001..cf1b8807e983fa 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -27,65 +27,22 @@ // ==================== Platform Adaptations ==================== -#ifndef CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER -#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_CHIP_DEVICE_SERIAL_NUMBER -#endif - -#ifndef CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE -#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR -#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT -#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT CONFIG_CHIP_DEVICE_SPAKE2_IT -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT -#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT CONFIG_CHIP_DEVICE_SPAKE2_SALT -#endif - -#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER -#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_CHIP_DEVICE_VENDOR_ID -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME CONFIG_CHIP_DEVICE_VENDOR_NAME -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_CHIP_DEVICE_PRODUCT_ID #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME CONFIG_CHIP_DEVICE_PRODUCT_NAME -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_CHIP_DEVICE_HARDWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING #define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_CHIP_DEVICE_SOFTWARE_VERSION -#endif - -#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING #define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING -#endif +#define CHIP_DEVICE_CONFIG_TEST_MANUFACTURING_DATE CONFIG_CHIP_DEVICE_MANUFACTURING_DATE +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_CHIP_DEVICE_SERIAL_NUMBER +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR CONFIG_CHIP_DEVICE_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT CONFIG_CHIP_DEVICE_SPAKE2_IT +#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_SALT CONFIG_CHIP_DEVICE_SPAKE2_SALT +#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_VERIFIER CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER #ifdef CONFIG_NET_L2_OPENTHREAD #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD @@ -249,10 +206,6 @@ #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 #endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE -#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