Skip to content

Commit

Permalink
[Telink] Remove define of CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER. (#…
Browse files Browse the repository at this point in the history
…31390)

* Remove define of CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER.

This define should not be at a platform level and should only be pulled
in via dependencies.

* [Telink] Fix build

* [Telink] Remove CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER from all CMake files

* [Telink] Needs BOOTLOADER_MCUBOOT for DFU without Matter OTA

---------

Co-authored-by: Andrii Bilynskyi <[email protected]>
Co-authored-by: Alex Tsitsiura <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Apr 23, 2024
1 parent 8274cad commit 1728525
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 89 deletions.
1 change: 0 additions & 1 deletion config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ matter_add_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT)
matter_add_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4)
matter_add_gn_arg_bool ("chip_enable_nfc" CONFIG_CHIP_NFC_COMMISSIONING)
matter_add_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR)
matter_add_gn_arg_bool ("chip_enable_bootloader_mcuboot" CONFIG_BOOTLOADER_MCUBOOT)
matter_add_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS)
matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 1)
matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3)
Expand Down
8 changes: 4 additions & 4 deletions examples/air-quality-sensor-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${CHIP_ROOT}/examples/air-quality-sensor-app/air-quality-sensor-common/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -107,3 +103,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../air-quality-sensor-common/air-quality-sensor-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/all-clusters-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/smco-stub.cpp
Expand All @@ -101,3 +97,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${ALL_CLUSTERS_COMMON_DIR}/all-clusters-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/all-clusters-minimal-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/smco-stub.cpp
Expand All @@ -90,3 +86,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../all-clusters-common/all-clusters-minimal-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
9 changes: 4 additions & 5 deletions examples/bridge-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -90,3 +85,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../bridge-common/bridge-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/chef/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ if (CONFIG_CHIP_LIB_SHELL)
)
endif()

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
Expand All @@ -113,6 +109,10 @@ chip_configure_data_model(app
ZAP_FILE ${CHEF}/devices/${SAMPLE_NAME}.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()

if (CONFIG_CHIP_PW_RPC)

# Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags
Expand Down
8 changes: 4 additions & 4 deletions examples/contact-sensor-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ContactSensorManager.cpp
Expand All @@ -87,3 +83,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../contact-sensor-common/contact-sensor-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/light-switch-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -89,6 +85,10 @@ chip_configure_data_model(app
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()

# Fix for unused swap parameter in: zephyr/include/zephyr/arch/riscv/irq.h:70
add_compile_options(-Wno-error=unused-parameter)

Expand Down
8 changes: 4 additions & 4 deletions examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -122,6 +118,10 @@ chip_configure_data_model(app
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()

# Fix for unused swap parameter in: zephyr/include/zephyr/arch/riscv/irq.h:70
add_compile_options(-Wno-error=unused-parameter)

Expand Down
8 changes: 4 additions & 4 deletions examples/lock-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -89,3 +85,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lock-common/lock-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/ota-requestor-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -87,3 +83,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../ota-requestor-common/ota-requestor-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
12 changes: 12 additions & 0 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>

#if CONFIG_BOOTLOADER_MCUBOOT
#include <OTAUtil.h>
#endif

#if CONFIG_CHIP_OTA_REQUESTOR
#include <app/clusters/ota-requestor/OTARequestorInterface.h>
#endif
Expand Down Expand Up @@ -246,6 +250,14 @@ CHIP_ERROR AppTaskCommon::StartApp(void)
StartThreadButtonEventHandler();
#endif

#ifdef CONFIG_BOOTLOADER_MCUBOOT
if (!chip::DeviceLayer::ConnectivityMgr().IsThreadProvisioned())
{
LOG_INF("Confirm image.");
OtaConfirmNewImage();
}
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

while (true)
{
GetEvent(&event);
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions examples/pump-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/PumpManager.cpp
Expand All @@ -87,3 +83,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-common/pump-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/pump-controller-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/PumpManager.cpp
Expand All @@ -87,3 +83,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../pump-controller-common/pump-controller-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/shell/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ target_include_directories(app PRIVATE
${GEN_DIR}/app-common
${APP_ROOT}/shell_common/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
${APP_ROOT}/shell_common/globals.cpp
${APP_ROOT}/shell_common/cmd_misc.cpp
${APP_ROOT}/shell_common/cmd_otcli.cpp
${APP_ROOT}/standalone/main.cpp)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/smoke-co-alarm-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/SmokeCoAlarmManager.cpp
Expand All @@ -87,3 +83,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../smoke-co-alarm-common/smoke-co-alarm-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/temperature-measurement-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/app/include
)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
Expand All @@ -104,3 +100,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../temperature-measurement-common/temperature-measurement.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/thermostat/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/TemperatureManager.cpp
Expand All @@ -105,3 +101,7 @@ chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../thermostat-common/thermostat.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
8 changes: 4 additions & 4 deletions examples/window-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ target_include_directories(app PRIVATE
${TELINK_COMMON}/util/include
${TELINK_COMMON}/app/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
Expand All @@ -90,6 +86,10 @@ chip_configure_data_model(app
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../common/window-app.zap
)

if(CONFIG_BOOTLOADER_MCUBOOT)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()

# Fix for unused swap parameter in: zephyr/include/zephyr/arch/riscv/irq.h:70
add_compile_options(-Wno-error=unused-parameter)

Expand Down
7 changes: 0 additions & 7 deletions src/platform/telink/BLEManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>

#ifdef CONFIG_BOOTLOADER_MCUBOOT
#include "OTAUtil.h"
#endif /* CONFIG_BOOTLOADER_MCUBOOT */

namespace chip {
namespace DeviceLayer {
namespace Internal {
Expand Down Expand Up @@ -186,9 +182,6 @@ class InternalScanCallback : public DeviceLayer::NetworkCommissioning::ThreadDri
NetworkCommissioning::ThreadScanResponseIterator * networks)
{
mBLEManagerImpl->StartAdvertisingProcess();
#ifdef CONFIG_BOOTLOADER_MCUBOOT
OtaConfirmNewImage();
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
};

private:
Expand Down
Loading

0 comments on commit 1728525

Please sign in to comment.