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_data_pro.c | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/Function/UPPER_COMPUTER/upper_com_data_pro.c b/Function/UPPER_COMPUTER/upper_com_data_pro.c
index 71a5480..2a08aae 100644
--- a/Function/UPPER_COMPUTER/upper_com_data_pro.c
+++ b/Function/UPPER_COMPUTER/upper_com_data_pro.c
@@ -1,12 +1,12 @@
#include "upper_com_data_pro.h"
#include "upper_com.h"
#include "system_mem_para.h"
-
+#include "sizhu_event_record.h"
//�豸������Ϣ���úͶ�ȡ
-void COM_equipment_basic_inf_handle(uint8_t WriteOrRead,u16 data_category_ID,uint8_t *DataPtr,UC_RECV_DATA_UNION_T *uc_respond_data_p) //DataPtr����ʱָ��ID֮�����ʵ����
+void COM_equipment_basic_inf_handle(uint8_t WriteOrRead,u16 data_category_ID,uint8_t *DataPtr,UC_RECV_DATA_UNION_T *uc_respond_data_p)
{
uint16_t count_i;
uint8_t * respond_buf_p;
@@ -17,7 +17,9 @@
//��������
- //�洢����
+ //�洢����,��¼
+
+
//Ӧ�����ݴ���
@@ -30,7 +32,7 @@
{
//Ӧ�����ݴ���
// uc_respond_data_p->uc_protocol_head_s.data_field_length = UC_PROTOCOL_TABLE_ID_LENGTH + N;
- arrayA_2_arrayB((uint8_t*)equipment_basic_inf_g.specification_model , &respond_buf_p[UC_PROTOCOL_HEAD_LENGTH + UC_PROTOCOL_HEAD_LENGTH], sizeof (equipment_basic_inf_g.specification_model), LITTLE_ENDIAN) ;
+ arrayA_2_arrayB((uint8_t*)equipment_basic_inf_g.specification_model , &respond_buf_p[UC_PROTOCOL_HEAD_LENGTH + UC_PROTOCOL_TABLE_ID_LENGTH], sizeof (equipment_basic_inf_g.specification_model), LITTLE_ENDIAN) ;
}else
{
}
@@ -48,8 +50,41 @@
-
-
+void COM_time_set_handle(uint8_t WriteOrRead,u16 data_category_ID,uint8_t *DataPtr,UC_RECV_DATA_UNION_T *uc_respond_data_p)
+{
+ uint16_t count_i;
+ uint8_t * respond_buf_p;
+ uint16_t plant_number;
+ sClockBCD time_after_cali;
+
+ respond_buf_p= uc_respond_data_p->uc_recv_buf;
+ if(WriteOrRead==UC_CMD_WRITE)
+ {
+ //��������
+ arrayA_2_arrayB(DataPtr,(uint8_t *)&time_after_cali,sizeof(time_after_cali),LITTLE_ENDIAN);
+ Set_Extern_Rtc_Time(DataPtr[0],DataPtr[1],DataPtr[2],1,DataPtr[3],DataPtr[4],DataPtr[5]);
+
+ //�洢����,��¼
+ plant_number = uc_recv_para_g.uc_recv_buf_union.uc_protocol_head_s.plant_number[0]<<8;
+ plant_number = plant_number +uc_recv_para_g.uc_recv_buf_union.uc_protocol_head_s.plant_number[1];
+ sizhuSetTimeLogHandle(SET_TIME_SOURCE_UP_COMM , plant_number, time_after_cali);
+
+ //Ӧ�����ݴ���
+ uc_respond_data_p->uc_protocol_head_s.data_field_length = UC_PROTOCOL_TABLE_ID_LENGTH + 1;
+ respond_buf_p[UC_PROTOCOL_HEAD_LENGTH + UC_PROTOCOL_TABLE_ID_LENGTH] = 0;
+
+
+
+ }else if(WriteOrRead==UC_CMD_READ)
+ {
+ //Ӧ�����ݴ���
+ uc_respond_data_p->uc_protocol_head_s.data_field_length = UC_PROTOCOL_TABLE_ID_LENGTH + sizeof (sys_clockBCD_g);
+ arrayA_2_arrayB((uint8_t*)&sys_clockBCD_g , &respond_buf_p[UC_PROTOCOL_HEAD_LENGTH + UC_PROTOCOL_TABLE_ID_LENGTH], sizeof (sys_clockBCD_g), LITTLE_ENDIAN) ;
+ }else
+ {
+ }
+
+}
--
Gitblit v1.9.3