#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
|
{
|
}
|
|
}
|