Files
ESPC3-wireless/app/drivers/sertrf/ota_u.h

52 lines
861 B
C
Raw Normal View History

2025-09-09 18:07:30 +08:00
#pragma once
#include "esp_ota_ops.h"
#include "esp_system.h"
#include "esp_log.h"
#include "sys_log.h"
#define OTA_TAG_0 "ota_0"
#define OTA_TAG_1 "ota_1"
typedef struct
{
const esp_partition_t *running;
const esp_partition_t *update;
esp_ota_handle_t ota_handle;
int total_size;
2025-09-22 14:32:55 +08:00
uint16_t ota_data_cnt;
// uint8_t ota_buff[20480 + 512];
2025-09-09 18:07:30 +08:00
}ota_u_t;
2025-09-22 14:32:55 +08:00
typedef struct
{
uint32_t ota_file_size;
}ota_parm_t;
/**
* @brief ota信息
*/
void get_partition_status(ota_u_t* otau);
2025-09-09 18:07:30 +08:00
/**
* @brief OTA初始化
*
* @param otau
*/
void otau_init(ota_u_t* otau);
/**
* @brief OTA写入
*
* @param otau
* @param data
* @param size
* @return uint8_t
*/
uint8_t otau_write(ota_u_t* otau, void* data, uint32_t size);
/**
* @brief OTA结束
*
* @param otau
* @return uint8_t
*/
uint8_t otau_end(ota_u_t* otau);