Skip to content

Commit 2761d50

Browse files
alexsvenkoffes
authored andcommitted
applications: nrf5340_audio: Only register SMP when in DFU mode
- Unregister SMP service if DFU mode is not active - OCT-3356 Signed-off-by: Alexander Svensen <[email protected]>
1 parent 78310ee commit 2761d50

File tree

1 file changed

+10
-0
lines changed
  • applications/nrf5340_audio/src/bluetooth/bt_management

1 file changed

+10
-0
lines changed

applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <zephyr/bluetooth/bluetooth.h>
1111
#include <zephyr/bluetooth/conn.h>
1212
#include <zephyr/bluetooth/hci.h>
13+
#include <zephyr/mgmt/mcumgr/transport/smp_bt.h>
1314
#include <zephyr/settings/settings.h>
1415
#include <zephyr/sys/byteorder.h>
1516
#include <nrfx.h>
@@ -393,6 +394,15 @@ int bt_mgmt_init(void)
393394

394395
#endif /* CONFIG_AUDIO_BT_MGMT_DFU */
395396

397+
#ifdef CONFIG_MCUMGR_TRANSPORT_BT_DYNAMIC_SVC_REGISTRATION
398+
/* Unregister SMP (Simple Management Protocol) service if DFU is not enabled */
399+
ret = smp_bt_unregister();
400+
if (ret) {
401+
LOG_ERR("Failed to unregister SMP service: %d", ret);
402+
return ret;
403+
}
404+
#endif
405+
396406
ret = bt_mgmt_ctlr_cfg_init(IS_ENABLED(CONFIG_WDT_CTLR));
397407
if (ret) {
398408
return ret;

0 commit comments

Comments
 (0)