From f03cf3ae7a36954e64fc014e6bb7afd20c5a5247 Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Wed, 12 Jun 2024 17:22:08 +0800
Subject: [PATCH] 增加IAP功能,准备测试上位机升级

---
 Function/UPPER_COMPUTER/upper_com.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Function/UPPER_COMPUTER/upper_com.c b/Function/UPPER_COMPUTER/upper_com.c
index 9657c0b..cbaef88 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};
 
@@ -170,6 +171,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 +220,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 +305,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);//���ü���ʱ��//���ü���ʱ��
+						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