Skip to content

Commit

Permalink
mgmt: mcumgr: callback: Add op to receive callback
Browse files Browse the repository at this point in the history
Adds the operation supplied by the client to the MCUmgr command
received callback

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
thedjnK authored and fabiobaltieri committed Dec 15, 2023
1 parent 0c09589 commit a48a594
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/zephyr/mgmt/mcumgr/mgmt/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ struct mgmt_evt_op_cmd_arg {
uint8_t id;

union {
/** #mcumgr_op_t used in #MGMT_EVT_OP_CMD_RECV */
uint8_t op;

/** #mcumgr_err_t, used in #MGMT_EVT_OP_CMD_DONE */
int err;

Expand Down
2 changes: 1 addition & 1 deletion subsys/mgmt/mcumgr/smp/src/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int smp_handle_single_payload(struct smp_streamer *cbuf, const struct smp
#if defined(CONFIG_MCUMGR_SMP_COMMAND_STATUS_HOOKS)
cmd_recv.group = req_hdr->nh_group;
cmd_recv.id = req_hdr->nh_id;
cmd_recv.err = MGMT_ERR_EOK;
cmd_recv.op = req_hdr->nh_op;

/* Send request to application to check if handler should run or not. */
status = mgmt_callback_notify(MGMT_EVT_OP_CMD_RECV, &cmd_recv, sizeof(cmd_recv),
Expand Down

0 comments on commit a48a594

Please sign in to comment.