Skip to content

Image Management

Refer to the smp Image Management documentation for a complete description of each Request and Response.

ImageStatesRead

Bases: ImageStatesReadRequest, _ImageGroupBase

Obtain list of images with their current state.

Source code in smpclient/requests/image_management.py
class ImageStatesRead(smpimg.ImageStatesReadRequest, _ImageGroupBase):
    """Obtain list of images with their current state.

    """
    _Response = smpimg.ImageStatesReadResponse
    _Response = smpimg.ImageStatesReadResponse

ImageStatesWrite

Bases: ImageStatesWriteRequest, _ImageGroupBase

Set the state of an image.

If “confirm” is false or not provided, an image with the “hash” will be set for test, which means that it will not be marked as permanent and upon hard reset the previous application will be restored to the primary slot. In case when “confirm” is true, the “hash” is optional as the currently running application will be assumed as target for confirmation.

Parameters:

Name Type Description Default
hash bytes | None
required
confirm bool
required
Source code in smpclient/requests/image_management.py
class ImageStatesWrite(smpimg.ImageStatesWriteRequest, _ImageGroupBase):
    """Set the state of an image.


    If “confirm” is false or not provided, an image with the “hash” will be set
    for test, which means that it will not be marked as permanent and upon hard
    reset the previous application will be restored to the primary slot. In case
    when “confirm” is true, the “hash” is optional as the currently running
    application will be assumed as target for confirmation.

    Args:
        hash (bytes | None): 
        confirm (bool): 

    """
    _Response = smpimg.ImageStatesWriteResponse
    _Response = smpimg.ImageStatesWriteResponse

ImageUploadWrite

Bases: ImageUploadWriteRequest, _ImageGroupBase

Upload an image to the device.

The image is uploaded in chunks, with each chunk being sent in a separate request. The first request must include the image's length and image number.

Parameters:

Name Type Description Default
off int
required
image int | None
required
len int | None
required
sha bytes | None
required
upgrade bool | None
required
Source code in smpclient/requests/image_management.py
class ImageUploadWrite(smpimg.ImageUploadWriteRequest, _ImageGroupBase):
    """Upload an image to the device.


    The image is uploaded in chunks, with each chunk being sent in a separate
    request. The first request must include the image's length and image number.

    Args:
        off (int): 
        image (int | None): 
        len (int | None): 
        sha (bytes | None): 
        upgrade (bool | None): 

    """
    _Response = smpimg.ImageUploadWriteResponse
    _Response = smpimg.ImageUploadWriteResponse

ImageErase

Bases: ImageEraseRequest, _ImageGroupBase

Erase an image from a slot.

Parameters:

Name Type Description Default
slot int | None
required
Source code in smpclient/requests/image_management.py
class ImageErase(smpimg.ImageEraseRequest, _ImageGroupBase):
    """Erase an image from a slot.

    Args:
        slot (int | None): 

    """
    _Response = smpimg.ImageEraseResponse
    _Response = smpimg.ImageEraseResponse