📄 ei.h
字号:
/****************************************************************************
*****************************************************************************
**
** File Name
** ---------
**
** EI.H
**
*****************************************************************************
*****************************************************************************
**
** Description
** -----------
**
** This module contains the public interfaces for the TCP/IP Interface Object.
**
*****************************************************************************
*****************************************************************************
**
** Source Change Indices
** ---------------------
**
** Porting: <none>0----<major> Customization: <none>0----<major>
**
*****************************************************************************
*****************************************************************************
**
** Services List
** -------------
**
** EI_Init() - Pre task startup initialization.
** EI_ObjectTask() - Tribble processing task for the Object.
**
*****************************************************************************
*****************************************************************************
** **
** ETHERNET/IP EXAMPLE CODE **
** COPYRIGHT (c) 2000-2005 ODVA (Open DeviceNet Vendor Association) **
** & ControlNet International Ltd. **
** **
** All rights reserved, except as specifically licensed in writing. **
** Use of the Ethernet/IP Example Protocol Software is subject to **
** ODVA's and ControlNet International's Terms of Use Agreement. **
** The following work constitutes example program code and is intended **
** merely to illustrate useful programming techniques. The user is **
** responsible for applying the code correctly. The code is provided **
** AS IS without warranty and is in no way guaranteed to be error-free. **
** **
*****************************************************************************
*****************************************************************************
*/
/****************************************************************************
*****************************************************************************
**
** Change Log
** ----------
**
**
*****************************************************************************
*****************************************************************************
*/
#ifndef EI_H
#define EI_H
#include "eiu_obj.h" /* TCP/IP Interface Object User interfaces */
/*
** See if this code is to be included.
*/
#ifdef TCPIP_INTERFACE_OBJECT
/****************************************************************************
**
** Constants
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
** Class and revision numbers.
**---------------------------------------------------------------------------
*/
#define EI_CLASS_NUMBER 0xF5
#define EI_REVISION 1
/*---------------------------------------------------------------------------
**
** Class and instance attribute numbers.
**
**---------------------------------------------------------------------------
*/
#define EI_CA_REVISION 1
#define EI_CA_MAX_INSTANCE 2
#define EI_CA_NUM_INSTANCES 3
#define EI_IA_INTERFACE_STATUS 1
#define EI_IA_CONFIG_CAPABILITY 2
#define EI_IA_CONFIG_CONTROL 3
#define EI_IA_LINK_PATH 4
#define EI_IA_INTERFACE_CONFIG 5
#define EI_IA_HOST_NAME 6
/*---------------------------------------------------------------------------
**
** Attribute data lengths.
**
**---------------------------------------------------------------------------
*/
#define EI_MAX_DOMAIN_LENGTH 48
#define EI_MAX_HOST_LENGTH 64
/*---------------------------------------------------------------------------
**
** Status attribute bit-map
**
**---------------------------------------------------------------------------
*/
#define EI_STATUS_NOT_CONFIGURED 0x00000000
#define EI_STATUS_VALID_CONFIGURATION 0x00000001
/*---------------------------------------------------------------------------
**
** Capability attribute bit-map
**
**---------------------------------------------------------------------------
*/
#define EI_CAPABILITY_BOOTP 0x00000001
#define EI_CAPABILITY_DNS 0x00000002
#define EI_CAPABILITY_DHCP 0x00000004
#define EI_CAPABILITY_DHCP_DNS 0x00000008
#define EI_CAPABILITY_SETTABLE_CONFIG 0x00000010
/*---------------------------------------------------------------------------
**
** Control attribute bit-map
**
**---------------------------------------------------------------------------
*/
#define EI_CONTROL_CONFIG_BITMASK 0x00000007
#define EI_CONTROL_USE_STORED_CONFIG 0x00000000
#define EI_CONTROL_BOOTP 0x00000001
#define EI_CONTROL_DHCP 0x00000002
#define EI_CONTROL_DNS_ENABLE 0x00000010
/****************************************************************************
**
** Typedefs
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EI_LeClassAttributeType
**
** Class attribute structure.
**
**---------------------------------------------------------------------------
*/
typedef packet_struct EI_LeClassAttributeType
{
LeUINT16 iLeRevision;
LeUINT16 iLeMaxInstance;
LeUINT16 iLeNumInstance;
}
GNU_PACKED EI_LeClassAttributeType;
/*---------------------------------------------------------------------------
**
** EI_LeInstanceAttributeType
**
** Instance attribute structure. Note the placeholders for the variable
** length fields "achDomainName", "iLeHostNameSize" and "achHostName".
**
**---------------------------------------------------------------------------
*/
typedef packet_struct EI_LeInterfaceConfig
{
LeUINT32 lLeIpAddr;
LeUINT32 lLeSubnetMask;
LeUINT32 lLeGatewayAddr;
LeUINT32 lLeNameServer;
LeUINT32 lLeNameServer_2;
LeUINT16 iLeDomainNameSize;
/* UINT8 achDomainName[EI_MAX_DOMAIN_LENGTH]; */
}
GNU_PACKED EI_LeInterfaceConfig;
typedef packet_struct EI_LeInstanceAttributeType
{
LeUINT32 lLeInterfaceStatus;
LeUINT32 lLeConfigCapability;
LeUINT32 lLeConfigControl;
LeUINT16 iLeLinkObjPathSize;
UINT8 achLinkObjPath[EIU_LINK_PATH_LENGTH];
packet_struct EI_LeInterfaceConfig sLeInterfaceConfig;
/* LeUINT16 iLeHostNameSize; */
/* UINT8 achHostName[EI_MAX_HOST_LENGTH]; */
}
GNU_PACKED EI_LeInstanceAttributeType;
/****************************************************************************
**
** Globals
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EI_xQed
**
** Message queue for issuing requests to the Tcp/Ip Interface object.
**
**---------------------------------------------------------------------------
*/
extern GS_MsgQueueType EI_xQid;
/****************************************************************************
**
** Services
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EI_Init()
**
** Pre task startup initialization.
**
**---------------------------------------------------------------------------
**
** Inputs:
** None
**
** Outputs:
** None
**
** Usage:
** EI_Init()
**
**---------------------------------------------------------------------------
*/
EXTFUNC StatusType EI_Init( UINT16 iOptions );
/*---------------------------------------------------------------------------
**
** EI_ObjectTask()
**
** TCP/IP Interface Object, object task.
**
**---------------------------------------------------------------------------
**
** Inputs:
** None
**
** Outputs:
** None
**
** Usage:
** EI_ObjectTask()
**
**---------------------------------------------------------------------------
*/
EXTFUNC TASKRETURN EI_ObjectTask( TASKPARAM );
#endif /* #ifdef TCPIP_INTERFACE_OBJECT */
#endif /* inclusion lock */
/****************************************************************************
**
** End of EI.H
**
*****************************************************************************
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -