Skip to content
Merged
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
12 changes: 9 additions & 3 deletions subsys/mgmt/mcumgr/smp/src/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,15 @@ static int smp_handle_single_req(struct smp_streamer *streamer, const struct smp
}
#endif

smp_make_rsp_hdr(req_hdr, &rsp_hdr,
zsp->payload_mut - nbw->nb->data - MGMT_HDR_SIZE);
nbw->nb->len = zsp->payload_mut - nbw->nb->data;
#if defined(CONFIG_MCUMGR_MGMT_CUSTOM_PAYLOAD)
if (!mgmt_find_group(req_hdr->nh_group)->custom_payload) {
#endif
nbw->nb->len = zsp->payload_mut - nbw->nb->data;
#if defined(CONFIG_MCUMGR_MGMT_CUSTOM_PAYLOAD)
}
#endif
Comment on lines +313 to +319
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this increases readability

	if (COND_CODE_1(CONFIG_MCUMGR_MGMT_CUSTOM_PAYLOAD,
	    (!mgmt_find_group(req_hdr->nh_group)->custom_payload), (true))) {
		nbw->nb->len = zsp->payload_mut - nbw->nb->data;
	}


smp_make_rsp_hdr(req_hdr, &rsp_hdr, (nbw->nb->len - MGMT_HDR_SIZE));
smp_write_hdr(streamer, &rsp_hdr);

return 0;
Expand Down
Loading