50 lines
1.2 KiB
C
Executable File
50 lines
1.2 KiB
C
Executable File
#ifndef MCU_UPDATE_H
|
|
#define MCU_UPDATE_H
|
|
#include <stdint.h>
|
|
#include "hsf.h"
|
|
#define MCU_INFO_HEAD 0xA5A5
|
|
#define MCU_INFO_FILE 0
|
|
|
|
#define MCU_VER "1.0.0"
|
|
|
|
#define OTA_READ_LEN 256
|
|
|
|
#define OTA_STEP_NULL 0
|
|
#define OTA_STEP_START 1
|
|
#define OTA_STEP_TRANS 2
|
|
#define OTA_STEP_END 3
|
|
#define OTA_STEP_ERROR 4
|
|
|
|
#define MCU_VER_MAX_SIZE 8
|
|
#define SEND_UART_WAIT_TIME_MIN 20
|
|
#define SEND_UART_WAIT_TIME_MAX 500
|
|
|
|
|
|
#pragma pack(push)
|
|
#pragma pack(1)
|
|
|
|
typedef struct{
|
|
uint16_t head;
|
|
unsigned char ota;
|
|
unsigned char updateFlag;
|
|
uint16_t wait_time;
|
|
unsigned char ver[MCU_VER_MAX_SIZE];
|
|
unsigned int len;
|
|
unsigned char reserve[5];
|
|
}mcu_info_t;
|
|
#pragma pack(pop)
|
|
|
|
|
|
const char *hf_get_mcu_ver(void);
|
|
void hf_save_mcu_status(unsigned char flag, int len);
|
|
void hf_mcu_thread(void);
|
|
void hf_set_mcu_version(char *ver);
|
|
int hf_mcu_init(void);
|
|
int hf_save_mcu_info(void);
|
|
int hf_atcmd_mcu(pat_session_t s,int argc,char *argv[],char *rsp,int len);
|
|
int hf_atcmd_mcuver(pat_session_t s,int argc,char *argv[],char *rsp,int len);
|
|
int hf_atcmd_ota_wait_time(pat_session_t s,int argc,char *argv[],char *rsp,int len);
|
|
|
|
#endif
|
|
|