nt9856x/code/application/source/sf_app/code/include/sf_otamng.h
2023-05-17 15:33:39 +08:00

73 lines
1.4 KiB
C

#ifndef _SF_OTAMNG_H_
#define _SF_OTAMNG_H_
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#include "sf_log.h"
#include "sf_param_common.h"
#define OTAFILE_PATH "/mnt/mmc/ota.txt"
#define OTA_UPGRADE_FILE_NAME "UpgradeSD.bin"
#define OTA_CFG_FILE_NAME "T110Upgrade.CFG"
#define OTA_BAK_FILE_NAME "backup.txt"
#define OTA_UPGRADE_FATH_PREFIX "/mnt/mmc"
#define OTA_UPGRADE_FILE_PATH OTA_UPGRADE_FATH_PREFIX "/" OTA_UPGRADE_FILE_NAME
#define OTA_CFG_FILE_PATH OTA_UPGRADE_FATH_PREFIX "/" OTA_CFG_FILE_NAME
#define SF_OTA_UPGRADE_FILE_PATH SF_SD_ROOT OTA_UPGRADE_FILE_NAME
#define SF_OTA_PARAM_BACKUP_FATH SF_SD_ROOT OTA_BAK_FILE_NAME
typedef struct sf_ota_attrs {
int server_type;
char server_url[128];
char server_host[64];
char filepath[64];
char filename[64];
int filesize;
char *host;
int socket;
//SSL *ssl;
//SSL_CTX *ctx;
} SF_OTA_ATTRS;
SINT32 upgrade_ota_file_IsExsit(SF_CHAR *fileName);
SINT32 sf_upgrade_ota_init(void);
SINT32 sf_upgrade_ota_download(void);
SINT32 sf_upgrade_ota_env_set(void);
SINT32 sf_upgrade_ota_reset(void);
SINT32 sf_upgrade_ota_deinit(void);
SINT32 sf_upgrade_ota_filecheck(void);
SINT32 sf_upgrade_ota_param_bak(void);
SINT32 sf_upgrade_ota_param_recover(void);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif