15#include <zcbor_common.h>
28#define IMG_MGMT_HASH_STR 48
29#define IMG_MGMT_HASH_LEN 32
30#define IMG_MGMT_DATA_SHA_LEN 32
35#define IMG_MGMT_STATE_F_PENDING 0x01
36#define IMG_MGMT_STATE_F_CONFIRMED 0x02
37#define IMG_MGMT_STATE_F_ACTIVE 0x04
38#define IMG_MGMT_STATE_F_PERMANENT 0x08
41#define IMG_MGMT_VER_MAX_STR_LEN (sizeof("255.255.65535.4294967295"))
46#define IMG_MGMT_SWAP_TYPE_NONE 0
47#define IMG_MGMT_SWAP_TYPE_TEST 1
48#define IMG_MGMT_SWAP_TYPE_PERM 2
49#define IMG_MGMT_SWAP_TYPE_REVERT 3
50#define IMG_MGMT_SWAP_TYPE_UNKNOWN 255
55#define IMG_MGMT_ID_STATE 0
56#define IMG_MGMT_ID_UPLOAD 1
57#define IMG_MGMT_ID_FILE 2
58#define IMG_MGMT_ID_CORELIST 3
59#define IMG_MGMT_ID_CORELOAD 4
60#define IMG_MGMT_ID_ERASE 5
109#ifdef CONFIG_MCUMGR_GRP_IMG_VERBOSE_ERR
222#ifdef CONFIG_MCUMGR_GRP_IMG_VERBOSE_ERR
223#define IMG_MGMT_UPLOAD_ACTION_SET_RC_RSN(action, rsn) ((action)->rc_rsn = (rsn))
224#define IMG_MGMT_UPLOAD_ACTION_RC_RSN(action) ((action)->rc_rsn)
225int img_mgmt_error_rsp(
struct smp_streamer *ctxt,
int rc,
const char *rsn);
226extern const char *img_mgmt_err_str_app_reject;
227extern const char *img_mgmt_err_str_hdr_malformed;
228extern const char *img_mgmt_err_str_magic_mismatch;
229extern const char *img_mgmt_err_str_no_slot;
230extern const char *img_mgmt_err_str_flash_open_failed;
231extern const char *img_mgmt_err_str_flash_erase_failed;
232extern const char *img_mgmt_err_str_flash_write_failed;
233extern const char *img_mgmt_err_str_downgrade;
234extern const char *img_mgmt_err_str_image_bad_flash_addr;
236#define IMG_MGMT_UPLOAD_ACTION_SET_RC_RSN(action, rsn)
237#define IMG_MGMT_UPLOAD_ACTION_RC_RSN(action) NULL
img_mgmt_id_upload_t
Definition: img_mgmt.h:65
int img_mgmt_state_any_pending(void)
Check if any slot is in MCUboot pending state.
uint8_t img_mgmt_state_flags(int query_slot)
Returns state flags set to slot.
int img_mgmt_ver_str(const struct image_version *ver, char *dst)
Format version string from struct image_version.
int img_mgmt_read_info(int image_slot, struct image_version *ver, uint8_t *hash, uint32_t *flags)
int img_mgmt_vercmp(const struct image_version *a, const struct image_version *b)
#define IMG_MGMT_DATA_SHA_LEN
Definition: img_mgmt.h:30
int img_mgmt_state_set_pending(int slot, int permanent)
Sets the pending flag for the specified image slot.
int img_mgmt_slot_in_use(int slot)
Check if the image slot is in use.
struct img_mgmt_state g_img_mgmt_state
int img_mgmt_my_version(struct image_version *ver)
Get the image version of the currently running application.
int img_mgmt_state_confirm(void)
Confirms the current image state.
@ IMG_MGMT_ID_UPLOAD_STATUS_ONGOING
Definition: img_mgmt.h:67
@ IMG_MGMT_ID_UPLOAD_STATUS_COMPLETE
Definition: img_mgmt.h:68
@ IMG_MGMT_ID_UPLOAD_STATUS_START
Definition: img_mgmt.h:66
flags
Definition: parser.h:96
SMP - Simple Management Protocol.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Definition: img_mgmt.h:85
uint8_t data_sha[32]
Definition: img_mgmt.h:94
size_t size
Definition: img_mgmt.h:91
int area_id
Definition: img_mgmt.h:87
uint8_t data_sha_len
Definition: img_mgmt.h:93
size_t off
Definition: img_mgmt.h:89
Definition: img_mgmt.h:98
unsigned long long size
Definition: img_mgmt.h:100
int area_id
Definition: img_mgmt.h:104
bool proceed
Definition: img_mgmt.h:106
int write_bytes
Definition: img_mgmt.h:102
bool erase
Definition: img_mgmt.h:108
Definition: img_mgmt.h:75
size_t size
Definition: img_mgmt.h:78
bool upgrade
Definition: img_mgmt.h:81
uint32_t image
Definition: img_mgmt.h:76
struct zcbor_string img_data
Definition: img_mgmt.h:79
struct zcbor_string data_sha
Definition: img_mgmt.h:80
size_t off
Definition: img_mgmt.h:77
Decodes, encodes, and transmits SMP packets.
Definition: smp.h:69