Image Management in NCS 2.4.2

Hello there,
I am working on enabling/ disabling DFU in nrf52840dk using ncs 2.4.2.
previously i was doing it using ncs 1.8.0 as follows:

libraries used:

#include <mgmt/mcumgr/smp_bt.h>

#include "os_mgmt/os_mgmt.h"

#include "img_mgmt/img_mgmt.h"

function:

/**

 * @brief Enable DFU service

 *

 */

void enable_dfu_service()

{

 

    if (!ble_session_allow_dfu)

    {

        ble_session_allow_dfu = true;

        smp_bt_register();

        LOG_INF("ble_session_allow_dfu          = %d", (uint8_t)(ble_session_allow_dfu));

        LOG_WRN("DFU Service Enabled", 3);

 

        k_timer_init(&dfu_status_timer, dfu_status_timer_handler, NULL);

        k_timer_start(&dfu_status_timer, K_SECONDS(DFU_STATUS_TIMER_INTERNAL_IN_MINS * 60),  K_SECONDS(DFU_STATUS_TIMER_INTERNAL_IN_MINS * 60));

 

        LOG_WRN("DFU timer started", 3);

    }



}
Now i want to use exact same function in ncs2.4.2. How can I do that any changes required in the function or library?

Related