Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ config MCUMGR_GRP_OS_INFO_BUILD_DATE_TIME

endif

if BOOTLOADER_MCUBOOT

config MCUMGR_GRP_OS_BOOTLOADER_INFO
bool "Bootloader information"
help
Expand All @@ -209,8 +207,6 @@ config MCUMGR_GRP_OS_BOOTLOADER_INFO_HOOK
Supports adding custom responses to the bootloader info command by using registered
callbacks. Data can be appended to the struct provided in the callback.

endif # BOOTLOADER_MCUBOOT

module = MCUMGR_GRP_OS
module-str = mcumgr_grp_os
source "subsys/logging/Kconfig.template.log_config"
Expand Down
9 changes: 7 additions & 2 deletions subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt)

#if defined(CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO)

#if defined(CONFIG_BOOTLOADER_MCUBOOT)
#if defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP)
#define BOOTLOADER_MODE MCUBOOT_MODE_SINGLE_SLOT
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH)
Expand All @@ -440,6 +441,7 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt)
#else
#define BOOTLOADER_MODE -1
#endif
#endif

static int
os_mgmt_bootloader_info(struct smp_streamer *ctxt)
Expand Down Expand Up @@ -485,6 +487,7 @@ os_mgmt_bootloader_info(struct smp_streamer *ctxt)
#endif

/* If no parameter is recognized then just introduce the bootloader. */
#if defined(CONFIG_BOOTLOADER_MCUBOOT)
if (decoded == 0) {
ok = zcbor_tstr_put_lit(zse, "bootloader") &&
zcbor_tstr_put_lit(zse, "MCUboot");
Expand All @@ -499,8 +502,10 @@ os_mgmt_bootloader_info(struct smp_streamer *ctxt)
ok = ok && zcbor_tstr_put_lit(zse, "no-downgrade") &&
zcbor_bool_encode(zse, &(bool){true});
#endif
} else {
return OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER;
} else
#endif
{
ok = smp_add_cmd_err(zse, MGMT_GROUP_ID_OS, OS_MGMT_ERR_QUERY_YIELDS_NO_ANSWER);
}

return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE;
Expand Down
Loading