Files
TencentOS-tiny/components/ota/common/image/ota_image.h
daishengdong 5b51d50ade add ota algorithm for device
1. effective "Differential Upgrade" patch algorithm with high compression rate
2. effective recovery algorithm support recovery firmware in blocks which has low memory consumption and wear-leveling strategies, especially suitable for embeded devices with low RAM.
3. add sample ota bootloader project, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_bootloader_recovery
4. add sample application project for download firmware through http, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_application_download_through_http
5. add sample application project for download firmware through qcloud explorer console, see:
board\TencentOS_tiny_EVB_MX_Plus\KEIL\ota\ota_application_download_through_qcloud_iot_explorer
6. an OTA markdown document is pending
2020-06-02 15:03:42 +08:00

33 lines
752 B
C

#ifndef _OTA_IMAGE_H_
#define _OTA_IMAGE_H_
#include "stdint.h"
#define OTA_IMAGE_MAGIC 0xBADE
typedef struct ota_image_version_st {
uint8_t major; /* major version number */
uint8_t minor; /* minor version number */
} ota_img_vs_t;
#pragma pack(push, 1)
typedef struct ota_image_header_st {
uint16_t magic;
ota_img_vs_t new_version;
ota_img_vs_t old_version;
uint8_t new_crc;
uint8_t old_crc;
uint8_t patch_crc;
uint32_t new_size;
uint32_t old_size;
uint32_t patch_size;
} ota_img_hdr_t;
#pragma pack(pop)
uint8_t ota_img_hdr_crc(ota_img_hdr_t *img_hdr);
#endif /* _OTA_IMAGE_H_ */