与APP对接OTA固件升级

This commit is contained in:
OPTOC
2025-09-22 14:32:55 +08:00
parent f15ba5a274
commit 601659e9f1
4 changed files with 69 additions and 12 deletions

View File

@@ -24,11 +24,17 @@ typedef enum
PORT_LINUX_SBDATA,
}port_type_m;
typedef enum
{
MESSAGE_IDLE = 0,
MESSAGE_OTA,
}message_status_m;
typedef enum
{
PROTOCOL_STATUS_OK = 0,
PROTOCOL_STATUS_NO_DATA, //没有收到数据,或者数据小于一定量
PROTOCOL_STATUS_TYPE_IDLE, //协议类型未知
PROTOCOL_STATUS_ANALYSIS_ERROR, //长时间解析失败
PROTOCOL_STATUS_IN_OTA, //OTA中
}protocol_status_t;
typedef struct
{
@@ -40,7 +46,9 @@ typedef struct
msp_port_t msp;
protocol_status_t protocol_status;
uint16_t analysis_sussess_count; //数据解析成功次数
uint16_t analysis_sussess_count; //数据解析成功次数
message_status_m message_status;
}protocol_t;
/**
@@ -75,10 +83,17 @@ int Protocol_buf_search(void* data, uint32_t size);
* @param size 数据长度
*/
void Protocol_buf_decode(void* data, uint32_t size);
/**
* @brief 设置消息状态
*
* @param status 消息状态
*/
void protocol_set_message_status(message_status_m status);
/**
* @brief 获取协议状态
*
* @retval 协议状态
*/
protocol_status_t get_protocol_status(void);
#endif