13#ifndef ZEPHYR_INCLUDE_MGMT_MCUMGR_GRP_IMG_MGMT_IMG_MGMT_CLIENT_H_
14#define ZEPHYR_INCLUDE_MGMT_MCUMGR_GRP_IMG_MGMT_IMG_MGMT_CLIENT_H_
41#define IMG_MGMT_CLIENT_HASH_MAX_LEN 64
162 uint32_t image_num,
const char *image_hash);
void img_mgmt_client_init(struct img_mgmt_client *client, struct smp_client_object *smp_client, int image_list_size, struct mcumgr_image_data *image_list)
Inilialize image group client.
int img_mgmt_client_erase(struct img_mgmt_client *client, uint32_t slot)
Erase selected Image Slot.
int img_mgmt_client_upload(struct img_mgmt_client *client, const uint8_t *data, size_t length, struct mcumgr_image_upload *res_buf)
Upload part of image.
#define IMG_MGMT_CLIENT_HASH_MAX_LEN
Maximum supported image digest length.
Definition img_mgmt_client.h:41
int img_mgmt_client_upload_init(struct img_mgmt_client *client, size_t image_size, uint32_t image_num, const char *image_hash)
Initialize image upload.
int img_mgmt_client_state_write(struct img_mgmt_client *client, const char *hash, size_t hash_len, bool confirm, struct mcumgr_image_state *res_buf)
Write the state of an image.
int img_mgmt_client_state_read(struct img_mgmt_client *client, struct mcumgr_image_state *res_buf)
Read image state.
#define IMG_MGMT_VER_MAX_STR_LEN
Definition img_mgmt.h:54
#define IMG_MGMT_DATA_SHA_LEN
Definition img_mgmt.h:37
mcumgr_err_t
MCUmgr error codes.
Definition mgmt_defines.h:99
Header file for the MCUmgr image management group API.
Header file for the MCUmgr SMP client API.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
IMG mgmt client upload structure.
Definition img_mgmt_client.h:104
size_t image_size
Image size.
Definition img_mgmt_client.h:110
uint32_t image_num
Image slot num.
Definition img_mgmt_client.h:116
size_t offset
Image upload offset state.
Definition img_mgmt_client.h:112
char sha256[32]
Image 256-bit hash.
Definition img_mgmt_client.h:106
size_t upload_header_size
Worst case init upload message size.
Definition img_mgmt_client.h:114
bool hash_initialized
True when Hash is configured, false when not.
Definition img_mgmt_client.h:108
IMG mgmt client object.
Definition img_mgmt_client.h:122
int image_list_length
Client image list buffer size.
Definition img_mgmt_client.h:128
struct smp_client_object * smp_client
SMP client object.
Definition img_mgmt_client.h:124
int status
Command status.
Definition img_mgmt_client.h:132
struct mcumgr_image_data * image_list
Image list buffer.
Definition img_mgmt_client.h:130
struct img_gr_upload upload
Image Upload state data for client internal use.
Definition img_mgmt_client.h:126
Image list data.
Definition img_mgmt_client.h:62
struct mcumgr_image_list_flags flags
Image Flags.
Definition img_mgmt_client.h:74
uint32_t slot_num
Image slot num.
Definition img_mgmt_client.h:64
char hash[64]
Image digest (SHA-256 or SHA-512).
Definition img_mgmt_client.h:68
char version[(sizeof("255.255.65535.4294967295"))+1]
Image Version.
Definition img_mgmt_client.h:72
size_t hash_len
Length of the digest in bytes.
Definition img_mgmt_client.h:70
uint32_t img_num
Image number.
Definition img_mgmt_client.h:66
Image list flags.
Definition img_mgmt_client.h:46
bool pending
Pending update state.
Definition img_mgmt_client.h:50
bool bootable
Bootable image.
Definition img_mgmt_client.h:48
bool confirmed
Confirmed image.
Definition img_mgmt_client.h:52
bool active
Active image.
Definition img_mgmt_client.h:54
bool permanent
Permanent image state.
Definition img_mgmt_client.h:56
MCUmgr Image list response.
Definition img_mgmt_client.h:80
enum mcumgr_err_t status
Status.
Definition img_mgmt_client.h:82
struct mcumgr_image_data * image_list
Image list pointer.
Definition img_mgmt_client.h:86
int image_list_length
Length of image_list.
Definition img_mgmt_client.h:84
MCUmgr Image upload response.
Definition img_mgmt_client.h:92
enum mcumgr_err_t status
Status.
Definition img_mgmt_client.h:94
size_t image_upload_offset
Reported image offset.
Definition img_mgmt_client.h:96
SMP client object.
Definition smp_client.h:32