pub struct ImageUpload<'a, 'b> {
pub image: Option<u32>,
pub len: Option<u64>,
pub off: u64,
pub sha: Option<&'a [u8; 32]>,
pub data: &'b [u8],
pub upgrade: Option<bool>,
}Expand description
Image Upload command
Fields§
§image: Option<u32>optional image number, it does not have to appear in request at all, in which case it is assumed to be 0.
Should only be present when “off” is 0.
len: Option<u64>optional length of an image.
Must appear when “off” is 0.
off: u64offset of image chunk the request carries.
sha: Option<&'a [u8; 32]>SHA256 hash of an upload; this is used to identify an upload session (e.g. to allow MCUmgr to continue a broken session), and for image verification purposes. This must be a full SHA256 hash of the whole image being uploaded, or not included if the hash is not available (in which case, upload session continuation and image verification functionality will be unavailable).
Should only be present when “off” is 0.
data: &'b [u8]image data to write at provided offset.
upgrade: Option<bool>optional flag that states that only upgrade should be allowed, so if the version of uploaded software is not higher than already on a device, the image upload will be rejected.
Should only be present when “off” is 0.