天嵌二次封装库使用手册  V1.0
ota.h 文件参考
#include <stdio.h>
#include "common.h"
#include "http_file.h"
#include "parser_file.h"
#include "md5sum.h"
#include "parser_cmd.h"
#include "progress.h"
ota.h 的引用(Include)关系图:

浏览源代码.

宏定义

#define VERSION_FILE   "/version"
 存放版本信息的文件
 

函数

int start_ota_update (char *ip_port, const char *product)
 在线更新产品 更多...
 
int start_ota_update_sd (const char *product)
 从sd卡中更新产品 更多...
 
int get_status (char *str, int len)
 获取文件状态信息 更多...
 
int set_no_ramdisk_update (int enbale)
 设置产品不从磁盘更新 更多...
 

详细描述

作者
zhengchuangyong (zheng.nosp@m.chua.nosp@m.ngyon.nosp@m.g@em.nosp@m.bedsk.nosp@m.y.ne.nosp@m.t)
版本
1.0
日期
2021-09-26
修改日志:
Date Version Author Description
2021-09-26 1.0 zhengchuangyong 第一次发布,对产品一些资源更新方法的封装,如在线更新,从sd卡更新.

函数说明

int get_status ( char *  str,
int  len 
)

获取文件状态信息

参数
str用于存放获取的状态信息
len获取状态信息的长度
返回
int 成功返回实际获取的信息长度,失败返回小于0的整数
int set_no_ramdisk_update ( int  enbale)

设置产品不从磁盘更新

参数
enbale使能参数,设置为1时才可以进行在线升级
返回
int 成功返回实际设置的信息长度,失败返回小于0的整数
int start_ota_update ( char *  ip_port,
const char *  product 
)

在线更新产品

参数
ip_port服务器的IP地址和端口号
product要更新的产品
返回
int 更新成功返回0,失败返回-1
int start_ota_update_sd ( const char *  product)

从sd卡中更新产品

参数
product要更新的产品
返回
int 更新成功返回0,失败返回-1