nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
dfu_target_smp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef DFU_TARGET_SMP_H__
15#define DFU_TARGET_SMP_H__
16
17#include <stddef.h>
18#include <dfu/dfu_target.h>
19#include <zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt_client.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
30typedef int (*dfu_target_reset_cb_t)(void);
31
43
50
58int dfu_target_smp_image_list_get(struct mcumgr_image_state *res_buf);
59
66
75
81bool dfu_target_smp_identify(const void *const buf);
82
92int dfu_target_smp_init(size_t file_size, int img_num, dfu_target_callback_t cb);
93
101int dfu_target_smp_offset_get(size_t *offset);
102
111int dfu_target_smp_write(const void *const buf, size_t len);
112
120int dfu_target_smp_done(bool successful);
121
135
144
145#ifdef __cplusplus
146}
147#endif
148
149#endif /* DFU_TARGET_SMP_H__ */
150
int dfu_target_smp_init(size_t file_size, int img_num, dfu_target_callback_t cb)
Initialize DFU target, perform steps necessary to receive firmware.
int(* dfu_target_reset_cb_t)(void)
DFU target reset callback for activating MCUboot serial recovery mode.
Definition dfu_target_smp.h:30
int dfu_target_smp_write(const void *const buf, size_t len)
Write firmware data.
int dfu_target_smp_reboot(void)
Reboot SMP target device, and apply new image.
int dfu_target_smp_schedule_update(int img_num)
Schedule update of image.
int dfu_target_smp_reset(void)
Release resources and erase the download area.
int dfu_target_smp_done(bool successful)
Deinitialize resources and finalize firmware upgrade if successful.
int dfu_target_smp_recovery_mode_enable(dfu_target_reset_cb_t cb)
Register recovery mode reset callback.
int dfu_target_smp_client_init(void)
Initialize dfu target SMP client.
int dfu_target_smp_image_list_get(struct mcumgr_image_state *res_buf)
Read image list.
int dfu_target_smp_offset_get(size_t *offset)
Get offset of firmware.
bool dfu_target_smp_identify(const void *const buf)
Check if data in buffer indicates MCUboot style upgrade.
int dfu_target_smp_confirm_image(void)
Confirm new image activation after reset command.
void(* dfu_target_callback_t)(enum dfu_target_evt_id evt_id)
Definition dfu_target.h:58