Skip to content

Commit b2884ff

Browse files
nordicjmhenrikbrixandersen
authored andcommitted
mgmt: mcumgr: grp: os_mgmt: Use board target for hardware platform
Uses the full hwmv2 board target for the hardware platform output, seemingly this was missed in the hwmv2 migration and it was using the board name only. Adds a deprecated Kconfig to restore to the previous behaviour Signed-off-by: Jamie McCrae <[email protected]>
1 parent 0520dfe commit b2884ff

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ config MCUMGR_GRP_OS_INFO_MAX_RESPONSE_SIZE
183183
size to store the data in. If the output response is too big then the output will not be
184184
present in the response, which will just contain the result code (rc) of memory error.
185185

186+
config MCUMGR_GRP_OS_INFO_HARDWARE_INFO_SHORT_HARDWARE_PLATFORM
187+
bool "Use short hardware platform (board name) [DEPRECATED]"
188+
select DEPRECATED
189+
help
190+
Will use the board name and board revision without the SoC or variant information if
191+
enabled which is the Zephyr 4.2 and earlier behaviour, otherwise will output the full
192+
board target for the hardware platform.
193+
186194
config MCUMGR_GRP_OS_INFO_CUSTOM_HOOKS
187195
bool "Custom info hooks"
188196
depends on MCUMGR_MGMT_NOTIFICATION_HOOKS

subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,13 @@ static int os_mgmt_info(struct smp_streamer *ctxt)
831831

832832
if (format_bitmask & OS_MGMT_INFO_FORMAT_HARDWARE_PLATFORM) {
833833
rc = snprintf(&output[output_length], (sizeof(output) - output_length),
834+
#ifdef CONFIG_MCUMGR_GRP_OS_INFO_HARDWARE_INFO_SHORT_HARDWARE_PLATFORM
834835
(prior_output == true ? " %s%s%s" : "%s%s%s"), CONFIG_BOARD,
835836
(sizeof(CONFIG_BOARD_REVISION) > 1 ? "@" : ""),
836837
CONFIG_BOARD_REVISION);
838+
#else
839+
(prior_output == true ? " %s" : "%s"), CONFIG_BOARD_TARGET);
840+
#endif
837841

838842
if (rc < 0 || rc >= (sizeof(output) - output_length)) {
839843
goto fail;

0 commit comments

Comments
 (0)