1.2.2.2.5.2.3.2 MW_DFU_FwImageRead

C

uint16_t MW_DFU_FwImageRead(uint32_t offset, uint16_t length, uint8_t *p_content);

Description

The API is used to read the fragment of firmware image from flash.

Note

Before the new firmware image is activated, the first 16 bytes image fragment read from flash is invalid.

Parameters

ParameterDescription
[in] offsetThe flash offset to start reading image fragment.
[in] lengthThe length of image fragment to read, unit: byte.
[in] p_contentPointer to the image fragment buffer.

Return values

Return valueDescription
MBA_RES_SUCCESSRead the fragment of firmware image successfully.
MBA_RES_INVALID_PARAInvalid parameters. The offset + length exceed MW_DFU_MAX_SIZE_FW_IMAGE or length exceed MW_DFU_MAX_BLOCK_LEN.