Skip to content

Commit 190d925

Browse files
committed
susbsys/mgmt/mcumgr/grp: add role field to parameters response
Added optional `inst_role` field to MCUmgr Parameters response. Field is intended to express MCUmgr instance role of the device. Interpretation of the value is Application specific. Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 14c5908 commit 190d925

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

subsys/mgmt/mcumgr/grp/os_mgmt/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ config MCUMGR_GRP_OS_DATETIME_HOOK
166166
config MCUMGR_GRP_OS_MCUMGR_PARAMS
167167
bool "MCUMGR Parameters retrieval command"
168168

169+
config MCUMGR_GRP_OS_MCUMGR_PARAMS_ROLE
170+
bool "MCUMGR Parameter Role in response"
171+
depends on MCUMGR_GRP_OS_MCUMGR_PARAMS
172+
173+
config MCUMGR_GRP_OS_MCUMGR_PARAMS_ROLE_VALUE
174+
int "MCUMGR Parameter Role value"
175+
default 0
176+
depends on MCUMGR_GRP_OS_MCUMGR_PARAMS_ROLE
177+
helps
178+
Value for `inst_role` field in response to MCUmgr Parameters request.
179+
169180
config MCUMGR_GRP_OS_INFO
170181
bool "Support for info command"
171182
help

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt)
472472
zcbor_uint32_put(zse, CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE) &&
473473
zcbor_tstr_put_lit(zse, "buf_count") &&
474474
zcbor_uint32_put(zse, CONFIG_MCUMGR_TRANSPORT_NETBUF_COUNT);
475+
#ifdef CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS_ROLE
476+
zcbor_tstr_put_lit(zse, "inst_role") &&
477+
zcbor_uint32_put(zse, CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS_ROLE_VALUE);
478+
#endif
475479

476480
return ok ? MGMT_ERR_EOK : MGMT_ERR_EMSGSIZE;
477481
}

0 commit comments

Comments
 (0)