|
|
|
@ -59,12 +59,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Private function prototypes -----------------------------------------------*/
|
|
|
|
|
extern void _hf_heartbeat_recv(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_prps_get_recv(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_trend_recv(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_event_recv(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_send_reset(uint8_t slot, void *data);
|
|
|
|
|
extern void _hf_send_prps_get(uint8_t slot, void *data);
|
|
|
|
|
|
|
|
|
|
extern void _hf_prps_get_send(uint8_t slot, void *data);
|
|
|
|
|
extern void _hf_recv_heartbeat(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_recv_prps_get(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_recv_trend(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
extern void _hf_recv_event(uint8_t slot, char *pkt, uint16_t len);
|
|
|
|
|
|
|
|
|
|
// 命令映射表
|
|
|
|
|
static dau_recv_fun_cb _hf_command[] =
|
|
|
|
@ -79,7 +80,7 @@ static dau_recv_fun_cb _hf_command[] =
|
|
|
|
|
NULL, // DAU_C_DEV_INFO_GET 7
|
|
|
|
|
NULL, // 8
|
|
|
|
|
NULL, // DAU_C_UPDATE_RESULT 9
|
|
|
|
|
_hf_heartbeat_recv, // DAU_C_HEARTBEAT 10
|
|
|
|
|
_hf_recv_heartbeat, // DAU_C_HEARTBEAT 10
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 命令映射表
|
|
|
|
@ -90,26 +91,46 @@ static dau_recv_fun_cb _hf_prv_command[] =
|
|
|
|
|
NULL, // DAU_P_CONFIG_GET 2
|
|
|
|
|
NULL, // DAU_P_CONFIG_PORT_SET 3
|
|
|
|
|
NULL, // DAU_P_CONFIG_PORT_GET 4
|
|
|
|
|
_hf_prps_get_recv, // DAU_P_CONFIG_REAL_WAVE 5
|
|
|
|
|
_hf_recv_prps_get, // DAU_P_CONFIG_REAL_WAVE 5
|
|
|
|
|
NULL, // 6
|
|
|
|
|
NULL, // 7
|
|
|
|
|
NULL, // 8
|
|
|
|
|
NULL, // 9
|
|
|
|
|
_hf_trend_recv, // DAU_P_TREND 10
|
|
|
|
|
_hf_recv_trend, // DAU_P_TREND 10
|
|
|
|
|
NULL, // DAU_P_REAL_PRPS 11
|
|
|
|
|
_hf_event_recv, // DAU_P_EVENT 12
|
|
|
|
|
_hf_recv_event, // DAU_P_EVENT 12
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 命令映射表
|
|
|
|
|
static dau_send_fun_cb _hf_send_command[] =
|
|
|
|
|
{
|
|
|
|
|
NULL, // 0
|
|
|
|
|
_hf_prps_get_send, // DAU_SEND_PRPS 1
|
|
|
|
|
NULL, // DAU_SEND_ADD 1
|
|
|
|
|
_hf_send_reset, // DAU_SEND_RESET 2
|
|
|
|
|
_hf_send_prps_get, // DAU_SEND_PRPS 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Interface functions -------------------------------------------------------*/
|
|
|
|
|
/* PRPS 重启发送 */
|
|
|
|
|
void _hf_send_reset(uint8_t slot, void *data)
|
|
|
|
|
{
|
|
|
|
|
dau_head_init_t head_data;
|
|
|
|
|
dau_t *dau = &daus[slot];
|
|
|
|
|
|
|
|
|
|
/* 回复报文 */
|
|
|
|
|
head_data.cmd_type = DAU_REQUEST;
|
|
|
|
|
head_data.cmd = DAU_C_RESET;
|
|
|
|
|
head_data.pkt_id = dau->pkt_id++;
|
|
|
|
|
head_data.pkt = dau->buf_send;
|
|
|
|
|
head_data.len = sizeof(dau_pkt_head_t);
|
|
|
|
|
|
|
|
|
|
dau_data_send(dau, &head_data);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* PRPS 关注报文发送 */
|
|
|
|
|
void _hf_prps_get_send(uint8_t slot, void *data)
|
|
|
|
|
void _hf_send_prps_get(uint8_t slot, void *data)
|
|
|
|
|
{
|
|
|
|
|
dau_head_init_t head_data;
|
|
|
|
|
dau_t *dau = &daus[slot];
|
|
|
|
@ -129,8 +150,35 @@ void _hf_prps_get_send(uint8_t slot, void *data)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 重启报文接收 */
|
|
|
|
|
void _hf_recv_reset(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
hf_ack_t *ack = (hf_ack_t*)(pkt + sizeof(dau_pkt_head_t));
|
|
|
|
|
hf_ack_t *data = NULL;
|
|
|
|
|
|
|
|
|
|
/* 申请内存 */
|
|
|
|
|
data = XMALLOC(MTYPE_CSG, sizeof(hf_ack_t));
|
|
|
|
|
if (!data)
|
|
|
|
|
{
|
|
|
|
|
DBG(DBG_M_PD_HF_ERR, "XMALLOC ERROR!\r\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 装填数据 */
|
|
|
|
|
data->result = ack->result;
|
|
|
|
|
data->slot = slot;
|
|
|
|
|
|
|
|
|
|
/* 发送给后台 */
|
|
|
|
|
if (dau_msg_send_cmd(DAU_SEND_RESET, data) != E_NONE)
|
|
|
|
|
{
|
|
|
|
|
XFREE(MTYPE_CSG, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 心跳报文接收 */
|
|
|
|
|
void _hf_heartbeat_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
void _hf_recv_heartbeat(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
dau_head_init_t head_data;
|
|
|
|
|
dau_t *dau = &daus[slot];
|
|
|
|
@ -154,7 +202,7 @@ void _hf_heartbeat_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 心跳报文接收 */
|
|
|
|
|
void _hf_prps_get_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
void _hf_recv_prps_get(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
hf_ack_t *ack = (hf_ack_t*)(pkt + sizeof(dau_pkt_head_t));
|
|
|
|
|
hf_ack_t *data = NULL;
|
|
|
|
@ -181,7 +229,7 @@ void _hf_prps_get_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 趋势报文接收 */
|
|
|
|
|
void _hf_trend_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
void _hf_recv_trend(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
dau_head_init_t head_data;
|
|
|
|
|
dau_t *dau = &daus[slot];
|
|
|
|
@ -251,7 +299,7 @@ void _hf_trend_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 事件报文接收 */
|
|
|
|
|
void _hf_event_recv(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
void _hf_recv_event(uint8_t slot, char *pkt, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
dau_head_init_t head_data;
|
|
|
|
|
dau_t *dau = &daus[slot];
|
|
|
|
|