From 6e3f1f560d618b37ee1a47fa2b0f682b70c3ef1c Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 19 Jun 2024 17:25:45 +0800
Subject: [PATCH] 增加OTA协议
---
Function/UPPER_COMPUTER/upper_com.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Function/UPPER_COMPUTER/upper_com.c b/Function/UPPER_COMPUTER/upper_com.c
index 9657c0b..eeb2d61 100644
--- a/Function/UPPER_COMPUTER/upper_com.c
+++ b/Function/UPPER_COMPUTER/upper_com.c
@@ -6,6 +6,7 @@
#include "uart.h"
#include "upper_com_data_pro.h"
#include "mb.h"
+#include "upper_com_iap_pro.h"
UC_RECV_PARA_T __attribute__ ((aligned (4))) uc_recv_para_g = {.uc_recv_flag = RESET};
@@ -102,7 +103,7 @@
}
- //?������֤
+ //������֤
if(uc_recv_data_union_p->uc_protocol_head_s.uc_admin==UC_SUPPER_ADMIN)
{
//����Ҫ��֤����
@@ -110,7 +111,6 @@
}else if(uc_recv_data_union_p->uc_protocol_head_s.uc_admin==UC_MANAGE_USER)
{
//
-
}else if(uc_recv_data_union_p->uc_protocol_head_s.uc_admin==UC_ADVANCED_USER)
{
@@ -170,6 +170,7 @@
uint8_t *data_p;
if (uc_login_state_g == UC_OK && local_random_code_g == uc_recv_data_union_p->uc_protocol_head_s.random_number)
{
+ uc_respond_data_p->uc_protocol_head_s.data_table_id = uc_recv_data_union_p->uc_protocol_head_s.data_table_id;
data_category_ID= BSWAP_16(uc_recv_data_union_p->uc_protocol_head_s.data_table_id);
data_p = uc_recv_data_union_p->uc_recv_buf + UC_PROTOCOL_HEAD_LENGTH +sizeof (uc_recv_data_union_p->uc_protocol_head_s.data_table_id);
switch(data_category_ID)//?��Ҫ����
@@ -218,7 +219,7 @@
// case SYSTEM_FUNCTION_CTRL_WORD_ID : COM_system_function_ctrl_word_inf_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
// case SYSTEM_ALARM_CTRL_WORD_ID : COM_system_alarm_ctrl_word_inf_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
// case SYSTEM_ALARM_REPORT_CTRL_WORD_ID : COM_system_alarm_report_ctrl_word_inf_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
-// case DEVICE_REAL_TIME_ID : COM_time_set_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
+ case DEVICE_REAL_TIME_ID : COM_time_set_handle(uc_recv_data_union_p->uc_protocol_head_s.cmd_code,data_category_ID,data_p,uc_respond_data_p) ;break;
// case DEBUG_STATE_SET_ID : COM_debug_state_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
// case DEBUG_PARA_SET_ID : COM_debug_para_set_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
// case ORIGINAL_WAVEFORM_DATA_READ_ID : COM_original_para_set_handle(WriteOrRead, com_frame_receive_inf_in.data_category_ID,(DataPtr +2)) ;break;
@@ -303,13 +304,14 @@
// {
// uc_rw_result_g = Upper_ComputerLogProcess(Upper_ComputerPermissionsGet(uc_rec_para_p->uc_recv_buf_union.uc_recv_buf[2]),
// &uc_rec_para_p->uc_recv_buf_union.uc_recv_buf[UC_PROTOCOL_HEAD_LENGTH],
-// &uc_temp_result_buffer[0][UC_PROTOCOL_HEAD_LENGTH + UC_DATA_TABLE_BYTES_LENGTH + UC_LOG_NUM_AND_FLAG_LENGTH]);
+// &uc_temp_result_buffer[0][UC_PROTOCOL_HEAD_LENGTH + UC_PROTOCOL_TABLE_ID_LENGTH + UC_LOG_NUM_AND_FLAG_LENGTH]);
// __SYS_DELAY_SEC_TIME_SET_(UC_active_time,UC_ACTIVE_TIME);//���ü���ʱ��//���ü���ʱ��
// }
break;
- case UC_CMD_IAP://?
-// uc_rw_result_g = Upper_ComputerIapProcess(uc_table_id, &uc_rec_para_p->uc_recv_buf_union.uc_recv_buf[UC_PROTOCOL_HEAD_LENGTH + UC_DATA_TABLE_BYTES_LENGTH]);
-// __SYS_DELAY_SEC_TIME_SET_(UC_active_time,UC_ACTIVE_TIME);//���ü���ʱ��//���ü���ʱ��
+ case UC_CMD_IAP://����
+ Upper_ComputerIapHandler(&uc_recv_para_g.uc_recv_buf_union,&uc_respond_data_g);
+ Upper_ComputerRespond(&uc_respond_data_g);
+ __SYS_DELAY_SEC_TIME_SET_(UC_active_time,UC_ACTIVE_TIME);//���ü���ʱ��//���ü���ʱ��
break;
default:
break;
--
Gitblit v1.9.3