This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git


The following commit(s) were added to refs/heads/master by this push:
     new afa95ba  cmd/img_mgmt: Call dfu stop cb on erase
     new a5d3441  Merge pull request #125 from vrahane/img_mgmt_erase_stop_dfu
afa95ba is described below

commit afa95ba5dc1b12b0caa8d735b21c28dc892a7059
Author: vrahane <vi...@proxy.com>
AuthorDate: Thu Jun 10 12:32:23 2021 -0700

    cmd/img_mgmt: Call dfu stop cb on erase
    
    - If a DFU is in process, stop callback needs to be called when erase is
    performed, since the DFU state of the image gets cleared
---
 cmd/img_mgmt/src/img_mgmt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmd/img_mgmt/src/img_mgmt.c b/cmd/img_mgmt/src/img_mgmt.c
index 1a40ffc..f66dc62 100644
--- a/cmd/img_mgmt/src/img_mgmt.c
+++ b/cmd/img_mgmt/src/img_mgmt.c
@@ -314,6 +314,10 @@ img_mgmt_erase(struct mgmt_ctxt *ctxt)
     
     rc = img_mgmt_impl_erase_slot();
 
+    if (!rc) {
+        img_mgmt_dfu_stopped();
+    }
+
     err = 0;
     err |= cbor_encode_text_stringz(&ctxt->encoder, "rc");
     err |= cbor_encode_int(&ctxt->encoder, rc);

Reply via email to