📄 el.h
字号:
/****************************************************************************
*****************************************************************************
**
** File Name
** ---------
**
** EL.H
**
*****************************************************************************
*****************************************************************************
**
** Description
** -----------
**
** This module contains the public interfaces for the Ethernet Link Object.
**
*****************************************************************************
*****************************************************************************
**
** Source Change Indices
** ---------------------
**
** Porting: <none>0----<major> Customization: <none>0----<major>
**
*****************************************************************************
*****************************************************************************
**
** Services List
** -------------
**
** EL_Init() - Pre task startup initialization.
** EL_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 EL_H
#define EL_H
#include "elu_obj.h" /* Ethernet Link Object User interfaces */
/*
** See if this code is to be included.
*/
#ifdef ETHERNET_LINK_OBJECT
/****************************************************************************
**
** Constants
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
** Class and revision numbers.
**---------------------------------------------------------------------------
*/
#define EL_CLASS_NUMBER 0xF6
#define EL_REVISION 2/*1*/
/*---------------------------------------------------------------------------
**
** Class and instance attribute numbers.
**
**---------------------------------------------------------------------------
*/
#define EL_CA_REVISION 1
#define EL_CA_MAX_INSTANCE 2
#define EL_CA_NUM_INSTANCES 3
#define EL_IA_INTERFACE_SPEED 1
#define EL_IA_INTERFACE_FLAGS 2
#define EL_IA_PHYSICAL_ADDRESS 3
#define EL_IA_INTERFACE_COUNTERS 4
#define EL_IA_MEDIA_COUNTERS 5
/*---------------------------------------------------------------------------
**
** Object service codes.
**
**---------------------------------------------------------------------------
*/
#define EL_SC_GET_AND_CLEAR 0x4C
/*---------------------------------------------------------------------------
**
** Attribute data lengths.
**
**---------------------------------------------------------------------------
*/
#define EL_MAC_ADDR_LENGTH 6
/*---------------------------------------------------------------------------
**
** Interface flags attribute bit-map
**
**---------------------------------------------------------------------------
*/
/*
** Bit 0: 0 indicates inactive link; 1 indicates an active link
*/
#define EL_FLAG_LINK_ACTIVE 0x00000001
/*
** Bit 1: 0 indicates half duplex; 1 indicates full duplex
*/
#define EL_FLAG_DUPLEX_MODE 0x00000002
/****************************************************************************
**
** Typedefs
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EL_LeClassAttributeType
**
** Class attribute structure.
**
**---------------------------------------------------------------------------
*/
typedef packet_struct EL_LeClassAttributeType
{
LeUINT16 iLeRevision;
LeUINT16 iLeMaxInstance;
LeUINT16 iLeNumInstance;
}
GNU_PACKED EL_LeClassAttributeType;
/*---------------------------------------------------------------------------
**
** EL_LeInstanceAttributeType
**
** Instance attribute structure.
**
**---------------------------------------------------------------------------
*/
typedef packet_struct EL_LeInstanceAttributeType
{
LeUINT32 lLeInterfaceSpeed;
LeUINT32 lLeInterfaceFlags;
UINT8 achEnetAddr[EL_MAC_ADDR_LENGTH];
}
GNU_PACKED EL_LeInstanceAttributeType;
/****************************************************************************
**
** Globals
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EL_xQed
**
** Message queue for issuing requests to the Tcp/Ip Interface object.
**
**---------------------------------------------------------------------------
*/
extern GS_MsgQueueType EL_xQid;
/****************************************************************************
**
** Services
**
*****************************************************************************
*/
/*---------------------------------------------------------------------------
**
** EL_Init()
**
** Pre task startup initialization.
**
**---------------------------------------------------------------------------
**
** Inputs:
** None
**
** Outputs:
** None
**
** Usage:
** EL_Init()
**
**---------------------------------------------------------------------------
*/
EXTFUNC StatusType EL_Init( UINT16 iOptions );
/*---------------------------------------------------------------------------
**
** EL_ObjectTask()
**
** Ethernet Link Object, object task.
**
**---------------------------------------------------------------------------
**
** Inputs:
** None
**
** Outputs:
** None
**
** Usage:
** EL_ObjectTask()
**
**---------------------------------------------------------------------------
*/
EXTFUNC TASKRETURN EL_ObjectTask( TASKPARAM );
#endif /* #ifdef ETHERNET_LINK_OBJECT */
#endif /* inclusion lock */
/****************************************************************************
**
** End of EL.H
**
*****************************************************************************
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -