epa_sysmanent.h

来自「AVR单片机基础上的以太网协议编程」· C头文件 代码 · 共 88 行

H
88
字号
/**************************************************************************
**
**    文件: EPA_SysManEnt.h
**    描述: 该文件完成系统管理实体中常见服务报文的定义
**
*************************************************************************/

#ifndef EPA_SysManEnt_h
#define EPA_SysManEnt_h

//include user defined file
#include "Define.h"

//设备声明时的三种状态
#define Without_My_IP  0  //无IP地址
#define Standby        1  //未组态
#define Ready          2  //已组态

//设备声明请求报文,无证实服务
struct EM_DeviceAnnunciation 
{
    uchar DeviceID[32];                //设备ID
    uchar PD_Tag[32];                  //物理位号
    uchar Status;                      //0,无IP地址,1,未组态,2,已组态
    uchar Device_Type;                 //本地设备类型
    uint  Annunciation_Version_Number; //所发送声明消息的版本号
    uchar Device_Redundancy_Number;    //设备冗余号,该值为0时,本地设备为活动设备,并且无以下参数
    uchar Device_Redundancy_State; 
    uint  LAN_Redundancy_Port;
    uchar Duplicate_Tag_Detected;
    uchar Reserved[2]; 
    uchar Max_Redundancy_Number;
    uchar Active_IP_Address[4];
};

//清除设备属性请求报文,证实服务
struct EM_ClearDeviceAttribute
{
    uchar Destination_IP_Address[4];
    uchar DeviceID[32];
    uchar PD_Tag[32];
};

//清除设备属性服务正响应
struct EM_ClearDeviceAttribute_Result_Positive
{
    uchar Destination_IP_Address[4];
};

//清除设备属性服务负响应
struct EM_ClearDeviceAttribute_Result_Negative
{
    uchar Destination_IP_Address[4];
    ErrorType Error_Type;
}; 

//设置设备属性请求报文,证实服务
struct EM_SetDeviceAttribute
{
    uchar Destination_IP_Address[4];
    uchar DeviceID[32];
    uchar PD_Tag[32];
    uint  Annunciation_Interval;
    uchar Duplicate_Tag_Detected; 
    uchar Device_Redundancy_Number; //该值为0时,无以下四个参数
    uint  LAN_Redundancy_Port;
    uchar Device_Redundancy_State;
    uchar Max_Redundancy_Number;
    uchar Active_IP_Address[4];
};

//设备属性设置服务正响应
struct EM_SetDeviceAttribute_Result_Positive  
{
    uchar Destination_IP_Address[4];
    uchar Max_Redundancy_Number; //若Device_Redundancy_Number=0,无本参数
};

//设备属性设置服务负响应
struct EM_SetDeviceAttribute_Result_Negative
{
    uchar Destination_IP_Address[4];
    ErrorType Error_Type;
};
 
#endif

/******************* End Of File **********************/ 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?