65 lines
2.3 KiB
C
65 lines
2.3 KiB
C
/**
|
|
* @file: $RCSfile: node.h,v $
|
|
* @brief: $节点定义头
|
|
*
|
|
* @version: $Revision: 1.1 $
|
|
* @date: $Date: 2018/11/24 06:54:49 $
|
|
* @author: $Author: lizhongming $
|
|
* @state: $State: Exp $
|
|
*
|
|
* @latest: $Id: node.h,v 1.1 2018/11/24 06:54:49 lizhongming Exp $
|
|
*/
|
|
|
|
#ifndef _COMMUNICATION_NODE_H
|
|
#define _COMMUNICATION_NODE_H
|
|
|
|
#include "ied.h"
|
|
|
|
|
|
typedef struct node_t node_t;
|
|
struct node_t {
|
|
uint32_t id; /**< 标志(唯一性) */
|
|
//uint32_t flags; /**< 属性控制字 */
|
|
//byte_t chntype; /**< 通信通道类型(Socket/Serial/CAN) */
|
|
//byte_t worktype; /**< 类型(Client/Server) */
|
|
//byte_t mode; /**< 传输模式(polling、cyclic) */
|
|
//uint32_t systoken_st; /**< 系统令牌的状态 */
|
|
char name[LONGNAME]; /**< 节点的名称 */
|
|
//void *driver_config; /**< 驱动的私有配置 */
|
|
//char *special_config; /**< 私有配置文件名 */
|
|
char *process_name; /**< 处理进程名称 */
|
|
|
|
/* Runtime data buffer */
|
|
//uint16_t index; /**< 设备索引 */
|
|
uint16_t n_clients; /**< 节点包含设备总数 */
|
|
ied_t **clients; /**< 节点包含设备ied_t链表 */
|
|
apr_time_t start_time;
|
|
apr_time_t last_used; /**< 该节点进程的最后一次正常访问时间 */
|
|
CP56Time2a proc_tmstamp; /**< 该节点进程的启动时间 */
|
|
int status; /**< 节点运行运行状态 */
|
|
//byte_t node_state[2]; /**< 各节点状态 */
|
|
|
|
/* Extend property */
|
|
void *sys_ext; /**< NODE的系统扩展属性,由基本库实现 */
|
|
void *app_ext; /**< NODE的应用扩展属性,由应用库实现 */
|
|
void *usr_ext; /**< NODE的用户扩展属性,由应用程序实现 */
|
|
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
|
|
/** Get channel(of IED) by address */
|
|
APR_DECLARE(channel_t*) get_channel_by_addr(uint32_t address);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /** _COMMUNICATION_NODE_H */
|