Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mcumgr transfer finished notification ? #132

Open
ExtremeGTX opened this issue Aug 19, 2021 · 3 comments
Open

mcumgr transfer finished notification ? #132

ExtremeGTX opened this issue Aug 19, 2021 · 3 comments

Comments

@ExtremeGTX
Copy link

Is it possible to get a notification callback after mcumgr transfer completed ?

An example use case: in Zephyr when SMP_SHELL is used, I want to disable the logs (because it will intervene with mcumgr packets) till the transfer ends then re-enable the logs again after the transfer ends.

@de-nordic
Copy link
Contributor

There are callbacks that can be registered for various stages of upload:

/**
* @brief Configures a callback that gets called whenever a valid image upload
* request is received.
*
* The callback's return code determines whether the upload request is accepted
* or rejected. If the callback returns 0, processing of the upload request
* proceeds. If the callback returns nonzero, the request is rejected with a
* response containing an `rc` value equal to the return code.
*
* @param cb The callback to execute on rx of an upload
* request.
* @param arg Optional argument that gets passed to the
* callback.
*/
void img_mgmt_set_upload_cb(img_mgmt_upload_fn *cb, void *arg);
void img_mgmt_register_callbacks(const img_mgmt_dfu_callbacks_t *cb_struct);
void img_mgmt_dfu_stopped(void);
void img_mgmt_dfu_started(void);
void img_mgmt_dfu_pending(void);
void img_mgmt_dfu_confirmed(void);

@de-nordic
Copy link
Contributor

Unfortunately they do not allow to pass reason, for example why dfu stopped, etc.

@ExtremeGTX
Copy link
Author

But that's only for image upload, not for file transfer or OS commands for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants