forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

jinlicong
2024-06-19 6e3f1f560d618b37ee1a47fa2b0f682b70c3ef1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#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)  
{
    uint16_t count_i;
    uint8_t * respond_buf_p;
    
    respond_buf_p= uc_respond_data_p->uc_recv_buf;
    if(WriteOrRead==UC_CMD_WRITE)
    {
        //´¦ÀíÊý¾Ý
        
        
        //´æ´¢Êý¾Ý,¼Ç¼
        
        
        
        
        //Ó¦´ðÊý¾Ý´¦Àí
        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 + N;
        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
    {
    }
    
    
    
    
}
 
 
 
 
 
 
 
 
 
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
    {
    }
    
}