Skip to content

Commit b6b0de2

Browse files
adigienordicjm
authored andcommitted
samples: matter: Gate DfuOverSmp on CHIP_DFU_OVER_BT_SMP
Build and use DfuOverSmp only when CONFIG_CHIP_DFU_OVER_BT_SMP is enabled. This allows CONFIG_MCUMGR_TRANSPORT_BT to be enabled without pulling in Matter DFU over SMP support. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 9e79746 commit b6b0de2

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

applications/matter_weather_station/src/app_task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "board/led_widget.h"
1818
#include "clusters/identify.h"
1919

20-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
20+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
2121
#include "dfu/smp/dfu_over_smp.h"
2222
#endif
2323

@@ -372,7 +372,7 @@ void AppTask::UpdateLedState()
372372
CHIP_ERROR AppTask::Init()
373373
{
374374
/* Initialize Matter stack */
375-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
375+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
376376
ReturnErrorOnFailure(
377377
Nrf::Matter::PrepareServer(Nrf::Matter::InitData{ .mPostServerInitClbk = []() -> CHIP_ERROR {
378378
Nrf::GetDFUOverSMP().StartServer();

samples/matter/common/cmake/source_common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if(CONFIG_PWM)
3232
target_sources(app PRIVATE ${MATTER_COMMONS_SRC_DIR}/pwm/pwm_device.cpp)
3333
endif()
3434

35-
if(CONFIG_MCUMGR_TRANSPORT_BT)
35+
if(CONFIG_CHIP_DFU_OVER_BT_SMP)
3636
target_sources(app PRIVATE ${MATTER_COMMONS_SRC_DIR}/dfu/smp/dfu_over_smp.cpp)
3737
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
3838
endif()

samples/matter/common/src/app/matter_init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "dfu/ota/ota_util.h"
2424
#endif
2525

26-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
26+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
2727
#include "dfu/smp/dfu_over_smp.h"
2828
#endif
2929

@@ -265,7 +265,7 @@ void DoInitChipServer(intptr_t /* unused */)
265265
Nrf::Matter::OtaConfirmNewImage();
266266
#endif
267267

268-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
268+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
269269
/* Initialize DFU over SMP */
270270
Nrf::GetDFUOverSMP().Init();
271271
Nrf::GetDFUOverSMP().ConfirmNewImage();

samples/matter/common/src/board/board.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <zephyr/logging/log.h>
1515

16-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
16+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
1717
#include "dfu/smp/dfu_over_smp.h"
1818
#endif
1919

@@ -278,7 +278,7 @@ void Board::StartBLEAdvertisementHandler(const ButtonAction &action)
278278
if (action == ButtonAction::Pressed) {
279279
if (sInstance.mState == DeviceState::DeviceProvisioned) {
280280
/* In this case we need to run only Bluetooth LE SMP advertising if it is available */
281-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
281+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
282282
GetDFUOverSMP().StartServer();
283283
#else
284284
LOG_INF("Software update is disabled");

samples/matter/temperature_sensor/src/app_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void AppTask::ButtonEventHandler(Nrf::ButtonState state, Nrf::ButtonMask hasChan
7979
#ifndef CONFIG_NCS_SAMPLE_MATTER_CUSTOM_BLUETOOTH_ADVERTISING
8080
if (Nrf::GetBoard().GetDeviceState() == Nrf::DeviceState::DeviceProvisioned) {
8181
/* In this case we need to run only Bluetooth LE SMP advertising if it is available */
82-
#ifdef CONFIG_MCUMGR_TRANSPORT_BT
82+
#ifdef CONFIG_CHIP_DFU_OVER_BT_SMP
8383
GetDFUOverSMP().StartServer();
8484
#else
8585
LOG_INF("Software update is disabled");

0 commit comments

Comments
 (0)